os-rust/tests/ui/impl-trait/unsize_adt.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
289 B
Rust
Raw Normal View History

2024-05-23 15:46:56 +00:00
//! Test that we do not allow unsizing `Foo<[Opaque; N]>` to `Foo<[Concrete]>`.
struct Foo<T: ?Sized>(T);
fn hello() -> Foo<[impl Sized; 2]> {
if false {
let x = hello();
let _: &Foo<[i32]> = &x;
//~^ ERROR: mismatched types
}
todo!()
}
fn main() {}