1
Fork 0

Remove unused field of RegionVariableOrigin

This commit is contained in:
Matthew Jasper 2021-11-11 23:15:47 +00:00
parent 936238a92b
commit 3ea84e879a
3 changed files with 4 additions and 4 deletions

View file

@ -2528,7 +2528,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
infer::MiscVariable(_) => String::new(), infer::MiscVariable(_) => String::new(),
infer::PatternRegion(_) => " for pattern".to_string(), infer::PatternRegion(_) => " for pattern".to_string(),
infer::AddrOfRegion(_) => " for borrow expression".to_string(), infer::AddrOfRegion(_) => " for borrow expression".to_string(),
infer::Autoref(_, _) => " for autoref".to_string(), infer::Autoref(_) => " for autoref".to_string(),
infer::Coercion(_) => " for automatic coercion".to_string(), infer::Coercion(_) => " for automatic coercion".to_string(),
infer::LateBoundRegion(_, br, infer::FnCall) => { infer::LateBoundRegion(_, br, infer::FnCall) => {
format!(" for lifetime parameter {}in function call", br_string(br)) format!(" for lifetime parameter {}in function call", br_string(br))

View file

@ -459,7 +459,7 @@ pub enum RegionVariableOrigin {
AddrOfRegion(Span), AddrOfRegion(Span),
/// Regions created as part of an autoref of a method receiver /// Regions created as part of an autoref of a method receiver
Autoref(Span, ty::AssocItem), Autoref(Span),
/// Regions created as part of an automatic coercion /// Regions created as part of an automatic coercion
Coercion(Span), Coercion(Span),
@ -1848,7 +1848,7 @@ impl RegionVariableOrigin {
MiscVariable(a) MiscVariable(a)
| PatternRegion(a) | PatternRegion(a)
| AddrOfRegion(a) | AddrOfRegion(a)
| Autoref(a, _) | Autoref(a)
| Coercion(a) | Coercion(a)
| EarlyBoundRegion(a, ..) | EarlyBoundRegion(a, ..)
| LateBoundRegion(a, ..) | LateBoundRegion(a, ..)

View file

@ -162,7 +162,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
match &pick.autoref_or_ptr_adjustment { match &pick.autoref_or_ptr_adjustment {
Some(probe::AutorefOrPtrAdjustment::Autoref { mutbl, unsize }) => { Some(probe::AutorefOrPtrAdjustment::Autoref { mutbl, unsize }) => {
let region = self.next_region_var(infer::Autoref(self.span, pick.item)); let region = self.next_region_var(infer::Autoref(self.span));
target = self.tcx.mk_ref(region, ty::TypeAndMut { mutbl: *mutbl, ty: target }); target = self.tcx.mk_ref(region, ty::TypeAndMut { mutbl: *mutbl, ty: target });
let mutbl = match mutbl { let mutbl = match mutbl {
hir::Mutability::Not => AutoBorrowMutability::Not, hir::Mutability::Not => AutoBorrowMutability::Not,