-
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 #11696 - y21:iter_without_into_iter_suggestion, r=xFrednet
[`iter_without_into_iter`]: fix papercuts in suggestion and restrict linting to exported types See #11692 for more context. tldr: the lint `iter_without_into_iter` has suggestions that don't compile, which imo isn't that problematic because it does have the appropriate `Applicability` that tells external tools that it shouldn't be auto-applied. However there were some obvious "errors" in the suggestion that really should've been included in my initial PR adding the lint, which is fixed by this PR: - `IntoIterator::into_iter` needs a `self` argument. - `IntoIterator::Iter` associated type doesn't exist. This should've just been `Item`. This still doesn't make it machine applicable, and the remaining things are imho quite non-trivial to implement, as I've explained in #11692 (comment). I personally think it's fine to leave it there and let the user change the remaining errors when copy-pasting the suggestion (e.g. errors caused by lifetimes that were permitted in fn return-position but are not in associated types). This is how many of our other lint suggestions already work. Also, we now restrict linting to only exported types. This required moving basically all of the tests around since they were previously in the `main` function. Same for `into_iter_without_iter`. The git diff is a bit useless here... changelog: [`iter_without_into_iter`]: fix papercuts in suggestion and restrict linting to exported types (cc `@lopopolo,` figured I should mention you since you created the issue)
- Loading branch information
Showing
5 changed files
with
358 additions
and
343 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
Oops, something went wrong.