@@ -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 )
@@ -159,7 +159,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
159
159
module_item. item . span ,
160
160
Some ( Cow :: Owned ( sub_mod_kind. clone ( ) ) ) ,
161
161
Cow :: Owned ( ThinVec :: new ( ) ) ,
162
- Cow :: Owned ( ast :: AttrVec :: new ( ) ) ,
162
+ & [ ] ,
163
163
) ,
164
164
) ?;
165
165
}
@@ -186,7 +186,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
186
186
span,
187
187
Some ( Cow :: Owned ( sub_mod_kind. clone ( ) ) ) ,
188
188
Cow :: Owned ( ThinVec :: new ( ) ) ,
189
- Cow :: Owned ( ast :: AttrVec :: new ( ) ) ,
189
+ & [ ] ,
190
190
) ,
191
191
) ?;
192
192
}
@@ -212,7 +212,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
212
212
span,
213
213
Some ( Cow :: Borrowed ( sub_mod_kind) ) ,
214
214
Cow :: Owned ( ThinVec :: new ( ) ) ,
215
- Cow :: Borrowed ( & item . attrs ) ,
215
+ & [ ] ,
216
216
) ,
217
217
) ?;
218
218
}
@@ -350,7 +350,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
350
350
span,
351
351
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
352
352
Cow :: Owned ( items) ,
353
- Cow :: Owned ( attrs) ,
353
+ & attrs,
354
354
) ,
355
355
) ) ) ,
356
356
Err ( ParserError :: ParseError ) => Err ( ModuleResolutionError {
@@ -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
}
@@ -412,7 +412,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
412
412
span,
413
413
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
414
414
Cow :: Owned ( items) ,
415
- Cow :: Owned ( attrs) ,
415
+ & attrs,
416
416
) ,
417
417
) ) ;
418
418
if should_insert {
@@ -540,7 +540,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
540
540
span,
541
541
Some ( Cow :: Owned ( ast:: ModKind :: Unloaded ) ) ,
542
542
Cow :: Owned ( items) ,
543
- Cow :: Owned ( attrs) ,
543
+ & attrs,
544
544
) ,
545
545
) )
546
546
}
0 commit comments