Skip to content

Commit e06785b

Browse files
committedNov 6, 2020
improve fixme
1 parent cc19df6 commit e06785b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

Diff for: ‎compiler/rustc_mir/src/transform/validate.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ pub fn equal_up_to_regions(
8585
param_env,
8686
ty.fold_with(&mut BottomUpFolder {
8787
tcx,
88-
// We just erase all late-bound lifetimes, but this is not fully correct (FIXME):
89-
// lifetimes in invariant positions could matter (e.g. through associated types).
90-
// We rely on the fact that layout was confirmed to be equal above.
88+
// FIXME: We erase all late-bound lifetimes, but this is not fully correct.
89+
// If you have a type like `<for<'a> fn(&'a u32) as SomeTrait>::Assoc`,
90+
// this is not necessarily equivalent to `<fn(&'static u32) as SomeTrait>::Assoc`,
91+
// since one may have an `impl SomeTrait for fn(&32)` and
92+
// `impl SomeTrait for fn(&'static u32)` at the same time which
93+
// specify distinct values for Assoc. (See also #56105)
9194
lt_op: |_| tcx.lifetimes.re_erased,
9295
// Leave consts and types unchanged.
9396
ct_op: |ct| ct,

0 commit comments

Comments
 (0)