about summary refs log tree commit diff
path: root/tests/ui/associated-consts
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-09 22:11:20 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-07-17 21:30:40 +0000
commite38032fb3ad5736934ea1ff1ecc43e8af4c47a87 (patch)
tree72c61d8a1443f43cc1b63ef765f997320b6a66e0 /tests/ui/associated-consts
parent032be6f7bbe091c7dfa29f115e94b9cc9bae1758 (diff)
downloadrust-e38032fb3ad5736934ea1ff1ecc43e8af4c47a87.tar.gz
rust-e38032fb3ad5736934ea1ff1ecc43e8af4c47a87.zip
Fix associated item removal suggestion
We were previously telling people to write what was already there, instead of removal.

```
error[E0229]: associated item constraints are not allowed here
  --> $DIR/E0229.rs:13:25
   |
LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
   |                         ^^^^^^^ associated item constraint not allowed here
   |
help: consider removing this associated item binding
   |
LL - fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
LL + fn baz<I>(x: &<I as Foo>::A) {}
   |
```
Diffstat (limited to 'tests/ui/associated-consts')
-rw-r--r--tests/ui/associated-consts/issue-102335-const.stderr10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/ui/associated-consts/issue-102335-const.stderr b/tests/ui/associated-consts/issue-102335-const.stderr
index dc1631220e2..cf96c8cf8eb 100644
--- a/tests/ui/associated-consts/issue-102335-const.stderr
+++ b/tests/ui/associated-consts/issue-102335-const.stderr
@@ -6,8 +6,9 @@ LL |     type A: S<C<X = 0i32> = 34>;
    |
 help: consider removing this associated item binding
    |
-LL |     type A: S<C<X = 0i32> = 34>;
-   |                ~~~~~~~~~~
+LL -     type A: S<C<X = 0i32> = 34>;
+LL +     type A: S<C = 34>;
+   |
 
 error[E0229]: associated item constraints are not allowed here
   --> $DIR/issue-102335-const.rs:4:17
@@ -18,8 +19,9 @@ LL |     type A: S<C<X = 0i32> = 34>;
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 help: consider removing this associated item binding
    |
-LL |     type A: S<C<X = 0i32> = 34>;
-   |                ~~~~~~~~~~
+LL -     type A: S<C<X = 0i32> = 34>;
+LL +     type A: S<C = 34>;
+   |
 
 error: aborting due to 2 previous errors