-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for ice 83056 "bad input type for cast"
Fixes #83056
- Loading branch information
1 parent
19310ce
commit 445507a
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// #83056 ICE "bad input type for cast" | ||
|
||
struct S([bool; f as usize]); | ||
fn f() -> T {} | ||
//~^ ERROR cannot find type `T` in this scope | ||
pub fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/ice-bad-input-type-for-cast-83056.rs:4:11 | ||
| | ||
LL | struct S([bool; f as usize]); | ||
| ----------------------------- similarly named struct `S` defined here | ||
LL | fn f() -> T {} | ||
| ^ | ||
| | ||
help: a struct with a similar name exists | ||
| | ||
LL | fn f() -> S {} | ||
| ~ | ||
help: you might be missing a type parameter | ||
| | ||
LL | fn f<T>() -> T {} | ||
| +++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |