Skip to content

Commit b879e29

Browse files
committed
Remove a needless borrow
1 parent 9a4c105 commit b879e29

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ enum DisallowTildeConstContext<'a> {
6161
Item,
6262
}
6363

64-
enum TraitOrTraitImpl<'a> {
64+
enum TraitOrTraitImpl {
6565
Trait { span: Span, constness: Option<Span> },
66-
TraitImpl { constness: Const, polarity: ImplPolarity, trait_ref: &'a TraitRef },
66+
TraitImpl { constness: Const, polarity: ImplPolarity, trait_ref: Span },
6767
}
6868

69-
impl<'a> TraitOrTraitImpl<'a> {
69+
impl TraitOrTraitImpl {
7070
fn constness(&self) -> Option<Span> {
7171
match self {
7272
Self::Trait { constness: Some(span), .. }
@@ -83,7 +83,7 @@ struct AstValidator<'a> {
8383
/// The span of the `extern` in an `extern { ... }` block, if any.
8484
extern_mod: Option<Span>,
8585

86-
outer_trait_or_trait_impl: Option<TraitOrTraitImpl<'a>>,
86+
outer_trait_or_trait_impl: Option<TraitOrTraitImpl>,
8787

8888
has_proc_macro_decls: bool,
8989

@@ -115,7 +115,7 @@ impl<'a> AstValidator<'a> {
115115
trait_.map(|(constness, polarity, trait_ref)| TraitOrTraitImpl::TraitImpl {
116116
constness,
117117
polarity,
118-
trait_ref,
118+
trait_ref: trait_ref.path.span,
119119
}),
120120
);
121121
f(self);
@@ -354,7 +354,7 @@ impl<'a> AstValidator<'a> {
354354
}
355355
}
356356

357-
fn check_trait_fn_not_const(&self, constness: Const, parent: &TraitOrTraitImpl<'a>) {
357+
fn check_trait_fn_not_const(&self, constness: Const, parent: &TraitOrTraitImpl) {
358358
let Const::Yes(span) = constness else {
359359
return;
360360
};
@@ -367,7 +367,7 @@ impl<'a> AstValidator<'a> {
367367
..
368368
} = parent
369369
{
370-
Some(trait_ref.path.span.shrink_to_lo())
370+
Some(trait_ref.shrink_to_lo())
371371
} else {
372372
None
373373
};

0 commit comments

Comments
 (0)