File tree 3 files changed +27
-3
lines changed
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"),
361
361
E0627 : include_str!( "./error_codes/E0627.md" ) ,
362
362
E0628 : include_str!( "./error_codes/E0628.md" ) ,
363
363
E0631 : include_str!( "./error_codes/E0631.md" ) ,
364
+ E0632 : include_str!( "./error_codes/E0632.md" ) ,
364
365
E0633 : include_str!( "./error_codes/E0633.md" ) ,
365
366
E0634 : include_str!( "./error_codes/E0634.md" ) ,
366
367
E0635 : include_str!( "./error_codes/E0635.md" ) ,
@@ -623,8 +624,6 @@ E0783: include_str!("./error_codes/E0783.md"),
623
624
// E0629, // missing 'feature' (rustc_const_unstable)
624
625
// E0630, // rustc_const_unstable attribute must be paired with stable/unstable
625
626
// attribute
626
- E0632 , // cannot provide explicit generic arguments when `impl Trait` is
627
- // used in argument position
628
627
E0640 , // infer outlives requirements
629
628
// E0645, // trait aliases not finished
630
629
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! {
1084
1084
///
1085
1085
/// ### Explanation
1086
1086
///
1087
- /// An function with generics must have its symbol mangled to accommodate
1087
+ /// A function with generics must have its symbol mangled to accommodate
1088
1088
/// the generic parameter. The [`no_mangle` attribute] has no effect in
1089
1089
/// this situation, and should be removed.
1090
1090
///
You can’t perform that action at this time.
0 commit comments