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
{{ message }}
Repository navigation
edition idioms: Incorrect suggestion for removing extern crate ignore; #56326
$ cat ignore.rs
#![crate_type = "lib"]
pub fn foo() {}
$ cat foo.rs
#![warn(rust_2018_idioms)]
extern crate ignore;
fn main() {
ignore::foo();
}
$ rustc +beta ignore.rs
$ rustc +beta foo.rs --extern ignore=./libignore.rlib --edition 2018
warning: `extern crate` is not idiomatic in the new edition
--> foo.rs:3:1
|
3 | extern crate ignore;
| ^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
|
note: lint level defined here
--> foo.rs:1:9
|
1 | #![warn(rust_2018_idioms)]
| ^^^^^^^^^^^^^^^^
= note: #[warn(unused_extern_crates)] implied by #[warn(rust_2018_idioms)]
If applied, though, the suggestion yields:
$ rustc +beta foo.rs --extern ignore=./libignore.rlib --edition 2018
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
--> foo.rs:3:5
|
3 | use ignore;
| ^^^^^^ not an extern crate passed with `--extern`
|
note: this import refers to the built-in attribute imported here
--> foo.rs:3:5
|
3 | use ignore;
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
Activity
Work around rust bug
Auto merge of #56759 - petrochenkov:prestabuni, r=nikomatsakis
Auto merge of #56759 - petrochenkov:prestabuni, r=nikomatsakis