fix comment
This commit is contained in:
parent
315a3b96a4
commit
e52a451913
@ -230,8 +230,8 @@ pub(super) fn mir_assign_valid_types<'tcx>(
|
|||||||
|
|
||||||
// Type-changing assignments can happen for (at least) two reasons:
|
// Type-changing assignments can happen for (at least) two reasons:
|
||||||
// 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.
|
// 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
|
// 2. Subtyping is used. While all normal lifetimes are erased, higher-ranked types
|
||||||
// bounds with their late-bound regions are still around and can lead to type differences.
|
// with their late-bound lifetimes are still around and can lead to type differences.
|
||||||
// Normalize both of them away.
|
// Normalize both of them away.
|
||||||
let normalize = |ty: Ty<'tcx>| {
|
let normalize = |ty: Ty<'tcx>| {
|
||||||
ty.fold_with(&mut BottomUpFolder {
|
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::Ref(_, pointee, _) => tcx.mk_imm_ref(tcx.lifetimes.re_erased, pointee),
|
||||||
_ => ty,
|
_ => 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).
|
// lifetimes in invariant positions could matter (e.g. through associated types).
|
||||||
// We rely on the fact that layout was confirmed to be equal above.
|
// We rely on the fact that layout was confirmed to be equal above.
|
||||||
lt_op: |_| tcx.lifetimes.re_erased,
|
lt_op: |_| tcx.lifetimes.re_erased,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user