os-rust/tests
Matthias Krüger ae92125a75
Rollup merge of #127574 - lcnr:coherence-check-supertrait, r=compiler-errors
elaborate unknowable goals

A reimplemented version of #124532 affecting only the new solver. Always trying to prove super traits ends up causing a fatal overflow error in diesel, so we cannot land this in the old solver.

The following test currently does not pass coherence:
```rust
trait Super {}
trait Sub<T>: Super {}

trait Overlap<T> {}
impl<T, U: Sub<T>> Overlap<T> for U {}
impl<T> Overlap<T> for () {}

fn main() {}
```

We check whether `(): Sub<?t>` holds. This stalls with ambiguity as downstream crates may add an impl for `(): Sub<Local>`. However, its super trait bound `(): Super` cannot be implemented downstream, so this one is known not to hold.

By trying to prove that all the super bounds of a trait before adding a coherence unknowable candidate, this compiles. This is necessary to prevent breakage from enabling `-Znext-solver=coherence` (#121848), see tests/ui/coherence/super-traits/super-trait-knowable-2.rs for more details. The idea is that while there may be an impl of the trait itself we don't know about, if we're able to prove that a super trait is definitely not implemented, then that impl would also never apply/not be well-formed.

This approach is different from #124532 as it allows tests/ui/coherence/super-traits/super-trait-knowable-3.rs to compile. The approach in #124532 only elaborating the root obligations while this approach tries it for all unknowable trait goals.

r? `@compiler-errors`
2024-07-30 04:31:54 +02:00
..
assembly Reformat use declarations. 2024-07-29 08:26:52 +10:00
auxiliary
codegen Reformat use declarations. 2024-07-29 08:26:52 +10:00
codegen-units Avoid MIR bloat in inlining 2024-07-01 05:17:13 -07:00
coverage Bless coverage. 2024-07-13 12:02:12 +00:00
coverage-run-rustdoc coverage: Extract hole spans from HIR instead of MIR 2024-07-08 21:22:56 +10:00
crashes Rollup merge of #128337 - bvanjoi:issue-121613, r=compiler-errors 2024-07-29 17:46:44 +02:00
debuginfo Add Natvis visualiser and debuginfo tests for f16 2024-07-09 03:47:50 +01:00
incremental Perform instsimplify before inline to eliminate some trivial calls 2024-07-29 18:14:35 +08:00
mir-opt Stabilize offset_of_nested 2024-07-29 17:50:12 +01:00
pretty Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
run-make rewrite raw-dylib-stdcall-ordinal to rmake 2024-07-29 10:58:28 -04:00
run-pass-valgrind
rustdoc rustdoc: move the wbr after the underscore, instead of before 2024-07-29 10:31:02 -07:00
rustdoc-gui rustdoc: properly handle path wrapping 2024-07-29 10:31:02 -07:00
rustdoc-js rustdoc-search: use lowercase, non-normalized name for type search 2024-06-09 11:56:52 -07:00
rustdoc-js-std Update tests 2024-06-07 11:55:52 +08:00
rustdoc-json Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustdoc-ui Rollup merge of #128111 - estebank:no-question, r=fmease 2024-07-25 04:43:20 +02:00
ui Rollup merge of #127574 - lcnr:coherence-check-supertrait, r=compiler-errors 2024-07-30 04:31:54 +02:00
ui-fulldeps Auto merge of #126963 - runtimeverification:smir_serde_derive, r=celinval 2024-07-25 20:27:51 +00:00
COMPILER_TESTS.md