rust/compiler/rustc_trait_selection
Yuki Okushi d44cec3453
Rollup merge of #90819 - JakobDegen:issue-90804, r=petrochenkov
Fixes incorrect handling of TraitRefs when emitting suggestions.

Closes #90804 , although there were more issues here that were hidden by the thing that caused this ICE.

Underlying problem was that substitutions were being thrown out, which not only leads to an ICE but also incorrect diagnostics. On top of that, in some cases the self types from the root obligations were being mixed in with those from derived obligations.

This makes a couple diagnostics arguable worse ("`B<C>` does not implement `Copy`" instead of "`C` does not implement `Copy`") but the worse diagnostics are at least still correct and that downside is in my opinion clearly outweighed by the benefits of fixing the ICE and unambiguously wrong diagnostics.
2021-11-16 15:59:40 +09:00
..
src Rollup merge of #90819 - JakobDegen:issue-90804, r=petrochenkov 2021-11-16 15:59:40 +09:00
Cargo.toml Rollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakis 2021-10-07 16:24:49 +02:00