diff options
Diffstat (limited to 'src/test/ui/compare-method')
| -rw-r--r-- | src/test/ui/compare-method/bad-self-type.stderr | 16 | ||||
| -rw-r--r-- | src/test/ui/compare-method/reordered-type-param.stderr | 8 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/test/ui/compare-method/bad-self-type.stderr b/src/test/ui/compare-method/bad-self-type.stderr index 737a5ae2656..90e907157a5 100644 --- a/src/test/ui/compare-method/bad-self-type.stderr +++ b/src/test/ui/compare-method/bad-self-type.stderr @@ -13,27 +13,31 @@ LL | fn poll(self, _: &mut Context<'_>) -> Poll<()> { error[E0053]: method `foo` has an incompatible type for trait --> $DIR/bad-self-type.rs:22:18 | -LL | fn foo(self); - | ---- type in trait -... LL | fn foo(self: Box<Self>) {} | ------^^^^^^^^^ | | | | | expected struct `MyFuture`, found struct `Box` | help: change the self-receiver type to match the trait: `self` | +note: type in trait + --> $DIR/bad-self-type.rs:17:12 + | +LL | fn foo(self); + | ^^^^ = note: expected fn pointer `fn(MyFuture)` found fn pointer `fn(Box<MyFuture>)` error[E0053]: method `bar` has an incompatible type for trait --> $DIR/bad-self-type.rs:24:18 | -LL | fn bar(self) -> Option<()>; - | ---------- type in trait -... LL | fn bar(self) {} | ^ expected enum `Option`, found `()` | +note: type in trait + --> $DIR/bad-self-type.rs:18:21 + | +LL | fn bar(self) -> Option<()>; + | ^^^^^^^^^^ = note: expected fn pointer `fn(MyFuture) -> Option<()>` found fn pointer `fn(MyFuture)` help: change the output type to match the trait diff --git a/src/test/ui/compare-method/reordered-type-param.stderr b/src/test/ui/compare-method/reordered-type-param.stderr index d581628ea48..49b5b1b92cd 100644 --- a/src/test/ui/compare-method/reordered-type-param.stderr +++ b/src/test/ui/compare-method/reordered-type-param.stderr @@ -1,9 +1,6 @@ error[E0053]: method `b` has an incompatible type for trait --> $DIR/reordered-type-param.rs:16:30 | -LL | fn b<C:Clone,D>(&self, x: C) -> C; - | - type in trait -... LL | fn b<F:Clone,G>(&self, _x: G) -> G { panic!() } | - - ^ | | | | @@ -12,6 +9,11 @@ LL | fn b<F:Clone,G>(&self, _x: G) -> G { panic!() } | | found type parameter | expected type parameter | +note: type in trait + --> $DIR/reordered-type-param.rs:7:29 + | +LL | fn b<C:Clone,D>(&self, x: C) -> C; + | ^ = note: expected fn pointer `fn(&E, F) -> F` found fn pointer `fn(&E, G) -> G` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound |
