@@ -6,30 +6,30 @@ use base_db::Crate;
66use cfg:: { CfgExpr , CfgOptions } ;
77use either:: Either ;
88use hir_expand:: {
9- HirFileId , InFile ,
10- attrs:: { Attr , AttrId , RawAttrs , collect_attrs} ,
9+ attrs:: { collect_attrs, Attr , AttrId , RawAttrs } ,
1110 span_map:: SpanMapRef ,
11+ HirFileId , InFile ,
1212} ;
13- use intern:: { Symbol , sym } ;
13+ use intern:: { sym , Symbol } ;
1414use la_arena:: { ArenaMap , Idx , RawIdx } ;
1515use mbe:: DelimiterKind ;
1616use rustc_abi:: ReprOptions ;
1717use span:: AstIdNode ;
1818use syntax:: {
19- AstPtr ,
2019 ast:: { self , HasAttrs } ,
20+ AstPtr ,
2121} ;
2222use triomphe:: Arc ;
2323use tt:: iter:: { TtElement , TtIter } ;
2424
2525use crate :: {
26- AdtId , AstIdLoc , AttrDefId , GenericParamId , HasModule , LocalFieldId , Lookup , MacroId ,
27- VariantId ,
2826 db:: DefDatabase ,
2927 item_tree:: block_item_tree_query,
3028 lang_item:: LangItem ,
3129 nameres:: { ModuleOrigin , ModuleSource } ,
3230 src:: { HasChildSource , HasSource } ,
31+ AdtId , AstIdLoc , AttrDefId , GenericParamId , HasModule , LocalFieldId , Lookup , MacroId ,
32+ VariantId ,
3333} ;
3434
3535/// Desugared attributes of an item post `cfg_attr` expansion.
@@ -199,7 +199,11 @@ impl Attrs {
199199 #[ inline]
200200 pub ( crate ) fn is_cfg_enabled ( & self , cfg_options : & CfgOptions ) -> Result < ( ) , CfgExpr > {
201201 self . cfgs ( ) . try_for_each ( |cfg| {
202- if cfg_options. check ( & cfg) != Some ( false ) { Ok ( ( ) ) } else { Err ( cfg) }
202+ if cfg_options. check ( & cfg) != Some ( false ) {
203+ Ok ( ( ) )
204+ } else {
205+ Err ( cfg)
206+ }
203207 } )
204208 }
205209
@@ -331,7 +335,7 @@ fn parse_rustc_legacy_const_generics(tt: &crate::tt::TopSubtree) -> Box<[u32]> {
331335}
332336
333337fn merge_repr ( this : & mut ReprOptions , other : ReprOptions ) {
334- let ReprOptions { int, align, pack, flags, field_shuffle_seed : _ } = this;
338+ let ReprOptions { int, align, pack, flags, scalable , field_shuffle_seed : _ } = this;
335339 flags. insert ( other. flags ) ;
336340 * align = ( * align) . max ( other. align ) ;
337341 * pack = match ( * pack, other. pack ) {
@@ -341,6 +345,9 @@ fn merge_repr(this: &mut ReprOptions, other: ReprOptions) {
341345 if other. int . is_some ( ) {
342346 * int = other. int ;
343347 }
348+ if other. scalable . is_some ( ) {
349+ * scalable = other. scalable ;
350+ }
344351}
345352
346353fn parse_repr_tt ( tt : & crate :: tt:: TopSubtree ) -> Option < ReprOptions > {
@@ -852,8 +859,8 @@ mod tests {
852859
853860 use hir_expand:: span_map:: { RealSpanMap , SpanMap } ;
854861 use span:: FileId ;
855- use syntax:: { AstNode , TextRange , ast } ;
856- use syntax_bridge:: { DocCommentDesugarMode , syntax_node_to_token_tree } ;
862+ use syntax:: { ast , AstNode , TextRange } ;
863+ use syntax_bridge:: { syntax_node_to_token_tree , DocCommentDesugarMode } ;
857864
858865 use crate :: attr:: { DocAtom , DocExpr } ;
859866
0 commit comments