Skip to content

Commit df2e543

Browse files
committed
add comment and opaque type fixme
1 parent b6cbe33 commit df2e543

File tree

1 file changed

+11
-0
lines changed
  • compiler/rustc_trait_selection/src/solve

1 file changed

+11
-0
lines changed

compiler/rustc_trait_selection/src/solve/fulfill.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,17 @@ where
241241

242242
match certainty {
243243
Certainty::Yes => {
244+
// Goals may depend on structural identity. Region uniquification at the
245+
// start of MIR borrowck may cause things to no longer be so, potentially
246+
// causing an ICE.
247+
//
248+
// While we uniquify root goals in HIR this does not handle cases where
249+
// regions are hidden inside of a type or const inference variable.
250+
//
251+
// FIXME(-Znext-solver): This does not handle inference variables hidden
252+
// inside of an opaque type, e.g. if there's `Opaque = (?x, ?x)` in the
253+
// storage, we can also rely on structural identity of `?x` even if we
254+
// later uniquify it in MIR borrowck.
244255
if infcx.in_hir_typeck && obligation.has_non_region_infer() {
245256
infcx.push_hir_typeck_potentially_region_dependent_goal(obligation);
246257
}

0 commit comments

Comments
 (0)