summaryrefslogtreecommitdiffstats
path: root/tests/ui/rust-2018
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/rust-2018
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/rust-2018')
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.fixed6
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.rs8
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives.stderr11
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr2
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr2
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs4
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr21
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity.rs4
-rw-r--r--tests/ui/rust-2018/uniform-paths/ambiguity.stderr21
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs3
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr24
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs8
-rw-r--r--tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr60
-rw-r--r--tests/ui/rust-2018/uniform-paths/issue-56596.stderr5
-rw-r--r--tests/ui/rust-2018/uniform-paths/macro-rules.rs3
-rw-r--r--tests/ui/rust-2018/uniform-paths/macro-rules.stderr24
16 files changed, 41 insertions, 165 deletions
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed b/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
index 868bdf2e0..5058d61b5 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
@@ -801,4 +801,10 @@ where
yoo: &'a U
}
+// https://github.com/rust-lang/rust/issues/105150
+struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+{
+ data: &'a T,
+}
+
fn main() {}
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.rs b/tests/ui/rust-2018/edition-lint-infer-outlives.rs
index 75783764a..3f63cb8e9 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.rs
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.rs
@@ -801,4 +801,12 @@ where
yoo: &'a U
}
+// https://github.com/rust-lang/rust/issues/105150
+struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+//~^ ERROR outlives requirements can be inferred
+ where T: 'a,
+{
+ data: &'a T,
+}
+
fn main() {}
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr b/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
index e655fb484..dbf301fd8 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
@@ -11,6 +11,15 @@ LL | #![deny(explicit_outlives_requirements)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: outlives requirements can be inferred
+ --> $DIR/edition-lint-infer-outlives.rs:805:56
+ |
+LL | struct InferredWhereBoundWithInlineBound<'a, T: ?Sized>
+ | ________________________________________________________^
+LL | |
+LL | | where T: 'a,
+ | |________________^ help: remove this bound
+
+error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives.rs:26:31
|
LL | struct TeeOutlivesAy<'a, T: 'a> {
@@ -922,5 +931,5 @@ error: outlives requirements can be inferred
LL | union BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where 'b: 'a, T: Debug {
| ^^^^^^^^ help: remove this bound
-error: aborting due to 153 previous errors
+error: aborting due to 154 previous errors
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
index 7e008d465..a5c79366b 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr
@@ -4,7 +4,7 @@ error[E0659]: `std` is ambiguous
LL | pub use std::io;
| ^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `std` could refer to a built-in crate
= help: use `::std` to refer to this crate unambiguously
note: `std` could also refer to the module defined here
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
index 771d2c10c..8045f3a45 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
@@ -4,7 +4,7 @@ error[E0659]: `std` is ambiguous
LL | use std::io;
| ^^^ ambiguous name
|
- = note: ambiguous because of multiple potential import sources
+ = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
= note: `std` could refer to a built-in crate
= help: use `::std` to refer to this crate unambiguously
note: `std` could also refer to the module defined here
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
index 50c8fc822..0ef580d7a 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
// This test is similar to `ambiguity.rs`, but nested in a module.
@@ -5,8 +6,7 @@
#![allow(non_camel_case_types)]
mod foo {
- pub use std::io;
- //~^ ERROR `std` is ambiguous
+ pub use std::io; // OK
mod std {
pub struct io;
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr
deleted file mode 100644
index defb16f79..000000000
--- a/tests/ui/rust-2018/uniform-paths/ambiguity-nested.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0659]: `std` is ambiguous
- --> $DIR/ambiguity-nested.rs:8:13
- |
-LL | pub use std::io;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
- = note: `std` could refer to a built-in crate
- = help: use `::std` to refer to this crate unambiguously
-note: `std` could also refer to the module defined here
- --> $DIR/ambiguity-nested.rs:11:5
- |
-LL | / mod std {
-LL | | pub struct io;
-LL | | }
- | |_____^
- = help: use `self::std` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity.rs b/tests/ui/rust-2018/uniform-paths/ambiguity.rs
index 60f77a1c6..890e8b7b3 100644
--- a/tests/ui/rust-2018/uniform-paths/ambiguity.rs
+++ b/tests/ui/rust-2018/uniform-paths/ambiguity.rs
@@ -1,9 +1,9 @@
+// check-pass
// edition:2018
#![allow(non_camel_case_types)]
-use std::io;
-//~^ ERROR `std` is ambiguous
+use std::io; // OK
mod std {
pub struct io;
diff --git a/tests/ui/rust-2018/uniform-paths/ambiguity.stderr b/tests/ui/rust-2018/uniform-paths/ambiguity.stderr
deleted file mode 100644
index 2d735c7e3..000000000
--- a/tests/ui/rust-2018/uniform-paths/ambiguity.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0659]: `std` is ambiguous
- --> $DIR/ambiguity.rs:5:5
- |
-LL | use std::io;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
- = note: `std` could refer to a built-in crate
- = help: use `::std` to refer to this crate unambiguously
-note: `std` could also refer to the module defined here
- --> $DIR/ambiguity.rs:8:1
- |
-LL | / mod std {
-LL | | pub struct io;
-LL | | }
- | |_^
- = help: use `crate::std` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
index 3f5897901..4cba09498 100644
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
+++ b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
mod my {
@@ -13,7 +14,7 @@ mod sub {
fn foo() {
use my::sub;
{
- use sub::bar; //~ ERROR `sub` is ambiguous
+ use sub::bar; // OK
}
}
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr
deleted file mode 100644
index 3d45a8140..000000000
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0659]: `sub` is ambiguous
- --> $DIR/block-scoped-shadow-nested.rs:16:13
- |
-LL | use sub::bar;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `sub` could refer to the module imported here
- --> $DIR/block-scoped-shadow-nested.rs:14:9
- |
-LL | use my::sub;
- | ^^^^^^^
-note: `sub` could also refer to the module defined here
- --> $DIR/block-scoped-shadow-nested.rs:9:1
- |
-LL | / mod sub {
-LL | | pub fn bar() {}
-LL | | }
- | |_^
- = help: use `crate::sub` to refer to this module unambiguously
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
index 828ee4fe4..c902d133e 100644
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
+++ b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.rs
@@ -1,3 +1,4 @@
+// check-pass
// edition:2018
#![allow(non_camel_case_types)]
@@ -8,14 +9,11 @@ struct std;
fn main() {
enum Foo { A, B }
- use Foo::*;
- //~^ ERROR `Foo` is ambiguous
+ use Foo::*; // OK
let _ = (A, B);
fn std() {}
enum std {}
- use std as foo;
- //~^ ERROR `std` is ambiguous
- //~| ERROR `std` is ambiguous
+ use std as foo; // OK
}
diff --git a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr b/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr
deleted file mode 100644
index b068312ce..000000000
--- a/tests/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error[E0659]: `Foo` is ambiguous
- --> $DIR/block-scoped-shadow.rs:11:9
- |
-LL | use Foo::*;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `Foo` could refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:10:5
- |
-LL | enum Foo { A, B }
- | ^^^^^^^^^^^^^^^^^
-note: `Foo` could also refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:5:1
- |
-LL | enum Foo {}
- | ^^^^^^^^^^^
- = help: use `crate::Foo` to refer to this enum unambiguously
-
-error[E0659]: `std` is ambiguous
- --> $DIR/block-scoped-shadow.rs:18:9
- |
-LL | use std as foo;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `std` could refer to the enum defined here
- --> $DIR/block-scoped-shadow.rs:17:5
- |
-LL | enum std {}
- | ^^^^^^^^^^^
-note: `std` could also refer to the struct defined here
- --> $DIR/block-scoped-shadow.rs:7:1
- |
-LL | struct std;
- | ^^^^^^^^^^^
- = help: use `crate::std` to refer to this struct unambiguously
-
-error[E0659]: `std` is ambiguous
- --> $DIR/block-scoped-shadow.rs:18:9
- |
-LL | use std as foo;
- | ^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `std` could refer to the function defined here
- --> $DIR/block-scoped-shadow.rs:16:5
- |
-LL | fn std() {}
- | ^^^^^^^^^^^
-note: `std` could also refer to the unit struct defined here
- --> $DIR/block-scoped-shadow.rs:7:1
- |
-LL | struct std;
- | ^^^^^^^^^^^
- = help: use `crate::std` to refer to this unit struct unambiguously
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/rust-2018/uniform-paths/issue-56596.stderr b/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
index 8b8ab26dc..849d6275e 100644
--- a/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
+++ b/tests/ui/rust-2018/uniform-paths/issue-56596.stderr
@@ -4,7 +4,7 @@ error[E0659]: `issue_56596` is ambiguous
LL | use issue_56596;
| ^^^^^^^^^^^ 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_56596` could refer to a crate passed with `--extern`
= help: use `::issue_56596` to refer to this crate unambiguously
note: `issue_56596` could also refer to the module imported here
@@ -12,7 +12,8 @@ note: `issue_56596` could also refer to the module imported here
|
LL | use m::*;
| ^^^^
- = help: use `crate::issue_56596` to refer to this module unambiguously
+ = help: consider adding an explicit import of `issue_56596` to disambiguate
+ = help: or use `crate::issue_56596` to refer to this module unambiguously
error: aborting due to previous error
diff --git a/tests/ui/rust-2018/uniform-paths/macro-rules.rs b/tests/ui/rust-2018/uniform-paths/macro-rules.rs
index 2d9a6a9a9..1084f5e8b 100644
--- a/tests/ui/rust-2018/uniform-paths/macro-rules.rs
+++ b/tests/ui/rust-2018/uniform-paths/macro-rules.rs
@@ -27,8 +27,7 @@ mod m3 {
fn f() {
macro_rules! legacy_macro { () => () }
- // Legacy macro imports create ambiguities with other names in the same namespace.
- use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous
+ use legacy_macro as _; // OK
}
}
diff --git a/tests/ui/rust-2018/uniform-paths/macro-rules.stderr b/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
index 9f8c928c3..8a978c98a 100644
--- a/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
+++ b/tests/ui/rust-2018/uniform-paths/macro-rules.stderr
@@ -10,26 +10,6 @@ help: consider adding a `#[macro_export]` to the macro in the imported module
LL | macro_rules! legacy_macro { () => () }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0659]: `legacy_macro` is ambiguous
- --> $DIR/macro-rules.rs:31:13
- |
-LL | use legacy_macro as _;
- | ^^^^^^^^^^^^ ambiguous name
- |
- = note: ambiguous because of multiple potential import sources
-note: `legacy_macro` could refer to the macro defined here
- --> $DIR/macro-rules.rs:28:9
- |
-LL | macro_rules! legacy_macro { () => () }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: `legacy_macro` could also refer to the macro defined here
- --> $DIR/macro-rules.rs:25:5
- |
-LL | macro legacy_macro() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `self::legacy_macro` to refer to this macro unambiguously
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0364, E0659.
-For more information about an error, try `rustc --explain E0364`.
+For more information about this error, try `rustc --explain E0364`.