-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_resolve: inject
uniform_paths
canary always on Rust 2018.
- Loading branch information
Showing
12 changed files
with
236 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
// This test is similar to `ambiguity-macros.rs`, but nested in a module. | ||
|
||
mod foo { | ||
pub use std::io; | ||
//~^ ERROR `std` import is ambiguous | ||
|
||
macro_rules! m { | ||
() => { | ||
mod std { | ||
pub struct io; | ||
} | ||
} | ||
} | ||
m!(); | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: `std` import is ambiguous | ||
--> $DIR/ambiguity-macros-nested.rs:16:13 | ||
| | ||
LL | pub use std::io; | ||
| ^^^ can refer to external crate `::std` | ||
... | ||
LL | / mod std { | ||
LL | | pub struct io; | ||
LL | | } | ||
| |_____________- may refer to `self::std` in the future | ||
| | ||
= help: write `::std` or `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: aborting due to previous error | ||
|
27 changes: 27 additions & 0 deletions
27
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
// This test is similar to `ambiguity.rs`, but with macros defining local items. | ||
|
||
use std::io; | ||
//~^ ERROR `std` import is ambiguous | ||
|
||
macro_rules! m { | ||
() => { | ||
mod std { | ||
pub struct io; | ||
} | ||
} | ||
} | ||
m!(); | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: `std` import is ambiguous | ||
--> $DIR/ambiguity-macros.rs:15:5 | ||
| | ||
LL | use std::io; | ||
| ^^^ can refer to external crate `::std` | ||
... | ||
LL | / mod std { | ||
LL | | pub struct io; | ||
LL | | } | ||
| |_________- may refer to `self::std` in the future | ||
| | ||
= help: write `::std` or `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: aborting due to previous error | ||
|
24 changes: 24 additions & 0 deletions
24
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
// This test is similar to `ambiguity.rs`, but nested in a module. | ||
|
||
mod foo { | ||
pub use std::io; | ||
//~^ ERROR `std` import is ambiguous | ||
|
||
mod std { | ||
pub struct io; | ||
} | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: `std` import is ambiguous | ||
--> $DIR/ambiguity-nested.rs:16:13 | ||
| | ||
LL | pub use std::io; | ||
| ^^^ can refer to external crate `::std` | ||
... | ||
LL | / mod std { | ||
LL | | pub struct io; | ||
LL | | } | ||
| |_____- may refer to `self::std` in the future | ||
| | ||
= help: write `::std` or `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: aborting due to previous error | ||
|
20 changes: 20 additions & 0 deletions
20
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
use std::io; | ||
//~^ ERROR `std` import is ambiguous | ||
|
||
mod std { | ||
pub struct io; | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: `std` import is ambiguous | ||
--> $DIR/ambiguity.rs:13:5 | ||
| | ||
LL | use std::io; | ||
| ^^^ can refer to external crate `::std` | ||
... | ||
LL | / mod std { | ||
LL | | pub struct io; | ||
LL | | } | ||
| |_- may refer to `self::std` in the future | ||
| | ||
= help: write `::std` or `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: aborting due to previous error | ||
|
21 changes: 21 additions & 0 deletions
21
src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
struct std; | ||
|
||
fn main() { | ||
fn std() {} | ||
enum std {} | ||
use std as foo; | ||
//~^ ERROR `std` import is ambiguous | ||
//~| ERROR `std` import is ambiguous | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error: `std` import is ambiguous | ||
--> $DIR/block-scoped-shadow.rs:18:9 | ||
| | ||
LL | struct std; | ||
| ----------- may refer to `self::std` in the future | ||
... | ||
LL | enum std {} | ||
| ----------- shadowed by block-scoped `std` | ||
LL | use std as foo; | ||
| ^^^ can refer to external crate `::std` | ||
| | ||
= help: write `::std` or `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: `std` import is ambiguous | ||
--> $DIR/block-scoped-shadow.rs:18:9 | ||
| | ||
LL | struct std; | ||
| ----------- may refer to `self::std` in the future | ||
... | ||
LL | fn std() {} | ||
| ----------- shadowed by block-scoped `std` | ||
LL | enum std {} | ||
LL | use std as foo; | ||
| ^^^ | ||
| | ||
= help: write `self::std` explicitly instead | ||
= note: in the future, `#![feature(uniform_paths)]` may become the default | ||
|
||
error: aborting due to 2 previous errors | ||
|