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
..
2024-05-20 19:55:59 -07:00
2024-07-21 05:36:21 +00:00
2024-07-12 21:52:04 +03:00
2024-07-10 16:16:48 +02:00
2024-05-18 18:12:18 +02:00
2024-02-05 10:17:31 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-22 18:05:27 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 18:05:27 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-04-09 10:23:58 +00:00
2024-04-09 10:23:58 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-19 17:41:48 -03:00
2024-02-19 17:41:48 -03:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-07-16 01:56:16 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-29 15:27:56 -03:00
2024-02-29 15:27:56 -03:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-02-29 15:27:56 -03:00
2024-02-29 15:27:56 -03:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-02-03 08:33:40 -08:00
2023-02-03 08:33:40 -08:00
2023-02-03 08:33:40 -08:00
2023-02-03 08:33:40 -08:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-06-07 15:58:50 -04:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-05-30 12:40:35 +02:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-04-09 10:23:58 +00:00
2024-04-09 10:23:58 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-09-21 08:17:58 +02:00
2023-09-21 08:17:58 +02:00
2024-02-16 20:02:50 +00:00
2023-10-09 11:47:02 +00:00
2023-10-09 11:47:02 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-19 17:41:48 -03:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-10-23 23:35:27 +00:00
2023-11-24 19:15:52 +01:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-05-28 04:54:05 +00:00
2024-04-30 21:54:54 +02:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-04-24 08:05:29 +00:00
2024-04-24 08:05:29 +00:00
2024-02-16 23:53:09 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-19 18:16:11 +01:00
2024-02-19 18:16:11 +01:00
2024-02-16 20:02:50 +00:00
2024-02-05 10:17:31 +00:00
2024-02-05 10:17:31 +00:00
2023-03-08 00:12:33 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 23:53:09 +00:00
2024-02-16 23:53:09 +00:00
2024-06-12 19:03:37 -04:00
2024-06-12 19:03:37 -04:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2023-02-13 18:41:18 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-19 19:12:20 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-03-10 21:18:41 -04:00
2024-07-10 16:16:48 +02:00
2024-07-10 16:16:48 +02:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-06-04 18:57:19 +02:00
2024-06-04 18:57:19 +02:00
2024-06-04 18:57:19 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-04-30 21:54:54 +02:00
2024-02-16 20:02:50 +00:00
2024-06-05 23:20:09 +08:00
2024-03-22 17:46:40 -04:00
2024-03-22 17:46:40 -04:00
2024-03-22 17:46:40 -04:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-01-08 15:03:59 +00:00
2024-01-08 15:03:59 +00:00