This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/rustc_error_codes/src Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,7 @@ E0663: include_str!("./error_codes/E0663.md"),
394394E0664 : include_str!( "./error_codes/E0664.md" ) ,
395395E0665 : include_str!( "./error_codes/E0665.md" ) ,
396396E0666 : include_str!( "./error_codes/E0666.md" ) ,
397+ E0667 : include_str!( "./error_codes/E0667.md" ) ,
397398E0668 : include_str!( "./error_codes/E0668.md" ) ,
398399E0669 : include_str!( "./error_codes/E0669.md" ) ,
399400E0670 : include_str!( "./error_codes/E0670.md" ) ,
@@ -633,7 +634,6 @@ E0787: include_str!("./error_codes/E0787.md"),
633634 // attribute
634635 E0640 , // infer outlives requirements
635636// E0645, // trait aliases not finished
636- E0667 , // `impl Trait` in projections
637637// E0694, // an unknown tool name found in scoped attributes
638638// E0702, // replaced with a generic attribute input check
639639// E0707, // multiple elided lifetimes used in arguments of `async fn`
Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments