rust/tests/ui/associated-type-bounds
Matthias Krüger a13d7dbecf
Rollup merge of #127878 - estebank:assoc-item-removal, r=fmease
Fix associated item removal suggestion

We were previously telling people to write what was already there, instead of removal (treating it as a `help`). We now properly suggest to remove the code that needs to be removed.

```
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) {}
   |
```
2024-07-18 08:09:01 +02:00
..
auxiliary Add a test 2024-03-22 13:20:54 -04:00
return-type-notation Put the dots back 2024-07-17 11:08:28 -04:00
ambiguous-associated-type2.rs
ambiguous-associated-type2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ambiguous-associated-type.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
assoc-type-bound-through-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
assoc-type-eq-with-dyn-atb-fail.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
assoc-type-eq-with-dyn-atb-fail.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
associated-item-through-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
bad-bounds-on-assoc-in-trait.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
bad-universal-in-dyn-in-where-clause.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
bad-universal-in-dyn-in-where-clause.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
bad-universal-in-impl-sig.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
bad-universal-in-impl-sig.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
binder-on-bound.rs
binder-on-bound.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
bounds-on-assoc-in-trait.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
cant-see-copy-bound-from-child-rigid-2.rs Add tests for shortcomings of associated type bounds 2024-03-21 10:34:53 -04:00
cant-see-copy-bound-from-child-rigid-2.stderr Add tests for shortcomings of associated type bounds 2024-03-21 10:34:53 -04:00
cant-see-copy-bound-from-child-rigid.rs Add tests for shortcomings of associated type bounds 2024-03-21 10:34:53 -04:00
cant-see-copy-bound-from-child-rigid.stderr Add tests for shortcomings of associated type bounds 2024-03-21 10:34:53 -04:00
const-projection-err.gce.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-projection-err.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-projection-err.stock.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
consts.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
consts.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
dedup-normalized-1.rs eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
dedup-normalized-2-higher-ranked.rs eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
dedup-normalized-2-higher-ranked.stderr eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
do-not-look-at-parent-item-in-suggestion-for-type-param-of-current-assoc-item.rs
do-not-look-at-parent-item-in-suggestion-for-type-param-of-current-assoc-item.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
dont-imply-atb-in-closure-inference.rs Split item bounds and item super predicates 2024-03-20 13:00:34 -04:00
duplicate.rs Bless test fallout (duplicate diagnostics) 2024-03-20 13:00:34 -04:00
duplicate.stderr Bless test fallout (duplicate diagnostics) 2024-03-20 13:00:34 -04:00
elision.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
elision.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
entails-sized-object-safety.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
enum-bounds.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
fn-apit.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
fn-aux.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
fn-inline.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
fn-where.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
fn-wrap-apit.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
handle-predicates-that-can-define-assoc-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
higher-ranked.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
hrtb.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
implied-bounds-cycle.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
implied-bounds-cycle.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
implied-in-supertrait.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
implied-predicates.rs Always encode implied_predicates query for traits 2024-03-22 13:20:54 -04:00
implied-region-constraints.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
implied-region-constraints.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
inside-adt.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
inside-adt.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-61752.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-70292.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-71443-1.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-71443-1.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-71443-2.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-73818.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-79949.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-81193.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-83017.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-99828.rs Bless test fallout (duplicate diagnostics) 2024-03-20 13:00:34 -04:00
issue-99828.stderr Bless test fallout (duplicate diagnostics) 2024-03-20 13:00:34 -04:00
issue-102335-ty.rs Rename HIR TypeBinding to AssocItemConstraint and related cleanup 2024-05-30 22:52:33 +02:00
issue-102335-ty.stderr Fix associated item removal suggestion 2024-07-17 21:30:40 +00:00
issue-104916.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
issue-104916.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
missing-trait-bound-for-assoc-fails.rs
missing-trait-bound-for-assoc-fails.stderr
nested-bounds-dont-eliminate-alias-bounds.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
no-gat-position.rs E0229: Suggest Moving Type Constraints to Type Parameter Declaration 2024-06-12 19:32:31 -04:00
no-gat-position.stderr Fix associated item removal suggestion 2024-07-17 21:30:40 +00:00
order-dependent-bounds-issue-54121.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
overlaping-bound-suggestion.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
overlaping-bound-suggestion.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
resolution-failure-building-vtable-representation-ice-90691.rs add issue numbers via // issue: rust-lang/rust#ISSUE_NUM directive 2024-03-24 09:34:11 +01:00
rpit.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
rpit.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
struct-bounds.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
suggest-assoc-ty-bound-on-eq-bound.rs Suggest assoc ty bound on bare dyn trait in eq constraint 2024-03-23 00:17:30 +01:00
suggest-assoc-ty-bound-on-eq-bound.stderr Suggest assoc ty bound on bare dyn trait in eq constraint 2024-03-23 00:17:30 +01:00
suggest-contraining-assoc-type-because-of-assoc-const.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
suggest-contraining-assoc-type-because-of-assoc-const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
suggest-contraining-assoc-type-because-of-assoc-const.stderr Update tests 2024-02-07 10:42:01 +08:00
suggest-removing-impl.rs
suggest-removing-impl.stderr
supertrait-defines-ty.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
supertrait-referencing-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-referencing.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-where-referencing-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-alias-impl-trait.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
trait-params.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
traits-assoc-anonymized.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
traits-assoc-type-macros.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-alias.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
type-alias.stderr Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
union-bounds.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00