fix comment

This commit is contained in:
Ralf Jung 2020-04-05 12:11:33 +02:00
parent 315a3b96a4
commit e52a451913

View File

@ -230,8 +230,8 @@ pub(super) fn mir_assign_valid_types<'tcx>(
// Type-changing assignments can happen for (at least) two reasons:
// 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.
// 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked lifetime
// bounds with their late-bound regions are still around and can lead to type differences.
// 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked types
// with their late-bound lifetimes are still around and can lead to type differences.
// Normalize both of them away.
let normalize = |ty: Ty<'tcx>| {
ty.fold_with(&mut BottomUpFolder {
@ -241,7 +241,7 @@ pub(super) fn mir_assign_valid_types<'tcx>(
ty::Ref(_, pointee, _) => tcx.mk_imm_ref(tcx.lifetimes.re_erased, pointee),
_ => ty,
},
// We just erase all late-bound regions, but this is not fully correct (FIXME):
// We just erase all late-bound lifetimes, but this is not fully correct (FIXME):
// lifetimes in invariant positions could matter (e.g. through associated types).
// We rely on the fact that layout was confirmed to be equal above.
lt_op: |_| tcx.lifetimes.re_erased,