diff --git a/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs b/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs new file mode 100644 index 0000000000000..ea0aba2c91160 --- /dev/null +++ b/tests/ui/consts/ice-bad-input-type-for-cast-83056.rs @@ -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() {} diff --git a/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr b/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr new file mode 100644 index 0000000000000..4764f49cf464a --- /dev/null +++ b/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr @@ -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 {} + | +++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0412`.