rust/tests/ui/associated-types
Guillaume Gomez 0e3764889d
Rollup merge of #121863 - lukas-code:silence-mismatched-super-projections, r=lcnr
silence mismatched types errors for implied projections

Currently, if a trait bound is not satisfied, then we suppress any errors for the trait's supertraits not being satisfied, but still report errors for super projections not being satisfied.

For example:
```rust
trait Super {
    type Assoc;
}
trait Sub: Super<Assoc = ()> {}
```
Before this PR, if `T: Sub` is not satisfied, then errors for `T: Super` are suppressed, but errors for `<T as Super>::Assoc == ()` are still shown. This PR makes it so that errors about super projections not being satisfied are also suppressed.

The errors are only suppressed if the span of the trait obligation matches the span of the super predicate obligation to avoid silencing error that are not related. This PR removes some differences between the spans of supertraits and super projections to make the suppression work correctly.

This PR fixes the majority of the diagnostics fallout when making `Thin` a supertrait of `Sized` (in a future PR).
cc https://github.com/rust-lang/rust/pull/120354#issuecomment-1930585382
cc `@lcnr`
2024-03-07 15:07:05 +01:00
..
2024-02-07 10:42:01 +08:00
2024-02-07 10:42:01 +08:00
2023-10-30 22:19:17 +00:00
2024-03-03 16:30:48 -03:00
2024-03-03 16:30:48 -03:00
2023-08-28 17:47:37 -03:00
2023-01-30 20:12:21 +00:00