From 288b4e90780d827b0bca2b63b25b4a3056986111 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 5 Aug 2019 10:28:23 -0400 Subject: [PATCH] Don't store &Span This is just needless indirection. --- src/librustc_mir/interpret/snapshot.rs | 4 ++-- src/librustc_resolve/lib.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_mir/interpret/snapshot.rs b/src/librustc_mir/interpret/snapshot.rs index 70a297c866280..fad9fafbb0803 100644 --- a/src/librustc_mir/interpret/snapshot.rs +++ b/src/librustc_mir/interpret/snapshot.rs @@ -305,7 +305,7 @@ impl_stable_hash_for!(enum crate::interpret::eval_context::StackPopCleanup { #[derive(Eq, PartialEq)] struct FrameSnapshot<'a, 'tcx> { instance: &'a ty::Instance<'tcx>, - span: &'a Span, + span: Span, return_to_block: &'a StackPopCleanup, return_place: Option>>, locals: IndexVec>>, @@ -345,7 +345,7 @@ impl<'a, 'mir, 'tcx, Ctx> Snapshot<'a, Ctx> for &'a Frame<'mir, 'tcx> FrameSnapshot { instance, - span, + span: *span, return_to_block, block, stmt: *stmt, diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 1a203e73f0a86..1908d85e4ff2a 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -171,7 +171,7 @@ enum ResolutionError<'a> { GenericParamsFromOuterFunction(Res), /// Error E0403: the name is already used for a type or const parameter in this generic /// parameter list. - NameAlreadyUsedInParameterList(Name, &'a Span), + NameAlreadyUsedInParameterList(Name, Span), /// Error E0407: method is not a member of trait. MethodNotMemberOfTrait(Name, &'a str), /// Error E0437: type is not a member of trait. @@ -297,7 +297,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver<'_>, parameter in this list of generic parameters", name); err.span_label(span, "already used"); - err.span_label(first_use_span.clone(), format!("first use of `{}`", name)); + err.span_label(first_use_span, format!("first use of `{}`", name)); err } ResolutionError::MethodNotMemberOfTrait(method, trait_) => { @@ -2853,7 +2853,7 @@ impl<'a> Resolver<'a> { let span = seen_bindings.get(&ident).unwrap(); let err = ResolutionError::NameAlreadyUsedInParameterList( ident.name, - span, + *span, ); resolve_error(self, param.ident.span, err); } @@ -2875,7 +2875,7 @@ impl<'a> Resolver<'a> { let span = seen_bindings.get(&ident).unwrap(); let err = ResolutionError::NameAlreadyUsedInParameterList( ident.name, - span, + *span, ); resolve_error(self, param.ident.span, err); }