1
Fork 0

Move an impl-Trait check from AST validation to AST lowering

This commit is contained in:
León Orell Valerian Liehr 2024-10-27 06:21:24 +01:00
parent 6faf0bd3e5
commit 442f39582d
No known key found for this signature in database
GPG key ID: D17A07215F68E713
13 changed files with 78 additions and 153 deletions

View file

@ -1,8 +1,10 @@
#### Note: this error code is no longer emitted by the compiler.
`impl Trait` is not allowed in path parameters.
Erroneous code example:
```compile_fail,E0667
```ignore (removed error code)
fn some_fn(mut x: impl Iterator) -> <impl Iterator>::Item { // error!
x.next().unwrap()
}
@ -11,7 +13,7 @@ fn some_fn(mut x: impl Iterator) -> <impl Iterator>::Item { // error!
You cannot use `impl Trait` in path parameters. If you want something
equivalent, you can do this instead:
```
```ignore (removed error code)
fn some_fn<T: Iterator>(mut x: T) -> T::Item { // ok!
x.next().unwrap()
}