File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ impl<'a> CheckAttrVisitor<'a> {
6262 None => continue ,
6363 } ;
6464
65- let word: & str = & word. name ( ) ;
66- let ( message, label) = match word {
65+ let ( message, label) = match & * name {
6766 "C" => {
6867 conflicting_reprs += 1 ;
6968 if target != Target :: Struct &&
@@ -80,7 +79,8 @@ impl<'a> CheckAttrVisitor<'a> {
8079 // can be used to modify another repr hint
8180 if target != Target :: Struct &&
8281 target != Target :: Union {
83- "attribute should be applied to struct or union"
82+ ( "attribute should be applied to struct or union" ,
83+ "a struct or union" )
8484 } else {
8585 continue
8686 }
Original file line number Diff line number Diff line change 99// except according to those terms.
1010
1111#[ repr( C ) ] //~ ERROR E0517
12+ //~| requires a struct, enum or union
1213type Foo = u8 ;
1314
1415#[ repr( packed) ] //~ ERROR E0517
16+ //~| requires a struct
1517enum Foo2 { Bar , Baz }
1618
1719#[ repr( u8 ) ] //~ ERROR E0517
20+ //~| requires an enum
1821struct Foo3 { bar : bool , baz : bool }
1922
2023#[ repr( C ) ] //~ ERROR E0517
24+ //~| requires a struct, enum or union
2125impl Foo3 {
2226}
2327
You can’t perform that action at this time.
0 commit comments