Skip to content

Commit d3678d3

Browse files
authored
Merge pull request #2667 from lcnr/type-system-invariants
add another type system invariant
2 parents 48d0f3c + a5a3fd4 commit d3678d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/solve/invariants.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ We do however break this invariant in a few cases, some of which are due to bugs
116116
- the builtin trait object trait implementation can overlap with a user-defined impl:
117117
[#57893](https://github.com/rust-lang/rust/issues/57893)
118118

119+
### Goals with can be proven in a non-empty environment also hold during monomorphization ✅
120+
121+
If a goal can be proven in a generic environment, the goal should still hold after instantiating
122+
it with fully concrete types and no where-clauses in scope.
123+
124+
This is assumed by codegen which ICEs when encountering non-overflow ambiguity. This invariant is currently broken by specialization ([#147507](https://github.com/rust-lang/rust/issues/147507)) and by marker traits ([#149502](https://github.com/rust-lang/rust/issues/149502)).
119125

120126
#### The type system is complete during the implicit negative overlap check in coherence ✅
121127

0 commit comments

Comments
 (0)