@@ -6,9 +6,8 @@ LL | let x = 2.0.neg();
66 |
77help: you must specify a concrete type for this numeric value, like `f32`
88 |
9- LL - let x = 2.0.neg();
10- LL + let x = 2.0_f32.neg();
11- |
9+ LL | let x = 2.0_f32.neg();
10+ | ++++
1211
1312error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
1413 --> $DIR/method-on-ambiguous-numeric-type.rs:17:15
@@ -18,19 +17,30 @@ LL | let x = y.neg();
1817 |
1918help: you must specify a type for this binding, like `f32`
2019 |
20+ LL | let y: f32 = 2.;
21+ | +++++
22+
23+ error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
24+ --> $DIR/method-on-ambiguous-numeric-type.rs:22:15
25+ |
26+ LL | let x = y.neg();
27+ | ^^^
28+ |
29+ help: you must specify a type for this binding, like `f32`
30+ |
2131LL | let y: f32 = 2.0;
2232 | +++++
2333
2434error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
25- --> $DIR/method-on-ambiguous-numeric-type.rs:22 :26
35+ --> $DIR/method-on-ambiguous-numeric-type.rs:27 :26
2636 |
2737LL | for i in 0..100 {
2838 | - you must specify a type for this binding, like `i32`
2939LL | println!("{}", i.pow(2));
3040 | ^^^
3141
3242error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
33- --> $DIR/method-on-ambiguous-numeric-type.rs:27 :15
43+ --> $DIR/method-on-ambiguous-numeric-type.rs:32 :15
3444 |
3545LL | local_bar.pow(2);
3646 | ^^^
@@ -41,7 +51,7 @@ LL | ($ident:ident) => { let $ident: i32 = 42; }
4151 | +++++
4252
4353error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
44- --> $DIR/method-on-ambiguous-numeric-type.rs:31 :18
54+ --> $DIR/method-on-ambiguous-numeric-type.rs:36 :18
4555 |
4656LL | local_bar_tt.pow(2);
4757 | ^^^
@@ -52,7 +62,7 @@ LL | local_mac_tt!(local_bar_tt: i32);
5262 | +++++
5363
5464error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
55- --> $DIR/method-on-ambiguous-numeric-type.rs:37 :9
65+ --> $DIR/method-on-ambiguous-numeric-type.rs:42 :9
5666 |
5767LL | bar.pow(2);
5868 | ^^^
@@ -63,6 +73,6 @@ help: you must specify a type for this binding, like `i32`
6373LL | ($ident:ident) => { let $ident: i32 = 42; }
6474 | +++++
6575
66- error: aborting due to 6 previous errors
76+ error: aborting due to 7 previous errors
6777
6878For more information about this error, try `rustc --explain E0689`.
0 commit comments