Skip to content

Commit

Permalink
Don't store &Span
Browse files Browse the repository at this point in the history
This is just needless indirection.
  • Loading branch information
Mark-Simulacrum committed Aug 5, 2019
1 parent 4be0675 commit 288b4e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Place<(), AllocIdSnapshot<'a>>>,
locals: IndexVec<mir::Local, LocalValue<(), AllocIdSnapshot<'a>>>,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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_) => {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 288b4e9

Please sign in to comment.