Skip to content

Commit 77dbe57

Browse files
lcnrcompiler-errors
authored andcommitted
add a new type system invariant
1 parent f42a31f commit 77dbe57

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/solve/invariants.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ types.
2626
This is unfortunately broken for `<fndef as FnOnce<..>>::Output` due to implied bounds,
2727
resulting in [#114936].
2828

29-
### applying inference results from a goal does not change its result ❌
29+
### Structural equality modulo regions implies semantic equality ✅
30+
31+
If you have a some type and equate it to itself after replacing any regions with unique
32+
inference variables in both the lhs and rhs, the now potentially structurally different
33+
types should still be equal to each other.
34+
35+
Needed to prevent goals from succeeding in HIR typeck and then failing in MIR borrowck.
36+
If this does invariant is broken MIR typeck ends up failing with an ICE.
37+
38+
### Applying inference results from a goal does not change its result ❌
3039

3140
TODO: this invariant is formulated in a weird way and needs to be elaborated.
3241
Pretty much: I would like this check to only fail if there's a solver bug:

0 commit comments

Comments
 (0)