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
The absolute_path_not_starting_with_crate lint is firing twice for the same import (even after #50969) which cause rustfix to get confused and many warnings continue to get emitted:
#![crate_type = "rlib"]#![allow(unused_imports, dead_code)]#![feature(rust_2018_preview)]#![warn(rust_2018_compatibility)]mod foo {pubfnbar(){}}mod another {use foo::{self, bar};}
$ rustc foo.rs
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> foo.rs:11:9
|
11 | use foo::{self, bar};
| ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self, bar}`
|
note: lint level defined here
--> foo.rs:4:9
|
4 | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: #[warn(absolute_path_not_starting_with_crate)] implied by #[warn(rust_2018_compatibility)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue TBD
warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> foo.rs:11:15
|
11 | use foo::{self, bar};
| ^^^^ help: use `crate`: `crate::self`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue TBD
The text was updated successfully, but these errors were encountered:
This commit fixes another issue in the `absolute_path_not_starting_with_crate`
lint where it warns twice about an import which may contain `self`. It turns out
there were a few more locations that needed updating to use `root_id` and
`root_span` introduced in rust-lang#50970 and after that it looks to work like a charm!
Closesrust-lang#50978
rustc: Fix another double-lint issue with `crate::`
This commit fixes another issue in the `absolute_path_not_starting_with_crate`
lint where it warns twice about an import which may contain `self`. It turns out
there were a few more locations that needed updating to use `root_id` and
`root_span` introduced in #50970 and after that it looks to work like a charm!
Closes#50978
The
absolute_path_not_starting_with_crate
lint is firing twice for the same import (even after #50969) which cause rustfix to get confused and many warnings continue to get emitted:The text was updated successfully, but these errors were encountered: