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

Partly fix incorrect useless_attribute suggestion #2444

Merged

Conversation

phansch
Copy link
Member

@phansch phansch commented Feb 6, 2018

This fixes an incorrect suggestion from the useless_attribute lint
when using cfg_attr.

Additionally, it will not show a suggestion anymore, if the attribute
begins on a previous line, because it is much harder to construct the suggestion
span of multi-line cfg_attr attributes as they don't appear in the AST.

Reported in #1522

This fixes an incorrect suggestion from the `useless_attribute` lint
when using `cfg_attr`.

Additionally, it will not show a suggestion anymore, if the attribute
begins on a previous line, because it is much harder to construct the
span of multi-line `cfg_attr` attributes as they don't appear in the AST.

To fix it completely, one would have to parse upwards into the file,
and find the beginning of the `cfg_attr` attribute.
@phansch phansch force-pushed the fix_incorrect_useless_attribute_suggestion branch from aae1394 to 81f5969 Compare February 6, 2018 21:35
@oli-obk
Copy link
Contributor

oli-obk commented Feb 7, 2018

Thanks

@oli-obk oli-obk merged commit 6f48e37 into rust-lang:master Feb 7, 2018
@phansch phansch deleted the fix_incorrect_useless_attribute_suggestion branch February 7, 2018 08:26
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.

2 participants