You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's actually possible to silence the error by adding #[no_link] to the macro-only extern crate bitflags; (which is what librustc does), effectively removing bitflags from the scope.
If/when we move name resolution earlier and use it during macro expansion, the macro will actually be imported through the bitflags name and the warning wouldn't get triggered.
If/when we move name resolution earlier and use it during macro expansion, the macro will actually be imported through the bitflags name and the warning wouldn't get triggered.
Now that macro modularization is implemented, this is true today!
adding #[no_link] to the macro-only extern crate bitflags; effectively [removes] bitflags from the scope.
For the record, this changed in #37247 to support use macro imports from #[no_link] crates.
Activity
alexcrichton commentedon Jan 12, 2016
This is why the lint is allow-by-default, it's got false positives
Ms2ger commentedon Jan 12, 2016
Sure, but that doesn't mean some of them can't be fixed.
zbynekwinkler commentedon Apr 19, 2016
Is this the right place to look at?
https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/check_unused.rs
SimonSapin commentedon Apr 29, 2016
On IRC about this:
eddyb commentedon Apr 29, 2016
It's actually possible to silence the error by adding
#[no_link]
to the macro-onlyextern crate bitflags;
(which is whatlibrustc
does), effectively removingbitflags
from the scope.If/when we move name resolution earlier and use it during macro expansion, the macro will actually be imported through the
bitflags
name and the warning wouldn't get triggered.Ms2ger commentedon Jan 23, 2017
#39060 improved this.
CC @jseyfried
jseyfried commentedon Mar 14, 2017
@eddyb
Now that macro modularization is implemented, this is true today!
For the record, this changed in #37247 to support
use
macro imports from#[no_link]
crates.unused
lint group #42172