rust/tests/ui/unsized/unsized-enum.rs

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

12 lines
281 B
Rust
Raw Normal View History

fn is_sized<T:Sized>() { }
2015-01-05 21:16:49 +00:00
fn not_sized<T: ?Sized>() { }
enum Foo<U> { FooSome(U), FooNone }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
2015-01-05 21:16:49 +00:00
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
2018-07-10 21:10:13 +00:00
//~^ ERROR the size for values of type
//
// Not OK: `T` is not sized.
2013-05-31 01:40:55 +00:00
fn main() { }