Skip to content

absolute_path_not_starting_with_crate lint firing twice for the same import #50978

Closed
@alexcrichton

Description

@alexcrichton

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 {
    pub fn bar() {}
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions