Skip to content

Commit 2a6bd85

Browse files
committed
Butcher the attributes Cow
1 parent f1dc172 commit 2a6bd85

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/modules.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a> Module<'a> {
3636
mod_span: Span,
3737
ast_mod_kind: Option<Cow<'a, ast::ModKind>>,
3838
mod_items: Cow<'a, ThinVec<rustc_ast::ptr::P<ast::Item>>>,
39-
mod_attrs: Cow<'a, ast::AttrVec>,
39+
mod_attrs: &[ast::Attribute],
4040
) -> Self {
4141
let inner_attr = mod_attrs
4242
.iter()
@@ -141,7 +141,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
141141
mk_sp(snippet_provider.start_pos(), snippet_provider.end_pos()),
142142
None,
143143
Cow::Borrowed(&krate.items),
144-
Cow::Borrowed(&krate.attrs),
144+
&krate.attrs,
145145
),
146146
);
147147
Ok(self.file_map)
@@ -174,7 +174,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
174174
span,
175175
Some(Cow::Owned(sub_mod_kind.clone())),
176176
Cow::Owned(ThinVec::new()),
177-
Cow::Owned(ast::AttrVec::new()),
177+
&[],
178178
),
179179
)?;
180180
}
@@ -200,7 +200,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
200200
span,
201201
Some(Cow::Borrowed(sub_mod_kind)),
202202
Cow::Owned(ThinVec::new()),
203-
Cow::Borrowed(&item.attrs),
203+
&[],
204204
),
205205
)?;
206206
}
@@ -338,7 +338,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
338338
span,
339339
Some(Cow::Owned(ast::ModKind::Unloaded)),
340340
Cow::Owned(items),
341-
Cow::Owned(attrs),
341+
&attrs,
342342
),
343343
))),
344344
Err(ParserError::ParseError) => Err(ModuleResolutionError {
@@ -388,7 +388,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
388388
span,
389389
Some(Cow::Owned(ast::ModKind::Unloaded)),
390390
Cow::Owned(items),
391-
Cow::Owned(attrs),
391+
&attrs,
392392
),
393393
)))
394394
}
@@ -400,7 +400,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
400400
span,
401401
Some(Cow::Owned(ast::ModKind::Unloaded)),
402402
Cow::Owned(items),
403-
Cow::Owned(attrs),
403+
&attrs,
404404
),
405405
));
406406
if should_insert {
@@ -528,7 +528,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
528528
span,
529529
Some(Cow::Owned(ast::ModKind::Unloaded)),
530530
Cow::Owned(items),
531-
Cow::Owned(attrs),
531+
&attrs,
532532
),
533533
))
534534
}

0 commit comments

Comments
 (0)