summaryrefslogtreecommitdiffstats
path: root/tests/ui/imports
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/imports
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/imports')
-rw-r--r--tests/ui/imports/auxiliary/issue-85992-extern-1.rs6
-rw-r--r--tests/ui/imports/auxiliary/issue-85992-extern-2.rs1
-rw-r--r--tests/ui/imports/issue-55884-2.rs1
-rw-r--r--tests/ui/imports/issue-55884-2.stderr6
-rw-r--r--tests/ui/imports/issue-56125.stderr15
-rw-r--r--tests/ui/imports/issue-57539.stderr5
-rw-r--r--tests/ui/imports/issue-85992.rs11
-rw-r--r--tests/ui/imports/issue-85992.stderr9
8 files changed, 43 insertions, 11 deletions
diff --git a/tests/ui/imports/auxiliary/issue-85992-extern-1.rs b/tests/ui/imports/auxiliary/issue-85992-extern-1.rs
new file mode 100644
index 000000000..a2d0e2060
--- /dev/null
+++ b/tests/ui/imports/auxiliary/issue-85992-extern-1.rs
@@ -0,0 +1,6 @@
+#[macro_export]
+macro_rules! m {
+ () => {
+ use issue_85992_extern_2::Outcome;
+ }
+}
diff --git a/tests/ui/imports/auxiliary/issue-85992-extern-2.rs b/tests/ui/imports/auxiliary/issue-85992-extern-2.rs
new file mode 100644
index 000000000..e9b6a44cf
--- /dev/null
+++ b/tests/ui/imports/auxiliary/issue-85992-extern-2.rs
@@ -0,0 +1 @@
+// nothing
diff --git a/tests/ui/imports/issue-55884-2.rs b/tests/ui/imports/issue-55884-2.rs
index 75bb4206f..6f8d0cf8a 100644
--- a/tests/ui/imports/issue-55884-2.rs
+++ b/tests/ui/imports/issue-55884-2.rs
@@ -6,6 +6,7 @@ mod parser {
pub use options::*;
// Private single import shadows public glob import, but arrives too late for initial
// resolution of `use parser::ParseOptions` because it depends on that resolution itself.
+ #[allow(hidden_glob_reexports)]
use ParseOptions;
}
diff --git a/tests/ui/imports/issue-55884-2.stderr b/tests/ui/imports/issue-55884-2.stderr
index 5adbc4b66..67d411414 100644
--- a/tests/ui/imports/issue-55884-2.stderr
+++ b/tests/ui/imports/issue-55884-2.stderr
@@ -1,16 +1,16 @@
error[E0603]: struct import `ParseOptions` is private
- --> $DIR/issue-55884-2.rs:12:17
+ --> $DIR/issue-55884-2.rs:13:17
|
LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^ private struct import
|
note: the struct import `ParseOptions` is defined here...
- --> $DIR/issue-55884-2.rs:9:9
+ --> $DIR/issue-55884-2.rs:10:9
|
LL | use ParseOptions;
| ^^^^^^^^^^^^
note: ...and refers to the struct import `ParseOptions` which is defined here...
- --> $DIR/issue-55884-2.rs:12:9
+ --> $DIR/issue-55884-2.rs:13:9
|
LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^^^^^^^^^ consider importing it directly
diff --git a/tests/ui/imports/issue-56125.stderr b/tests/ui/imports/issue-56125.stderr
index 3448f3119..15477fb6f 100644
--- a/tests/ui/imports/issue-56125.stderr
+++ b/tests/ui/imports/issue-56125.stderr
@@ -22,7 +22,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::last_segment::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -30,7 +30,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::last_segment::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error[E0659]: `issue_56125` is ambiguous
--> $DIR/issue-56125.rs:11:9
@@ -38,7 +39,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::non_last_segment::non_last_segment::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -46,7 +47,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::non_last_segment::non_last_segment::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error[E0659]: `issue_56125` is ambiguous
--> $DIR/issue-56125.rs:18:9
@@ -54,7 +56,7 @@ error[E0659]: `issue_56125` is ambiguous
LL | use issue_56125::*;
| ^^^^^^^^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `issue_56125` could refer to a crate passed with `--extern`
= help: use `::issue_56125` to refer to this crate unambiguously
note: `issue_56125` could also refer to the module imported here
@@ -62,7 +64,8 @@ note: `issue_56125` could also refer to the module imported here
|
LL | use issue_56125::*;
| ^^^^^^^^^^^^^^
- = help: use `self::issue_56125` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56125` to disambiguate
+ = help: or use `self::issue_56125` to refer to this module unambiguously
error: aborting due to 4 previous errors
diff --git a/tests/ui/imports/issue-57539.stderr b/tests/ui/imports/issue-57539.stderr
index 1a3ca4eda..88cc42ccf 100644
--- a/tests/ui/imports/issue-57539.stderr
+++ b/tests/ui/imports/issue-57539.stderr
@@ -4,7 +4,7 @@ error[E0659]: `core` is ambiguous
LL | use core;
| ^^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `core` could refer to a built-in crate
= help: use `::core` to refer to this crate unambiguously
note: `core` could also refer to the module imported here
@@ -12,7 +12,8 @@ note: `core` could also refer to the module imported here
|
LL | use crate::*;
| ^^^^^^^^
- = help: use `self::core` to refer to this module unambiguously
+ = help: consider adding an explicit import of `core` to disambiguate
+ = help: or use `self::core` to refer to this module unambiguously
error: aborting due to previous error
diff --git a/tests/ui/imports/issue-85992.rs b/tests/ui/imports/issue-85992.rs
new file mode 100644
index 000000000..d55241091
--- /dev/null
+++ b/tests/ui/imports/issue-85992.rs
@@ -0,0 +1,11 @@
+// edition: 2021
+// compile-flags: --extern issue_85992_extern_1 --extern issue_85992_extern_2
+// aux-build: issue-85992-extern-1.rs
+// aux-build: issue-85992-extern-2.rs
+
+issue_85992_extern_1::m!();
+
+use crate::issue_85992_extern_2;
+//~^ ERROR unresolved import `crate::issue_85992_extern_2`
+
+fn main() {}
diff --git a/tests/ui/imports/issue-85992.stderr b/tests/ui/imports/issue-85992.stderr
new file mode 100644
index 000000000..810d41009
--- /dev/null
+++ b/tests/ui/imports/issue-85992.stderr
@@ -0,0 +1,9 @@
+error[E0432]: unresolved import `crate::issue_85992_extern_2`
+ --> $DIR/issue-85992.rs:8:5
+ |
+LL | use crate::issue_85992_extern_2;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `issue_85992_extern_2` in the root
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0432`.