File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,7 @@ E0626: include_str!("./error_codes/E0626.md"),
361361E0627 : include_str!( "./error_codes/E0627.md" ) ,
362362E0628 : include_str!( "./error_codes/E0628.md" ) ,
363363E0631 : include_str!( "./error_codes/E0631.md" ) ,
364+ E0632 : include_str!( "./error_codes/E0632.md" ) ,
364365E0633 : include_str!( "./error_codes/E0633.md" ) ,
365366E0634 : include_str!( "./error_codes/E0634.md" ) ,
366367E0635 : include_str!( "./error_codes/E0635.md" ) ,
@@ -623,8 +624,6 @@ E0783: include_str!("./error_codes/E0783.md"),
623624// E0629, // missing 'feature' (rustc_const_unstable)
624625// E0630, // rustc_const_unstable attribute must be paired with stable/unstable
625626 // attribute
626- E0632 , // cannot provide explicit generic arguments when `impl Trait` is
627- // used in argument position
628627 E0640 , // infer outlives requirements
629628// E0645, // trait aliases not finished
630629 E0667 , // `impl Trait` in projections
Original file line number Diff line number Diff line change 1+ An explicit generic argument was provided when calling a function that
2+ uses ` impl Trait ` in argument position.
3+
4+ Erroneous code example:
5+
6+ ``` compile_fail,E0632
7+ fn foo<T: Copy>(a: T, b: impl Clone) {}
8+
9+ foo::<i32>(0i32, "abc".to_string());
10+ ```
11+
12+ Either all generic arguments should be inferred at the call site, or
13+ the function definition should use an explicit generic type parameter
14+ instead of ` impl Trait ` . Example:
15+
16+ ```
17+ fn foo<T: Copy>(a: T, b: impl Clone) {}
18+ fn bar<T: Copy, U: Clone>(a: T, b: U) {}
19+
20+ foo(0i32, "abc".to_string());
21+
22+ bar::<i32, String>(0i32, "abc".to_string());
23+ bar::<_, _>(0i32, "abc".to_string());
24+ bar(0i32, "abc".to_string());
25+ ```
Original file line number Diff line number Diff line change @@ -1084,7 +1084,7 @@ declare_lint! {
10841084 ///
10851085 /// ### Explanation
10861086 ///
1087- /// An function with generics must have its symbol mangled to accommodate
1087+ /// A function with generics must have its symbol mangled to accommodate
10881088 /// the generic parameter. The [`no_mangle` attribute] has no effect in
10891089 /// this situation, and should be removed.
10901090 ///
You can’t perform that action at this time.
0 commit comments