summaryrefslogtreecommitdiffstats
path: root/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
blob: 48b091ddb45ed6a9cccfcf7f4679153bed4a97e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// run-rustfix

#![feature(rust_2018_preview)]
#![deny(absolute_paths_not_starting_with_crate)]

mod foo {
    pub(crate) trait Foo {
        type Bar;
    }

    pub(crate) struct Baz {}

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

fn main() {
    let _: <foo::Baz as ::foo::Foo>::Bar = ();
    //~^ ERROR absolute paths must start with
    //~| WARN this is accepted in the current edition
    //~| ERROR absolute paths must start with
    //~| WARN this is accepted in the current edition

    let _: <::foo::Baz as foo::Foo>::Bar = ();
    //~^ ERROR absolute paths must start with
    //~| WARN this is accepted in the current edition
}