1 // normalize-stderr-test: "existed:.*\(" -> "existed: $$FILE_NOT_FOUND_MSG ("
3 // test that errors in a (selection) of macros don't kill compilation
4 // immediately, so that we get more errors listed at a time.
6 #![feature(trace_macros, concat_idents)]
7 #![feature(stmt_expr_attributes, arbitrary_enum_discriminant)]
8 #![feature(derive_default_enum)]
13 struct DefaultInnerAttrStruct {
14 #[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
19 struct DefaultInnerAttrTupleStruct(#[default] ());
20 //~^ ERROR the `#[default]` attribute may only be used on unit enum variants
23 #[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
24 struct DefaultOuterAttrStruct {}
27 #[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
28 enum DefaultOuterAttrEnum {
33 #[rustfmt::skip] // needs some work to handle this case
36 enum AttrOnInnerExpression {
37 Foo = #[default] 0, //~ ERROR the `#[default]` attribute may only be used on unit enum variants
38 Bar([u8; #[default] 1]), //~ ERROR the `#[default]` attribute may only be used on unit enum variants
43 #[derive(Default)] //~ ERROR no default declared
44 enum NoDeclaredDefault {
49 #[derive(Default)] //~ ERROR multiple declared defaults
50 enum MultipleDefaults {
60 enum ExtraDeriveTokens {
61 #[default = 1] //~ ERROR `#[default]` attribute does not accept a value
66 enum TwoDefaultAttrs {
69 Foo, //~ERROR multiple `#[default]` attributes
74 enum ManyDefaultAttrs {
79 Foo, //~ERROR multiple `#[default]` attributes
84 enum DefaultHasFields {
86 Foo {}, //~ ERROR the `#[default]` attribute may only be used on unit enum variants
91 enum NonExhaustiveDefault {
94 Foo, //~ ERROR default variant must be exhaustive
99 asm!(invalid); //~ ERROR
100 llvm_asm!(invalid); //~ ERROR
102 concat_idents!("not", "idents"); //~ ERROR
104 option_env!(invalid); //~ ERROR
105 env!(invalid); //~ ERROR
106 env!(foo, abr, baz); //~ ERROR
107 env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR
109 format!(invalid); //~ ERROR
111 include!(invalid); //~ ERROR
113 include_str!(invalid); //~ ERROR
114 include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR
115 include_bytes!(invalid); //~ ERROR
116 include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR
118 trace_macros!(invalid); //~ ERROR