Rollup merge of #63287 - Mark-Simulacrum:span-no-ref, r=Centril

Don't store &Span

This is just needless indirection.
This commit is contained in:
Mazdak Farrokhzad 2019-08-06 08:17:45 +02:00 committed by GitHub
commit 505d68e739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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>>>,
@ -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,

View File

@ -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);
}