summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-07-30 11:57:41 +0200
committerlcnr <rust@lcnr.de>2025-07-30 14:01:37 +0200
commitdf2e54376c4cf9009ba159a50a404e1483f52f67 (patch)
tree4f6d125a4b7bbb50ab4feee9c28e5d27bd7ac534 /compiler
parentb6cbe33aeb526d6437304f4810762c947bddcd4a (diff)
downloadrust-df2e54376c4cf9009ba159a50a404e1483f52f67.tar.gz
rust-df2e54376c4cf9009ba159a50a404e1483f52f67.zip
add comment and opaque type fixme
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_trait_selection/src/solve/fulfill.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs
index e0b9380eca3..01bdae7435d 100644
--- a/compiler/rustc_trait_selection/src/solve/fulfill.rs
+++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs
@@ -241,6 +241,17 @@ where
 
                 match certainty {
                     Certainty::Yes => {
+                        // Goals may depend on structural identity. Region uniquification at the
+                        // start of MIR borrowck may cause things to no longer be so, potentially
+                        // causing an ICE.
+                        //
+                        // While we uniquify root goals in HIR this does not handle cases where
+                        // regions are hidden inside of a type or const inference variable.
+                        //
+                        // FIXME(-Znext-solver): This does not handle inference variables hidden
+                        // inside of an opaque type, e.g. if there's `Opaque = (?x, ?x)` in the
+                        // storage, we can also rely on structural identity of `?x` even if we
+                        // later uniquify it in MIR borrowck.
                         if infcx.in_hir_typeck && obligation.has_non_region_infer() {
                             infcx.push_hir_typeck_potentially_region_dependent_goal(obligation);
                         }