]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/macros-nonfatal-errors.rs
Rename include_bin! to include_bytes!
[rust.git] / src / test / compile-fail / macros-nonfatal-errors.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // test that errors in a (selection) of macros don't kill compilation
12 // immediately, so that we get more errors listed at a time.
13
14 #![feature(asm)]
15 #![feature(trace_macros, concat_idents)]
16
17 #[deriving(Default, //~ ERROR
18            Rand, //~ ERROR
19            Zero)] //~ ERROR
20 enum CantDeriveThose {}
21
22 fn main() {
23     doesnt_exist!(); //~ ERROR
24
25     bytes!(invalid); //~ ERROR non-literal in bytes!
26     //~^ WARN `bytes!` is deprecated
27
28     asm!(invalid); //~ ERROR
29
30     concat_idents!("not", "idents"); //~ ERROR
31
32     option_env!(invalid); //~ ERROR
33     env!(invalid); //~ ERROR
34     env!(foo, abr, baz); //~ ERROR
35     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
36
37     foo::blah!(); //~ ERROR
38
39     format!(); //~ ERROR
40     format!(invalid); //~ ERROR
41
42     include!(invalid); //~ ERROR
43
44     include_str!(invalid); //~ ERROR
45     include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR
46     include_bytes!(invalid); //~ ERROR
47     include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR
48
49     trace_macros!(invalid); //~ ERROR
50 }