Skip to content

2018 idioms: incorrect suggestion for root module and crate of same name #55759

Open
@alexcrichton

Description

@alexcrichton

First reported at rust-lang/cargo#6273

this code:

#![warn(rust_2018_idioms)]

extern crate time as std_time;

pub mod time {
    pub fn f() {
        println!("{:?}", crate::std_time::now());
    }
}

fn main() {}

when compiled gives a warning that, when applied, produces code that doesn't compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions