Skip to content

migration lint for use crate fails with <Foo as Bar>::Baz paths #50970

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

Closed
nikomatsakis opened this issue May 22, 2018 · 1 comment
Closed

migration lint for use crate fails with <Foo as Bar>::Baz paths #50970

nikomatsakis opened this issue May 22, 2018 · 1 comment
Labels
A-edition-2018 Area: The 2018 edition F-rust_2018_preview `#![feature(rust_2018_preview)]`

Comments

@nikomatsakis
Copy link
Contributor

Test case:

#![warn(rust_2018_compatibility)]
#![feature(rust_2018_preview)]

mod foo {
    crate trait Foo {
        type Bar;
    }

    impl Foo for u32 {
        type Bar = ();
    }
}


fn main() {
    let _: <u32 as ::foo::Foo>::Bar = ();
}

This currently suggests:

help: use `crate`: `crate::<u32 as ::foo::Foo>::Bar`

but should suggest:

help: use `crate`: `<u32 as crate::foo::Foo>::Bar`
@nikomatsakis nikomatsakis added the F-rust_2018_preview `#![feature(rust_2018_preview)]` label May 22, 2018
alexcrichton added a commit to alexcrichton/rust that referenced this issue May 22, 2018
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!

Closes rust-lang#50978
@nikomatsakis
Copy link
Contributor Author

Got the fix in a branch

bors added a commit that referenced this issue May 23, 2018
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
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue May 23, 2018
bors added a commit that referenced this issue May 23, 2018
…h, r=alexcrichton

Issue 50970 migration lint fq path

Similar issue, but for fully qualified paths.

Fixes #50970

r? @alexcrichton
@fmease fmease added the A-edition-2018 Area: The 2018 edition label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2018 Area: The 2018 edition F-rust_2018_preview `#![feature(rust_2018_preview)]`
Projects
None yet
Development

No branches or pull requests

2 participants