55// Test that the `#[collapse_debuginfo]` attribute can only be used on macro definitions.
66
77#[ collapse_debuginfo( yes) ]
8- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
8+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
99extern crate std;
1010
1111#[ collapse_debuginfo( yes) ]
12- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
12+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
1313use std:: collections:: HashMap ;
1414
1515#[ collapse_debuginfo( yes) ]
16- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
16+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
1717static FOO : u32 = 3 ;
1818
1919#[ collapse_debuginfo( yes) ]
20- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
20+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
2121const BAR : u32 = 3 ;
2222
2323#[ collapse_debuginfo( yes) ]
24- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
24+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
2525fn foo ( ) {
2626 let _ = #[ collapse_debuginfo ( yes) ] || { } ;
27- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
27+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
2828 #[ collapse_debuginfo( yes) ]
29- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
29+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
3030 let _ = 3 ;
3131 let _ = #[ collapse_debuginfo ( yes) ] 3 ;
32- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
32+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
3333 match ( 3 , 4 ) {
3434 #[ collapse_debuginfo( yes) ]
35- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
35+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
3636 _ => ( ) ,
3737 }
3838}
3939
4040#[ collapse_debuginfo( yes) ]
41- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
41+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
4242mod bar {
4343}
4444
4545#[ collapse_debuginfo( yes) ]
46- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
46+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
4747type Map = HashMap < u32 , u32 > ;
4848
4949#[ collapse_debuginfo( yes) ]
50- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
50+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
5151enum Foo {
5252 #[ collapse_debuginfo( yes) ]
53- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
53+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
5454 Variant ,
5555}
5656
5757#[ collapse_debuginfo( yes) ]
58- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
58+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
5959struct Bar {
6060 #[ collapse_debuginfo( yes) ]
61- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
61+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
6262 field : u32 ,
6363}
6464
6565#[ collapse_debuginfo( yes) ]
66- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
66+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
6767union Qux {
6868 a : u32 ,
6969 b : u16
7070}
7171
7272#[ collapse_debuginfo( yes) ]
73- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
73+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
7474trait Foobar {
7575 #[ collapse_debuginfo( yes) ]
76- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
76+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
7777 type Bar ;
7878}
7979
8080#[ collapse_debuginfo( yes) ]
81- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
81+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
8282type AFoobar = impl Foobar ;
8383
8484impl Foobar for Bar {
@@ -91,14 +91,14 @@ fn constraining() -> AFoobar {
9191}
9292
9393#[ collapse_debuginfo( yes) ]
94- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
94+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
9595impl Bar {
9696 #[ collapse_debuginfo( yes) ]
97- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
97+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
9898 const FOO : u32 = 3 ;
9999
100100 #[ collapse_debuginfo( yes) ]
101- //~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
101+ //~^ ERROR `#[ collapse_debuginfo] ` attribute cannot be used on
102102 fn bar ( & self ) { }
103103}
104104
0 commit comments