about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/debug.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-09 22:51:42 +0000
committerbors <bors@rust-lang.org>2023-09-09 22:51:42 +0000
commit8c48b936ccf5cf62647420e604bb2cae155268a4 (patch)
treec9d1732479d876404c36b151e0659d6ddc190422 /compiler/rustc_mir_transform/src/coverage/debug.rs
parentec6f1bd4bf0a8065e7139cc71cad154c9f669061 (diff)
parent30846b16a0feaf25e4a78d468d1b56920e775aae (diff)
downloadrust-8c48b936ccf5cf62647420e604bb2cae155268a4.tar.gz
rust-8c48b936ccf5cf62647420e604bb2cae155268a4.zip
Auto merge of #11459 - y21:issue11435, r=blyxyas
[`implied_bounds_in_impls`]: include (previously omitted) associated types in suggestion

Fixes #11435

It now includes associated types from the implied bound that were omitted in the second bound. Example:
```rs
fn f() -> impl Iterator<Item = u8> + ExactSizeIterator> {..}
```
Suggestion before this change:
```diff
- pub fn my_iter() -> impl Iterator<Item = u32> + ExactSizeIterator {
+ pub fn my_iter() -> impl ExactSizeIterator {
```
It didn't include `<Item = u32>` on `ExactSizeIterator`. Now, with this change, it does.
```diff
- pub fn my_iter() -> impl Iterator<Item = u32> + ExactSizeIterator {
+ pub fn my_iter() -> impl ExactSizeIterator<Item = u32> {
```

We also now extend the span to include not just possible `+` ahead of it, but also behind it (an example for this is in the linked issue as well).
**Note:** The overall diff is a bit noisy, because building up the suggestion involves quite a bit more logic now and I decided to extract that into its own function. For that reason, I split this PR up into two commits. The first commit contains the actual "logic" changes. Second commit just moves code around.

changelog: [`implied_bounds_in_impls`]: include (previously omitted) associated types in suggestion
changelog: [`implied_bounds_in_impls`]: include the `+` behind bound if it's the last bound
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions