1
Fork 0

Rename HIR TypeBinding to AssocItemConstraint and related cleanup

This commit is contained in:
León Orell Valerian Liehr 2024-05-27 23:53:46 +02:00
parent 0a59f11362
commit 34c56c45cf
No known key found for this signature in database
GPG key ID: D17A07215F68E713
108 changed files with 878 additions and 818 deletions

View file

@ -1,5 +1,4 @@
An associated type binding was done outside of the type parameter declaration
and `where` clause.
An associated item constraint was written in an unexpected context.
Erroneous code example:
@ -16,12 +15,12 @@ impl Foo for isize {
fn boo(&self) -> usize { 42 }
}
fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
// error: associated type bindings are not allowed here
fn baz<I>(x: &<I as Foo<A = Bar>>::A) {}
// error: associated item constraint are not allowed here
```
To solve this error, please move the type bindings in the type parameter
declaration:
To solve this error, please move the associated item constraints to the type
parameter declaration:
```
# struct Bar;
@ -29,7 +28,7 @@ declaration:
fn baz<I: Foo<A=Bar>>(x: &<I as Foo>::A) {} // ok!
```
Or in the `where` clause:
Or into the where-clause:
```
# struct Bar;