Open nrc opened 6 years ago
I can't tell what the status is here. We have a lint (landed in #52275) but as far as I can tell (playground) it does not fire. In fact, I get no warnings at all when using extern crate in Rust 2018, even with idiom lints enabled. Is that expected?
(We do appear to have stabilized use_extern_macros
in https://github.com/rust-lang/rust/pull/50911.)
I don't think however that this needs to be a Rust 2018 RC2 blocker, since edition lints are not idiom enabled by default.
Clearing from milestone.
@nikomatsakis is there a specific team we can tag this with? That, or can you remove the nomination? (Would the team be T-compiler, or is there a different group dedicated to idiom lints?)
I'm going to tag this with T-compiler, under the assumption that they will either address it or punt it to the appropriate other team.
discussed at T-compiler meeting. @nikomatsakis says idiom lints are essentially "deferred". They want a working group focused on them; that, or T-compiler. But in any case, it doesn't need the nomination tag; we'll work our way through the queue of A-edition-2018-lints labelled things eventually
unnominating.
This seems to have fallen through the cracks, and hasn't been looked at in years. We should consider whether, at this point, we can safely upgrade this lint to at least warn
.
The behavior seems to be:
If you don't use any macros, you get a warning that #[macro_use]
is not used.
If you do, the macro_use_extern_crate
lint fires (but is allow-by-default).
I agree with @joshtriplett that we should at least warn and explain that this is deprecated.
Just to clarify (since this issue hasn't gotten updates and the dialogue from years past led me to think that the lint as-implemented as not working):
macro_use_extern_crate
lint.#[macro_use]
(which explains why niko's playground from 2018 was not firing).@rustbot labels -I-lang-nominated
As @pnkfelix said above, we'd like to see a PR making this warn-by-default. We'll do the FCP on that PR, so please nominate it for us.
The migration issue is that
#[macro_use] extern crate foo;
beings macros into scope fromfoo
andextern crate
is unidiomatic in the 2018 edition.local_inner_macros
is the current solution but as discussed in #50911, we're not 100% that works.