]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0667.md
Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0667.md
1 `impl Trait` is not allowed in path parameters.
2
3 Erroneous code example:
4
5 ```compile_fail,E0667
6 fn some_fn(mut x: impl Iterator) -> <impl Iterator>::Item { // error!
7     x.next().unwrap()
8 }
9 ```
10
11 You cannot use `impl Trait` in path parameters. If you want something
12 equivalent, you can do this instead:
13
14 ```
15 fn some_fn<T: Iterator>(mut x: T) -> T::Item { // ok!
16     x.next().unwrap()
17 }
18 ```