summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-types
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/associated-types
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/associated-types')
-rw-r--r--tests/ui/associated-types/associated-types-in-ambiguous-context.rs2
-rw-r--r--tests/ui/associated-types/associated-types-in-ambiguous-context.stderr21
-rw-r--r--tests/ui/associated-types/defaults-suitability.stderr6
-rw-r--r--tests/ui/associated-types/issue-20825.stderr2
-rw-r--r--tests/ui/associated-types/issue-63591.rs10
-rw-r--r--tests/ui/associated-types/issue-67684.rs8
6 files changed, 35 insertions, 14 deletions
diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.rs b/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
index 51b53908f..5d6b1b591 100644
--- a/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
+++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
@@ -1,3 +1,5 @@
+// normalize-stderr-test: "and \d+ other candidates" -> "and N other candidates"
+
trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
index 00856b55d..1ff6fd4b8 100644
--- a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
+++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
@@ -1,5 +1,5 @@
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:6:36
+ --> $DIR/associated-types-in-ambiguous-context.rs:8:36
|
LL | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
| ^^^^^^^^^^
@@ -10,30 +10,37 @@ LL | fn get<T:Get,U:Get>(x: T, y: U) -> <Example as Get>::Value {}
| ~~~~~~~~~~~~~~~~~~~~~~~
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:20:17
+ --> $DIR/associated-types-in-ambiguous-context.rs:22:17
|
LL | trait Foo where Foo::Assoc: Bar {
| ^^^^^^^^^^ help: use the fully-qualified path: `<Self as Foo>::Assoc`
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:25:10
+ --> $DIR/associated-types-in-ambiguous-context.rs:27:10
|
LL | type X = std::ops::Deref::Target;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
-help: if there were a type named `Example` that implemented `Deref`, you could use the fully-qualified path
+help: use the fully-qualified path
|
-LL | type X = <Example as Deref>::Target;
+LL | type X = <CString as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <IoSlice<'_> as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <IoSliceMut<'_> as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <OsString as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ and N other candidates
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:11:23
+ --> $DIR/associated-types-in-ambiguous-context.rs:13:23
|
LL | fn grab(&self) -> Grab::Value;
| ^^^^^^^^^^^ help: use the fully-qualified path: `<Self as Grab>::Value`
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:14:22
+ --> $DIR/associated-types-in-ambiguous-context.rs:16:22
|
LL | fn get(&self) -> Get::Value;
| ^^^^^^^^^^
diff --git a/tests/ui/associated-types/defaults-suitability.stderr b/tests/ui/associated-types/defaults-suitability.stderr
index 248575875..4b2094691 100644
--- a/tests/ui/associated-types/defaults-suitability.stderr
+++ b/tests/ui/associated-types/defaults-suitability.stderr
@@ -11,7 +11,8 @@ LL | type Ty: Clone = NotClone;
| ^^^^^ required by this bound in `Tr::Ty`
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error[E0277]: the trait bound `NotClone: Clone` is not satisfied
@@ -30,7 +31,8 @@ LL | type Ty = NotClone;
| -- required by a bound in this associated type
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error[E0277]: the trait bound `T: Clone` is not satisfied
diff --git a/tests/ui/associated-types/issue-20825.stderr b/tests/ui/associated-types/issue-20825.stderr
index be2bbd448..c4dea68b8 100644
--- a/tests/ui/associated-types/issue-20825.stderr
+++ b/tests/ui/associated-types/issue-20825.stderr
@@ -5,7 +5,7 @@ LL | pub trait Processor: Subscriber<Input = Self::Input> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing the super traits of `Processor` with associated type name `Input` again
-note: cycle used when computing the super traits of `Processor`
+note: cycle used when computing the super predicates of `Processor`
--> $DIR/issue-20825.rs:5:1
|
LL | pub trait Processor: Subscriber<Input = Self::Input> {
diff --git a/tests/ui/associated-types/issue-63591.rs b/tests/ui/associated-types/issue-63591.rs
index 4d2e39f4d..d07c12349 100644
--- a/tests/ui/associated-types/issue-63591.rs
+++ b/tests/ui/associated-types/issue-63591.rs
@@ -1,11 +1,13 @@
// check-pass
#![feature(associated_type_bounds)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
fn main() {}
-trait Bar { type Assoc; }
+trait Bar {
+ type Assoc;
+}
trait Thing {
type Out;
@@ -13,7 +15,9 @@ trait Thing {
}
struct AssocIsCopy;
-impl Bar for AssocIsCopy { type Assoc = u8; }
+impl Bar for AssocIsCopy {
+ type Assoc = u8;
+}
impl Thing for AssocIsCopy {
type Out = impl Bar<Assoc: Copy>;
diff --git a/tests/ui/associated-types/issue-67684.rs b/tests/ui/associated-types/issue-67684.rs
index 49efe8a1b..c6920cf8d 100644
--- a/tests/ui/associated-types/issue-67684.rs
+++ b/tests/ui/associated-types/issue-67684.rs
@@ -1,4 +1,10 @@
-// check-pass
+// revisions: check build
+// [check]check-pass
+//
+// This second configuration aims to verify that we do not ICE in ConstProp because of
+// normalization failure.
+// [build]build-pass
+// [build]compile-flags: -Zmir-opt-level=3 --emit=mir
#![allow(dead_code)]