File tree 2 files changed +7
-3
lines changed
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> {
62
62
None => continue ,
63
63
} ;
64
64
65
- let word: & str = & word. name ( ) ;
66
- let ( message, label) = match word {
65
+ let ( message, label) = match & * name {
67
66
"C" => {
68
67
conflicting_reprs += 1 ;
69
68
if target != Target :: Struct &&
@@ -80,7 +79,8 @@ impl<'a> CheckAttrVisitor<'a> {
80
79
// can be used to modify another repr hint
81
80
if target != Target :: Struct &&
82
81
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" )
84
84
} else {
85
85
continue
86
86
}
Original file line number Diff line number Diff line change 9
9
// except according to those terms.
10
10
11
11
#[ repr( C ) ] //~ ERROR E0517
12
+ //~| requires a struct, enum or union
12
13
type Foo = u8 ;
13
14
14
15
#[ repr( packed) ] //~ ERROR E0517
16
+ //~| requires a struct
15
17
enum Foo2 { Bar , Baz }
16
18
17
19
#[ repr( u8 ) ] //~ ERROR E0517
20
+ //~| requires an enum
18
21
struct Foo3 { bar : bool , baz : bool }
19
22
20
23
#[ repr( C ) ] //~ ERROR E0517
24
+ //~| requires a struct, enum or union
21
25
impl Foo3 {
22
26
}
23
27
You can’t perform that action at this time.
0 commit comments