@@ -36,7 +36,7 @@ impl<'a> Module<'a> {
36
36
mod_span : Span ,
37
37
ast_mod_kind : Option < Cow < ' a , ast:: ModKind > > ,
38
38
mod_items : Cow < ' a , ThinVec < rustc_ast:: ptr:: P < ast:: Item > > > ,
39
- mod_attrs : Cow < ' a , ast:: AttrVec > ,
39
+ mod_attrs : & [ ast:: Attribute ] ,
40
40
) -> Self {
41
41
let inner_attr = mod_attrs
42
42
. iter ( )
@@ -141,7 +141,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
141
141
mk_sp ( snippet_provider. start_pos ( ) , snippet_provider. end_pos ( ) ) ,
142
142
None ,
143
143
Cow :: Borrowed ( & krate. items ) ,
144
- Cow :: Borrowed ( & krate. attrs ) ,
144
+ & krate. attrs ,
145
145
) ,
146
146
) ;
147
147
Ok ( self . file_map )
@@ -174,7 +174,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
174
174
span,
175
175
Some ( Cow :: Owned ( sub_mod_kind. clone ( ) ) ) ,
176
176
Cow :: Owned ( ThinVec :: new ( ) ) ,
177
- Cow :: Owned ( ast :: AttrVec :: new ( ) ) ,
177
+ & [ ] ,
178
178
) ,
179
179
) ?;
180
180
}
@@ -200,7 +200,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
200
200
span,
201
201
Some ( Cow :: Borrowed ( sub_mod_kind) ) ,
202
202
Cow :: Owned ( ThinVec :: new ( ) ) ,
203
- Cow :: Borrowed ( & item . attrs ) ,
203
+ & [ ] ,
204
204
) ,
205
205
) ?;
206
206
}
@@ -338,7 +338,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
338
338
span,
339
339
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
340
340
Cow :: Owned ( items) ,
341
- Cow :: Owned ( attrs) ,
341
+ & attrs,
342
342
) ,
343
343
) ) ) ,
344
344
Err ( ParserError :: ParseError ) => Err ( ModuleResolutionError {
@@ -388,7 +388,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
388
388
span,
389
389
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
390
390
Cow :: Owned ( items) ,
391
- Cow :: Owned ( attrs) ,
391
+ & attrs,
392
392
) ,
393
393
) ) )
394
394
}
@@ -400,7 +400,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
400
400
span,
401
401
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
402
402
Cow :: Owned ( items) ,
403
- Cow :: Owned ( attrs) ,
403
+ & attrs,
404
404
) ,
405
405
) ) ;
406
406
if should_insert {
@@ -528,7 +528,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
528
528
span,
529
529
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
530
530
Cow :: Owned ( items) ,
531
- Cow :: Owned ( attrs) ,
531
+ & attrs,
532
532
) ,
533
533
) )
534
534
}
0 commit comments