| 1 |
#![feature(rustc_attrs)] |
| 2 |
|
| 3 |
#[rustc_builtin_macro] |
| 4 |
macro_rules! include_bytes { |
| 5 |
() => {{}}; |
| 6 |
} |
| 7 |
|
| 8 |
macro_rules! file1 { |
| 9 |
() => {"file"}; |
| 10 |
} |
| 11 |
|
| 12 |
static MY_FILE: &[u32;16] = include_bytes!(file!()); |
| 13 |
|
| 14 |
fn main() { |
| 15 |
let file = "include.txt"; |
| 16 |
include_bytes!(file); // { dg-error "argument must be a string literal" "" } |
| 17 |
include_bytes!(); // { dg-error "macro takes 1 argument" "" } |
| 18 |
include_bytes!("foo.txt", "bar.txt"); // { dg-error "macro takes 1 argument" "" } |
| 19 |
include_bytes!("include_bytes.rs"); // ok |
| 20 |
include_bytes!("include_bytes.rs",); // trailing comma ok |
| 21 |
include_bytes! (file1!()); |
| 22 |
include_bytes! (file1!(),); // trailing comma ok |
| 23 |
} |