Skip to content

Commit 1bfbac7

Browse files
committed
diagnostics: add test case for already-solved issue
Fixes #70082
1 parent 666fee2 commit 1bfbac7

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/ui/inference/issue-70082.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
}

tests/ui/inference/issue-70082.stderr

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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`.

0 commit comments

Comments
 (0)