Skip to content

Commit 7a9ab3f

Browse files
Move and rename the clone-never.rs test
1 parent 0469a92 commit 7a9ab3f

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//! regression test for issue #2151
2+
3+
fn main() {
4+
let x = panic!(); //~ ERROR type annotations needed
5+
x.clone();
6+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/never-type-inference-fail.rs:4:9
3+
|
4+
LL | let x = panic!();
5+
| ^
6+
LL | x.clone();
7+
| - type must be known at this point
8+
|
9+
help: consider giving `x` an explicit type
10+
|
11+
LL | let x: /* Type */ = panic!();
12+
| ++++++++++++
13+
14+
error: aborting due to 1 previous error
15+
16+
For more information about this error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)