-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
233 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters