]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macros-nonfatal-errors.rs
Stabilize `use_extern_macros`
[rust.git] / src / test / ui / macros / 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 // normalize-stderr-test: "The system cannot find the file specified\." -> "No such file or directory"
12 // ignore-tidy-linelength
13
14 // test that errors in a (selection) of macros don't kill compilation
15 // immediately, so that we get more errors listed at a time.
16
17 #![feature(asm)]
18 #![feature(trace_macros, concat_idents)]
19
20 #[derive(Default)] //~ ERROR
21 enum OrDeriveThis {}
22
23 fn main() {
24     asm!(invalid); //~ ERROR
25
26     concat_idents!("not", "idents"); //~ ERROR
27
28     option_env!(invalid); //~ ERROR
29     env!(invalid); //~ ERROR
30     env!(foo, abr, baz); //~ ERROR
31     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
32
33     format!(invalid); //~ ERROR
34
35     include!(invalid); //~ ERROR
36
37     include_str!(invalid); //~ ERROR
38     include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR
39     include_bytes!(invalid); //~ ERROR
40     include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR
41
42     trace_macros!(invalid); //~ ERROR
43 }