File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ // this closure is fine, and should not get any error annotations
3+ let em = |v : f64 | -> f64 { v } ;
4+
5+ let x: f64 = em ( 1i16 . into ( ) ) ;
6+
7+ let y: f64 = 0.01f64 * 1i16 . into ( ) ;
8+ //~^ ERROR type annotations needed
9+ //~| HELP try using a fully qualified path
10+ }
Original file line number Diff line number Diff line change 1+ error[E0284]: type annotations needed
2+ --> $DIR/issue-70082.rs:7:33
3+ |
4+ LL | let y: f64 = 0.01f64 * 1i16.into();
5+ | - ^^^^
6+ | |
7+ | type must be known at this point
8+ |
9+ = note: cannot satisfy `<f64 as Mul<_>>::Output == f64`
10+ help: try using a fully qualified path to specify the expected types
11+ |
12+ LL | let y: f64 = 0.01f64 * <i16 as Into<T>>::into(1i16);
13+ | +++++++++++++++++++++++ ~
14+
15+ error: aborting due to previous error
16+
17+ For more information about this error, try `rustc --explain E0284`.
You can’t perform that action at this time.
0 commit comments