about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-03-07 15:07:05 +0100
committerGitHub <noreply@github.com>2024-03-07 15:07:05 +0100
commit0e3764889d08296ec8dc1ee2a68655ac2d3627f4 (patch)
tree592758c3eb99789e814388db061120cf094e1c0a /compiler/rustc_codegen_llvm/src
parent8c9a75b3238b66592779d6b240dbf78eacefebb8 (diff)
parentdb48b934544705498dcd3e00527138b48feff3d6 (diff)
downloadrust-0e3764889d08296ec8dc1ee2a68655ac2d3627f4.tar.gz
rust-0e3764889d08296ec8dc1ee2a68655ac2d3627f4.zip
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`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions