1 #![allow(unconditional_recursion)]
3 #![allow(unused_variables)]
4 #![allow(unused_imports)]
5 #![feature(box_syntax)]
7 // Test sized-ness checking in substitution.
12 fn f1<X: ?Sized>(x: &X) {
21 trait T { fn dummy(&self) { } }
22 fn f3<X: T+?Sized>(x: &X) {
40 fn f5<X: ?Sized+T2>(x: &X) {
41 let _: Box<X> = T2::f();
44 let _: Box<X> = T2::f();
55 fn f7<X: ?Sized+T3>(x: &X) {
56 // This is valid, but the unsized bound on X is irrelevant because any type
57 // which implements T3 must have statically known size.
58 let _: Box<X> = T3::f();
63 fn m1(&self, x: &T4<X>, y: X);
64 fn m2(&self, x: &T5<X>, y: X);
68 // not an error (for now)
69 fn m1(&self, x: &T4<X>);
70 fn m2(&self, x: &T5<X>);
75 fn m1(&self, x: &T4<X>);
76 fn m2(&self, x: &T5<X>);
78 trait T7<X: ?Sized+T> {
80 // not an error (for now)
81 fn m1(&self, x: &T4<X>);
82 fn m2(&self, x: &T5<X>);
85 // The last field in a struct may be unsized
86 struct S2<X: ?Sized> {
89 struct S3<X: ?Sized> {