Skip to content

Commit 445507a

Browse files
committed
add test for ice 83056 "bad input type for cast"
Fixes #83056
1 parent 19310ce commit 445507a

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// #83056 ICE "bad input type for cast"
2+
3+
struct S([bool; f as usize]);
4+
fn f() -> T {}
5+
//~^ ERROR cannot find type `T` in this scope
6+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0412]: cannot find type `T` in this scope
2+
--> $DIR/ice-bad-input-type-for-cast-83056.rs:4:11
3+
|
4+
LL | struct S([bool; f as usize]);
5+
| ----------------------------- similarly named struct `S` defined here
6+
LL | fn f() -> T {}
7+
| ^
8+
|
9+
help: a struct with a similar name exists
10+
|
11+
LL | fn f() -> S {}
12+
| ~
13+
help: you might be missing a type parameter
14+
|
15+
LL | fn f<T>() -> T {}
16+
| +++
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0412`.

0 commit comments

Comments
 (0)