mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
parent
19310ce2cc
commit
445507a19d
6
tests/ui/consts/ice-bad-input-type-for-cast-83056.rs
Normal file
6
tests/ui/consts/ice-bad-input-type-for-cast-83056.rs
Normal file
@ -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() {}
|
20
tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr
Normal file
20
tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user