@@ -6,30 +6,30 @@ use base_db::Crate;
6
6
use cfg:: { CfgExpr , CfgOptions } ;
7
7
use either:: Either ;
8
8
use hir_expand:: {
9
- HirFileId , InFile ,
10
- attrs:: { Attr , AttrId , RawAttrs , collect_attrs} ,
9
+ attrs:: { collect_attrs, Attr , AttrId , RawAttrs } ,
11
10
span_map:: SpanMapRef ,
11
+ HirFileId , InFile ,
12
12
} ;
13
- use intern:: { Symbol , sym } ;
13
+ use intern:: { sym , Symbol } ;
14
14
use la_arena:: { ArenaMap , Idx , RawIdx } ;
15
15
use mbe:: DelimiterKind ;
16
16
use rustc_abi:: ReprOptions ;
17
17
use span:: AstIdNode ;
18
18
use syntax:: {
19
- AstPtr ,
20
19
ast:: { self , HasAttrs } ,
20
+ AstPtr ,
21
21
} ;
22
22
use triomphe:: Arc ;
23
23
use tt:: iter:: { TtElement , TtIter } ;
24
24
25
25
use crate :: {
26
- AdtId , AstIdLoc , AttrDefId , GenericParamId , HasModule , LocalFieldId , Lookup , MacroId ,
27
- VariantId ,
28
26
db:: DefDatabase ,
29
27
item_tree:: block_item_tree_query,
30
28
lang_item:: LangItem ,
31
29
nameres:: { ModuleOrigin , ModuleSource } ,
32
30
src:: { HasChildSource , HasSource } ,
31
+ AdtId , AstIdLoc , AttrDefId , GenericParamId , HasModule , LocalFieldId , Lookup , MacroId ,
32
+ VariantId ,
33
33
} ;
34
34
35
35
/// Desugared attributes of an item post `cfg_attr` expansion.
@@ -199,7 +199,11 @@ impl Attrs {
199
199
#[ inline]
200
200
pub ( crate ) fn is_cfg_enabled ( & self , cfg_options : & CfgOptions ) -> Result < ( ) , CfgExpr > {
201
201
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
+ }
203
207
} )
204
208
}
205
209
@@ -331,7 +335,7 @@ fn parse_rustc_legacy_const_generics(tt: &crate::tt::TopSubtree) -> Box<[u32]> {
331
335
}
332
336
333
337
fn 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;
335
339
flags. insert ( other. flags ) ;
336
340
* align = ( * align) . max ( other. align ) ;
337
341
* pack = match ( * pack, other. pack ) {
@@ -341,6 +345,9 @@ fn merge_repr(this: &mut ReprOptions, other: ReprOptions) {
341
345
if other. int . is_some ( ) {
342
346
* int = other. int ;
343
347
}
348
+ if other. scalable . is_some ( ) {
349
+ * scalable = other. scalable ;
350
+ }
344
351
}
345
352
346
353
fn parse_repr_tt ( tt : & crate :: tt:: TopSubtree ) -> Option < ReprOptions > {
@@ -852,8 +859,8 @@ mod tests {
852
859
853
860
use hir_expand:: span_map:: { RealSpanMap , SpanMap } ;
854
861
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 } ;
857
864
858
865
use crate :: attr:: { DocAtom , DocExpr } ;
859
866
0 commit comments