diff options
| author | Esteban Kuber <esteban@kuber.com.ar> | 2021-12-11 02:20:41 +0000 |
|---|---|---|
| committer | Esteban Kuber <esteban@kuber.com.ar> | 2021-12-11 02:32:15 +0000 |
| commit | 5e1972eba7e95e68f6fc05b07dec15fb1e553e1b (patch) | |
| tree | fd01764b7ebb5b4c0f952c4fbce21d2a48b1d0e1 /src/test/ui/compare-method | |
| parent | f0448f44bcda55fd9eb71da82495ef648eedb4e4 (diff) | |
| download | rust-5e1972eba7e95e68f6fc05b07dec15fb1e553e1b.tar.gz rust-5e1972eba7e95e68f6fc05b07dec15fb1e553e1b.zip | |
Tweak assoc type obligation spans
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
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 |
