summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr')
-rw-r--r--tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr91
1 files changed, 91 insertions, 0 deletions
diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
new file mode 100644
index 000000000..5be334986
--- /dev/null
+++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
@@ -0,0 +1,91 @@
+error[E0433]: failed to resolve: use of undeclared type `Unresolved`
+ --> $DIR/assoc_type_bound_with_struct.rs:19:31
+ |
+LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
+ | ^^^^^^^^^^ use of undeclared type `Unresolved`
+
+error[E0404]: expected trait, found struct `String`
+ --> $DIR/assoc_type_bound_with_struct.rs:5:46
+ |
+LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: String {
+ | ^^^^^^ not a trait
+ --> $SRC_DIR/alloc/src/string.rs:LL:COL
+ |
+ = note: similarly named trait `ToString` defined here
+ |
+help: constrain the associated type to `String`
+ |
+LL | struct Foo<T> where T: Bar, T: Bar<Baz = String> {
+ | ~~~~~~~~~~~~~~~~~~~~
+help: a trait with a similar name exists
+ |
+LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString {
+ | ~~~~~~~~
+
+error[E0404]: expected trait, found struct `String`
+ --> $DIR/assoc_type_bound_with_struct.rs:9:54
+ |
+LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String {
+ | ^^^^^^ not a trait
+ --> $SRC_DIR/alloc/src/string.rs:LL:COL
+ |
+ = note: similarly named trait `ToString` defined here
+ |
+help: constrain the associated type to `String`
+ |
+LL | struct Qux<'a, T> where T: Bar, &'a T: Bar<Baz = String> {
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
+help: a trait with a similar name exists
+ |
+LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString {
+ | ~~~~~~~~
+
+error[E0404]: expected trait, found struct `String`
+ --> $DIR/assoc_type_bound_with_struct.rs:13:45
+ |
+LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: String {
+ | ^^^^^^ not a trait
+ --> $SRC_DIR/alloc/src/string.rs:LL:COL
+ |
+ = note: similarly named trait `ToString` defined here
+ |
+help: constrain the associated type to `String`
+ |
+LL | fn foo<T: Bar>(_: T) where T: Bar<Baz = String> {
+ | ~~~~~~~~~~~~~~~~~~~~
+help: a trait with a similar name exists
+ |
+LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString {
+ | ~~~~~~~~
+
+error[E0404]: expected trait, found struct `String`
+ --> $DIR/assoc_type_bound_with_struct.rs:16:57
+ |
+LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String {
+ | ^^^^^^ not a trait
+ --> $SRC_DIR/alloc/src/string.rs:LL:COL
+ |
+ = note: similarly named trait `ToString` defined here
+ |
+help: constrain the associated type to `String`
+ |
+LL | fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar<Baz = String> {
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
+help: a trait with a similar name exists
+ |
+LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
+ | ~~~~~~~~
+
+error[E0404]: expected trait, found struct `String`
+ --> $DIR/assoc_type_bound_with_struct.rs:19:51
+ |
+LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
+ | ^^^^^^ help: a trait with a similar name exists: `ToString`
+ --> $SRC_DIR/alloc/src/string.rs:LL:COL
+ |
+ = note: similarly named trait `ToString` defined here
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0404, E0433.
+For more information about an error, try `rustc --explain E0404`.