22#![ deny( unused_attributes, unused_must_use) ]
33#![ feature( asm_experimental_arch, stmt_expr_attributes, trait_alias) ]
44
5- #[ must_use] //~ ERROR `#[must_use]` has no effect
5+ #[ must_use] //~ ERROR this attribute is not allowed on this target
66extern crate std as std2;
77
8- #[ must_use] //~ ERROR `#[must_use]` has no effect
8+ #[ must_use] //~ ERROR this attribute is not allowed on this target
99mod test_mod { }
1010
11- #[ must_use] //~ ERROR `#[must_use]` has no effect
11+ #[ must_use] //~ ERROR this attribute is not allowed on this target
1212use std:: arch:: global_asm;
1313
14- #[ must_use] //~ ERROR `#[must_use]` has no effect
14+ #[ must_use] //~ ERROR this attribute is not allowed on this target
1515const CONST : usize = 4 ;
16- #[ must_use] //~ ERROR `#[must_use]` has no effect
16+ #[ must_use] //~ ERROR this attribute is not allowed on this target
1717#[ no_mangle]
1818static STATIC : usize = 4 ;
1919
@@ -30,7 +30,7 @@ union U {
3030 unit : ( ) ,
3131}
3232
33- #[ must_use] //~ ERROR `#[must_use]` has no effect
33+ #[ must_use] //~ ERROR this attribute is not allowed on this target
3434impl U {
3535 #[ must_use]
3636 fn method ( ) -> i32 {
@@ -44,10 +44,10 @@ fn foo() -> i64 {
4444 4
4545}
4646
47- #[ must_use] //~ ERROR `#[must_use]` has no effect
47+ #[ must_use] //~ ERROR this attribute is not allowed on this target
4848extern "Rust" {
4949 #[ link_name = "STATIC" ]
50- #[ must_use] //~ ERROR `#[must_use]` has no effect
50+ #[ must_use] //~ ERROR this attribute is not allowed on this target
5151 static FOREIGN_STATIC : usize ;
5252
5353 #[ link_name = "foo" ]
@@ -58,16 +58,16 @@ extern "Rust" {
5858#[ must_use] //~ ERROR unused attribute
5959global_asm ! ( "" ) ;
6060
61- #[ must_use] //~ ERROR `#[must_use]` has no effect
61+ #[ must_use] //~ ERROR this attribute is not allowed on this target
6262type UseMe = ( ) ;
6363
64- fn qux < #[ must_use] T > ( _: T ) { } //~ ERROR `#[must_use]` has no effect
64+ fn qux < #[ must_use] T > ( _: T ) { } //~ ERROR this attribute is not allowed on this target
6565
6666#[ must_use]
6767trait Use {
68- #[ must_use] //~ ERROR `#[must_use]` has no effect
68+ #[ must_use] //~ ERROR this attribute is not allowed on this target
6969 const ASSOC_CONST : usize = 4 ;
70- #[ must_use] //~ ERROR `#[must_use]` has no effect
70+ #[ must_use] //~ ERROR this attribute is not allowed on this target
7171 type AssocTy ;
7272
7373 #[ must_use]
@@ -76,32 +76,32 @@ trait Use {
7676 }
7777}
7878
79- #[ must_use] //~ ERROR `#[must_use]` has no effect
79+ #[ must_use] //~ ERROR this attribute is not allowed on this target
8080impl Use for ( ) {
8181 type AssocTy = ( ) ;
8282
83- #[ must_use] //~ ERROR `#[must_use]` has no effect
83+ #[ must_use] //~ ERROR this attribute is not allowed on this target
8484 fn get_four ( & self ) -> usize {
8585 4
8686 }
8787}
8888
89- #[ must_use] //~ ERROR `#[must_use]` has no effect
89+ #[ must_use] //~ ERROR this attribute is not allowed on this target
9090trait Alias = Use ;
9191
92- #[ must_use] //~ ERROR `#[must_use]` has no effect
92+ #[ must_use] //~ ERROR this attribute is not allowed on this target
9393macro_rules! cool_macro {
9494 ( ) => {
9595 4
9696 } ;
9797}
9898
9999fn main ( ) {
100- #[ must_use] //~ ERROR `#[must_use]` has no effect
100+ #[ must_use] //~ ERROR this attribute is not allowed on this target
101101 let x = || { } ;
102102 x ( ) ;
103103
104- let x = #[ must_use] //~ ERROR `#[must_use]` has no effect
104+ let x = #[ must_use] //~ ERROR this attribute is not allowed on this target
105105 || { } ;
106106 x ( ) ;
107107
@@ -123,14 +123,14 @@ fn main() {
123123 ( ) . get_four ( ) ; //~ ERROR that must be used
124124
125125 match Some ( 4 ) {
126- #[ must_use] //~ ERROR `#[must_use]` has no effect
126+ #[ must_use] //~ ERROR this attribute is not allowed on this target
127127 Some ( res) => res,
128128 None => 0 ,
129129 } ;
130130
131131 struct PatternField {
132132 foo : i32 ,
133133 }
134- let s = PatternField { #[ must_use] foo : 123 } ; //~ ERROR `#[must_use]` has no effect
135- let PatternField { #[ must_use] foo } = s; //~ ERROR `#[must_use]` has no effect
134+ let s = PatternField { #[ must_use] foo : 123 } ; //~ ERROR this attribute is not allowed on this target
135+ let PatternField { #[ must_use] foo } = s; //~ ERROR this attribute is not allowed on this target
136136}
0 commit comments