Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexcrichton opened this issue Nov 7, 2018 · 3 comments
Labels
A-edition-2018-lints Area: lints supporting the 2018 edition A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@alexcrichton
Copy link
Member

alexcrichton commented Nov 7, 2018

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

@alexcrichton alexcrichton added the A-edition-2018-lints Area: lints supporting the 2018 edition label Nov 7, 2018
@alexcrichton
Copy link
Member Author

@ehuss notes that this code is likely relevant here.

@alexcrichton alexcrichton added the A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. label Jan 7, 2019
@estebank estebank added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 11, 2019
@estebank
Copy link
Contributor

Beta no longer emits this warning.

@ehuss
Copy link
Contributor

ehuss commented Jun 11, 2019

Yea, appears to be fixed by #60252. Although the test in that one is very similar, this issue is specific to a use ambiguity error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2018-lints Area: lints supporting the 2018 edition A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

3 participants