]> git.lizzy.rs Git - rust.git/blob - src/test/ui/edition-lint-paths.rs
Auto merge of #50137 - nox:rm-bool-cmp-hack, r=eddyb
[rust.git] / src / test / ui / edition-lint-paths.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![feature(crate_in_paths)]
12 #![deny(absolute_path_starting_with_module)]
13 #![allow(unused)]
14
15 pub mod foo {
16     use ::bar::Bar;
17     //~^ ERROR Absolute
18     //~| WARN this was previously accepted
19     use super::bar::Bar2;
20     use crate::bar::Bar3;
21 }
22
23
24 use bar::Bar;
25 //~^ ERROR Absolute
26 //~| WARN this was previously accepted
27
28 pub mod bar {
29     pub struct Bar;
30     pub type Bar2 = Bar;
31     pub type Bar3 = Bar;
32 }
33
34 fn main() {
35     let x = ::bar::Bar;
36     //~^ ERROR Absolute
37     //~| WARN this was previously accepted
38     let x = bar::Bar;
39     let x = ::crate::bar::Bar;
40     let x = self::bar::Bar;
41 }