about summary refs log tree commit diff
path: root/src/libstd/macros.rs
diff options
context:
space:
mode:
authorJake Goulding <jake.goulding@gmail.com>2015-09-07 20:01:14 -0400
committerJake Goulding <jake.goulding@gmail.com>2015-09-07 20:01:14 -0400
commitacea5f4c82fa8ae084606b5383562f3dc3357d90 (patch)
tree475eec6e85642c56da8e20263c6097d34c645ec7 /src/libstd/macros.rs
parent7bf626a68045be1d1a4fac9a635113bb7775b6bb (diff)
downloadrust-acea5f4c82fa8ae084606b5383562f3dc3357d90.tar.gz
rust-acea5f4c82fa8ae084606b5383562f3dc3357d90.zip
Clarify that `include_bytes!` returns a reference to an array, not just 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 `()`
Diffstat (limited to 'src/libstd/macros.rs')
-rw-r--r--src/libstd/macros.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index e4866982176..a0c3f013f2b 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -412,9 +412,9 @@ pub mod builtin {
     #[macro_export]
     macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }) }
 
-    /// Includes a file as a byte slice.
+    /// Includes a file as a reference to a byte array.
     ///
-    /// This macro will yield an expression of type `&'static [u8]` which is
+    /// This macro will yield an expression of type `&'static [u8; N]` which is
     /// the contents of the filename specified. The file is located relative to
     /// the current file (similarly to how modules are found),
     ///