summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/missing-bounds.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/generic-associated-types/missing-bounds.stderr')
-rw-r--r--src/test/ui/generic-associated-types/missing-bounds.stderr98
1 files changed, 98 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr
new file mode 100644
index 000000000..138c642dd
--- /dev/null
+++ b/src/test/ui/generic-associated-types/missing-bounds.stderr
@@ -0,0 +1,98 @@
+error: equality constraints are not yet supported in `where` clauses
+ --> $DIR/missing-bounds.rs:37:33
+ |
+LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
+ | ^^^^^^^^^^^^^^^^^^^^^^ not supported
+ |
+ = note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information
+help: if `Output` is an associated type you're trying to set, use the associated type binding syntax
+ |
+LL | impl<B: Add> Add for E<B> where B: Add<Output = B> {
+ | ~~~~~~~~~~~~~~~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/missing-bounds.rs:11:11
+ |
+LL | impl<B> Add for A<B> where B: Add {
+ | - this type parameter
+...
+LL | A(self.0 + rhs.0)
+ | - ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+ | |
+ | arguments to this struct are incorrect
+ |
+ = note: expected type parameter `B`
+ found associated type `<B as Add>::Output`
+note: tuple struct defined here
+ --> $DIR/missing-bounds.rs:5:8
+ |
+LL | struct A<B>(B);
+ | ^
+help: consider further restricting this bound
+ |
+LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
+ | +++++++++++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/missing-bounds.rs:21:14
+ |
+LL | impl<B: Add> Add for C<B> {
+ | - this type parameter
+...
+LL | Self(self.0 + rhs.0)
+ | ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected type parameter `B`
+ found associated type `<B as Add>::Output`
+note: tuple struct defined here
+ --> $DIR/missing-bounds.rs:15:8
+ |
+LL | struct C<B>(B);
+ | ^
+help: consider further restricting this bound
+ |
+LL | impl<B: Add + Add<Output = B>> Add for C<B> {
+ | +++++++++++++++++
+
+error[E0369]: cannot add `B` to `B`
+ --> $DIR/missing-bounds.rs:31:21
+ |
+LL | Self(self.0 + rhs.0)
+ | ------ ^ ----- B
+ | |
+ | B
+ |
+help: consider restricting type parameter `B`
+ |
+LL | impl<B: std::ops::Add<Output=B>> Add for D<B> {
+ | +++++++++++++++++++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/missing-bounds.rs:42:14
+ |
+LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
+ | - this type parameter
+...
+LL | Self(self.0 + rhs.0)
+ | ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected type parameter `B`
+ found associated type `<B as Add>::Output`
+note: tuple struct defined here
+ --> $DIR/missing-bounds.rs:35:8
+ |
+LL | struct E<B>(B);
+ | ^
+help: consider further restricting this bound
+ |
+LL | impl<B: Add + Add<Output = B>> Add for E<B> where <B as Add>::Output = B {
+ | +++++++++++++++++
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0308, E0369.
+For more information about an error, try `rustc --explain E0308`.