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

Bad unnecesary qualification lint from macro expansion in Rust 1.15 #38682

Closed
brson opened this Issue Dec 29, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@brson
Copy link
Contributor

brson commented Dec 29, 2016

Here's a log I saw recently (ignore the "kablam"s):

boom! testing cargo-count-0.2.2 against beta for full
boom! running: cargo +beta build --frozen
boom! creating container for: cargo +beta build --frozen
boom! running `docker create -v /home/ec2-user/cargobomb/./work/local/test-source/full/beta:/source:ro -v /home/ec2-user/cargobomb/./work/local/cargo-home:/cargo-home:ro -v /home/ec2-user/cargobomb/./work/local/rustup-home:/rustup-home:ro -v /home/ec2-user/cargobomb/./work/local/target-dirs/full/beta:/target:rw -e USER_ID=500 -e CMD=cargo +beta build --frozen cargobomb`
blam! 6fcca4568100fa33f372a2544963670c63bd909d853d2716eb3daca3c8682329
boom! running `docker start -a 6fcca4568100fa33f372a2544963670c63bd909d853d2716eb3daca3c8682329`
kablam!    Compiling clap v2.11.3
kablam!    Compiling gitignore v1.0.5
kablam!    Compiling cargo-count v0.2.2 (file:///source)
kablam! error: unnecessary qualification
kablam!   --> src/config.rs:10:1
kablam!    |
kablam! 10 |   arg_enum! {
kablam!    |  _^ starting here...
kablam! 11 | |     #[derive(Debug)]
kablam! 12 | |     pub enum Utf8Rule {
kablam! 13 | |         Ignore,
kablam! 14 | |         Lossy,
kablam! 15 | |         Strict
kablam! 16 | |     }
kablam! 17 | | }
kablam!    | |_^ ...ending here
kablam!    |
kablam! note: lint level defined here
kablam!   --> src/main.rs:179:9
kablam!    |
kablam! 179|         unused_qualifications)]
kablam!    |         ^^^^^^^^^^^^^^^^^^^^^
kablam!    = note: this error originates in a macro outside of the current crate
kablam! 
kablam! error: aborting due to previous error
kablam! 
kablam! error: Could not compile `cargo-count`.
kablam! 
kablam! To learn more, run the command again with --verbose.
boom! running `docker rm -f 6fcca4568100fa33f372a2544963670c63bd909d853d2716eb3daca3c8682329`
blam! 6fcca4568100fa33f372a2544963670c63bd9

This is pointing out an unused qualification in the expansion of a macro. I can't tell what the underlying error is, but I know that sometimes we ignore the results of macro expansion for certain analysis purposes, because macros want to output "bad" style sometimes. Do we ever ignore lints for macro expanded code? cc @jseyfried

@jseyfried

This comment has been minimized.

Copy link
Contributor

jseyfried commented Dec 31, 2016

@brson

Do we ever ignore lints for macro expanded code?

We ignore unused qualifications for paths that begin with $crate. Other than that, not that I know of.

This issue looks like it was caused by #38014, which enforced the unused qualification lint for global paths. I'll write a PR that excepts macro-expanded global paths to fix it.

@jseyfried

This comment has been minimized.

Copy link
Contributor

jseyfried commented Jan 4, 2017

Fixed in #38817.

bors added a commit that referenced this issue Jan 5, 2017

Auto merge of #38817 - jseyfried:improve_unused_qualification_lint, r…
…=petrochenkov

resolve: don't `unused_qualifications`-check global paths

We started `unused_qualifications`-checking global paths in #38014, causing #38682.
Fixes #38682.
r? @nrc

bors added a commit that referenced this issue Jan 5, 2017

Auto merge of #38817 - jseyfried:improve_unused_qualification_lint, r…
…=petrochenkov

resolve: don't `unused_qualifications`-check global paths

We started `unused_qualifications`-checking global paths in #38014, causing #38682.
Fixes #38682.
r? @nrc

bors added a commit that referenced this issue Jan 5, 2017

Auto merge of #38817 - jseyfried:improve_unused_qualification_lint, r…
…=petrochenkov

resolve: don't `unused_qualifications`-check global paths

We started `unused_qualifications`-checking global paths in #38014, causing #38682.
Fixes #38682.
r? @nrc

bors added a commit that referenced this issue Jan 5, 2017

Auto merge of #38817 - jseyfried:improve_unused_qualification_lint, r…
…=petrochenkov

resolve: don't `unused_qualifications`-check global paths

We started `unused_qualifications`-checking global paths in #38014, causing #38682.
Fixes #38682.
r? @nrc

@bors bors closed this in #38817 Jan 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.