rust/tests/ui/trait-bounds/ice-unsized-struct-arg-issue-121612.rs
Gurinder Singh b1f4657fe9 Add missing regression tests
for a couple of issues
2024-03-09 12:01:19 +05:30

14 lines
502 B
Rust

// Regression test for issue #121612
trait Trait {}
impl Trait for bool {}
struct MySlice<T: FnOnce(&T, Idx) -> Idx>(bool, T);
//~^ ERROR cannot find type `Idx` in this scope
//~| ERROR cannot find type `Idx` in this scope
type MySliceBool = MySlice<[bool]>;
const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]);
//~^ ERROR the size for values of type `[bool]` cannot be known at compilation time
//~| ERROR the size for values of type `[bool]` cannot be known at compilation time
fn main() {}