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