File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 1- This error indicates that the numeric value for the method being passed exists
2- but the type of the numeric value or binding could not be identified.
1+ A method was called on an ambiguous numeric type.
32
4- The error happens on numeric literals :
3+ Erroneous code example :
54
65``` compile_fail,E0689
7- 2.0.neg();
6+ 2.0.neg(); // error!
87```
98
10- and on numeric bindings without an identified concrete type:
9+ This error indicates that the numeric value for the method being passed exists
10+ but the type of the numeric value or binding could not be identified.
11+
12+ The error happens on numeric literals and on numeric bindings without an
13+ identified concrete type:
1114
1215``` compile_fail,E0689
1316let x = 2.0;
@@ -19,8 +22,8 @@ Because of this, you must give the numeric literal or binding a type:
1922```
2023use std::ops::Neg;
2124
22- let _ = 2.0_f32.neg();
25+ let _ = 2.0_f32.neg(); // ok!
2326let x: f32 = 2.0;
24- let _ = x.neg();
25- let _ = (2.0 as f32).neg();
27+ let _ = x.neg(); // ok!
28+ let _ = (2.0 as f32).neg(); // ok!
2629```
You can’t perform that action at this time.
0 commit comments