summaryrefslogtreecommitdiffstats
path: root/tests/ui/unsized/unsized-enum.rs
blob: 02ad1c878a40e16589a7ce1485d8043204d0401e (plain)
1
2
3
4
5
6
7
8
9
10
11
fn is_sized<T:Sized>() { }
fn not_sized<T: ?Sized>() { }

enum Foo<U> { FooSome(U), FooNone }
fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
//~^ ERROR the size for values of type
//
// Not OK: `T` is not sized.

fn main() { }