about summary refs log tree commit diff
path: root/compiler/rustc_session/src/utils.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-19 01:59:35 +0000
committerbors <bors@rust-lang.org>2022-04-19 01:59:35 +0000
commite2661bac6d8ae6b9e2a26cd08e9c087ab59e1357 (patch)
treee93a3c6d74ac544c815f41ad13c909e5e0c66c34 /compiler/rustc_session/src/utils.rs
parentd5ae66c12c6bdf1a5739ae1fce8057fd76ba0f47 (diff)
parentdecc04dbfbfe240e649cd4f891ca14d2f501c0ff (diff)
downloadrust-e2661bac6d8ae6b9e2a26cd08e9c087ab59e1357.tar.gz
rust-e2661bac6d8ae6b9e2a26cd08e9c087ab59e1357.zip
Auto merge of #95379 - icewind1991:suggest-associated-type-more, r=jackh726
show suggestion to replace generic bounds with associated types in more cases

Moves the hint to replace generic parameters with associated type bounds from the "not all associated type bounds are specified"(`E0191`) to "to many generic type parameters provided"(`E0107`).

Since `E0191` is only emitted in places where all associated types must be specified (when creating `dyn` types), the suggesting is currently not shown for other generic type uses (such as in generic type bounds). With this change the suggesting is always emitted when the number of excess generic parameters matches the number of unbound associated types.

Main motivation for the change was a lack of useful suggesting when doing

```rust
fn foo<I: Iterator<usize>>(i: I) {}
```
Diffstat (limited to 'compiler/rustc_session/src/utils.rs')
0 files changed, 0 insertions, 0 deletions