diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /tests/ui/imports | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/imports')
-rw-r--r-- | tests/ui/imports/issue-109148.rs | 15 | ||||
-rw-r--r-- | tests/ui/imports/issue-109148.stderr | 13 | ||||
-rw-r--r-- | tests/ui/imports/issue-109343.rs | 10 | ||||
-rw-r--r-- | tests/ui/imports/issue-109343.stderr | 11 |
4 files changed, 49 insertions, 0 deletions
diff --git a/tests/ui/imports/issue-109148.rs b/tests/ui/imports/issue-109148.rs new file mode 100644 index 000000000..694cb494a --- /dev/null +++ b/tests/ui/imports/issue-109148.rs @@ -0,0 +1,15 @@ +// edition: 2021 + +// https://github.com/rust-lang/rust/pull/111761#issuecomment-1557777314 +macro_rules! m { + () => { + extern crate core as std; + //~^ ERROR macro-expanded `extern crate` items cannot shadow names passed with `--extern` + } +} + +m!(); + +use std::mem; + +fn main() {} diff --git a/tests/ui/imports/issue-109148.stderr b/tests/ui/imports/issue-109148.stderr new file mode 100644 index 000000000..6cc1221cf --- /dev/null +++ b/tests/ui/imports/issue-109148.stderr @@ -0,0 +1,13 @@ +error: macro-expanded `extern crate` items cannot shadow names passed with `--extern` + --> $DIR/issue-109148.rs:6:9 + | +LL | extern crate core as std; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | m!(); + | ---- in this macro invocation + | + = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/tests/ui/imports/issue-109343.rs b/tests/ui/imports/issue-109343.rs new file mode 100644 index 000000000..0c10259bc --- /dev/null +++ b/tests/ui/imports/issue-109343.rs @@ -0,0 +1,10 @@ +#![crate_type = "lib"] + +pub mod f {} +pub use unresolved::f; +//~^ ERROR unresolved import `unresolved` + +/// [g] +pub use f as g; + +fn main() {} diff --git a/tests/ui/imports/issue-109343.stderr b/tests/ui/imports/issue-109343.stderr new file mode 100644 index 000000000..8d9a3aee9 --- /dev/null +++ b/tests/ui/imports/issue-109343.stderr @@ -0,0 +1,11 @@ +error[E0432]: unresolved import `unresolved` + --> $DIR/issue-109343.rs:4:9 + | +LL | pub use unresolved::f; + | ^^^^^^^^^^ maybe a missing crate `unresolved`? + | + = help: consider adding `extern crate unresolved` to use the `unresolved` crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. |