@@ -901,38 +901,36 @@ pub fn find_repr_attrs(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
901901 )
902902 . emit ( ) ;
903903 }
904- } else {
905- if let Some ( meta_item) = item. meta_item ( ) {
906- if meta_item. has_name ( sym:: align) {
907- if let MetaItemKind :: NameValue ( ref value) = meta_item. kind {
908- recognised = true ;
909- let mut err = struct_span_err ! (
910- diagnostic,
911- item. span( ) ,
912- E0693 ,
913- "incorrect `repr(align)` attribute format"
914- ) ;
915- match value. kind {
916- ast:: LitKind :: Int ( int, ast:: LitIntType :: Unsuffixed ) => {
917- err. span_suggestion (
918- item. span ( ) ,
919- "use parentheses instead" ,
920- format ! ( "align({})" , int) ,
921- Applicability :: MachineApplicable ,
922- ) ;
923- }
924- ast:: LitKind :: Str ( s, _) => {
925- err. span_suggestion (
926- item. span ( ) ,
927- "use parentheses instead" ,
928- format ! ( "align({})" , s) ,
929- Applicability :: MachineApplicable ,
930- ) ;
931- }
932- _ => { }
904+ } else if let Some ( meta_item) = item. meta_item ( ) {
905+ if meta_item. has_name ( sym:: align) {
906+ if let MetaItemKind :: NameValue ( ref value) = meta_item. kind {
907+ recognised = true ;
908+ let mut err = struct_span_err ! (
909+ diagnostic,
910+ item. span( ) ,
911+ E0693 ,
912+ "incorrect `repr(align)` attribute format"
913+ ) ;
914+ match value. kind {
915+ ast:: LitKind :: Int ( int, ast:: LitIntType :: Unsuffixed ) => {
916+ err. span_suggestion (
917+ item. span ( ) ,
918+ "use parentheses instead" ,
919+ format ! ( "align({})" , int) ,
920+ Applicability :: MachineApplicable ,
921+ ) ;
922+ }
923+ ast:: LitKind :: Str ( s, _) => {
924+ err. span_suggestion (
925+ item. span ( ) ,
926+ "use parentheses instead" ,
927+ format ! ( "align({})" , s) ,
928+ Applicability :: MachineApplicable ,
929+ ) ;
933930 }
934- err . emit ( ) ;
931+ _ => { }
935932 }
933+ err. emit ( ) ;
936934 }
937935 }
938936 }
0 commit comments