Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify that include_bytes! returns a reference to an array, not just a slice #28289

Merged
merged 1 commit into from
Sep 9, 2015

Conversation

shepmaster
Copy link
Member

This can be shown with the example code

fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`

…st a slice

This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@shepmaster
Copy link
Member Author

r? @steveklabnik

@rust-highfive rust-highfive assigned steveklabnik and unassigned aturon Sep 8, 2015
@alexcrichton
Copy link
Member

@bors: r+ acea5f4

@Manishearth
Copy link
Member

@bors rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 9, 2015
…excrichton

 This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!(\"/etc/hosts\");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 9, 2015
…excrichton

This can be shown with the example code

```rust
fn main() {
    let () = include_bytes!("/etc/hosts");
}

Which will have the error:

expected `&[u8; 195]`,
    found `()`
bors added a commit that referenced this pull request Sep 9, 2015
@bors bors merged commit acea5f4 into rust-lang:master Sep 9, 2015
@shepmaster shepmaster deleted the include_bytes-docs branch September 24, 2016 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants