rust/src/test/ui/rust-2018/edition-lint-fully-qualified-paths.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
560 B
Rust
Raw Normal View History

// run-rustfix
#![feature(rust_2018_preview, crate_visibility_modifier)]
2018-05-18 17:13:53 -05:00
#![deny(absolute_paths_not_starting_with_crate)]
mod foo {
crate trait Foo {
type Bar;
}
2021-06-16 07:27:44 -05:00
crate struct Baz {}
impl Foo for Baz {
type Bar = ();
}
}
fn main() {
let _: <foo::Baz as ::foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
2021-06-16 07:27:44 -05:00
//~| this is accepted in the current edition
let _: <::foo::Baz as foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
2021-06-16 07:27:44 -05:00
//~| this is accepted in the current edition
}