Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply lint attrs to individual "use" declarations #13671

Closed
wants to merge 1 commit into from

Conversation

dcrewi
Copy link
Contributor

@dcrewi dcrewi commented Apr 22, 2014

Fixes #10534

@alexcrichton
Copy link
Member

I think that the reording of the calls to visit_ids may be a red herring for a possible problem with the reordering. The visit_ids method should happen before the recursion to maintain a consistent ordering of the emission of lints (top to bottom). I think that this is happening because there is no visit_ids in the visit_view_item method and the IdVisitor may need to be updated to not recurse into a view item as well.

@dcrewi
Copy link
Contributor Author

dcrewi commented Apr 22, 2014

That's another way to fix the problem. Is it sufficient to reuse (and possibly rename) the IdVisitor's pass_through_items flag, or would one ever want to pass through one and not the other?

@alexcrichton
Copy link
Member

It's ok to hijack the flag for this.

@dcrewi
Copy link
Contributor Author

dcrewi commented Apr 24, 2014

New revision is ready for review.

bors added a commit that referenced this pull request Apr 25, 2014
@bors bors closed this Apr 25, 2014
@dcrewi dcrewi deleted the lint-directives-on-use-items branch April 27, 2014 21:37
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 9, 2023
Improve goto declaration

Closes rust-lang/rust-analyzer#13599

- goto decl now goes to assoc items of trait declarations over the items of trait implementations
- goto decl now goes to the field declaration (opposed to goto def which shows both the field decl and binding created/local being used)
- also adds back the goto definition fallback that seems to have been dropped at some point.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
changelog:
```
changelog: [`needless_option_take`]: now lints for all temporary expressions of type  Option<T>.
```

fixes rust-lang#13671

In general, needless_option_take should report whenever take() is called
on a temporary value, not just when the temporary value is created by
as_ref().

Also, we stop emitting machine applicable fixes in these cases, since
sometimes the intention of the user is to actually clear the original
option, in cases such as `option.as_mut().take()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend allow/warn/etc attributes to be applicable to individual use declarations
3 participants