3 #![allow(unconditional_recursion)]
5 #![allow(unused_variables)]
6 #![allow(unused_imports)]
7 #![feature(box_syntax)]
9 // Test sized-ness checking in substitution.
14 fn f1<X: ?Sized>(x: &X) {
23 trait T { fn dummy(&self) { } }
24 fn f3<X: T+?Sized>(x: &X) {
42 fn f5<X: ?Sized+T2>(x: &X) {
43 let _: Box<X> = T2::f();
46 let _: Box<X> = T2::f();
57 fn f7<X: ?Sized+T3>(x: &X) {
58 // This is valid, but the unsized bound on X is irrelevant because any type
59 // which implements T3 must have statically known size.
60 let _: Box<X> = T3::f();
65 fn m1(&self, x: &dyn T4<X>, y: X);
66 fn m2(&self, x: &dyn T5<X>, y: X);
70 // not an error (for now)
71 fn m1(&self, x: &dyn T4<X>);
72 fn m2(&self, x: &dyn T5<X>);
77 fn m1(&self, x: &dyn T4<X>);
78 fn m2(&self, x: &dyn T5<X>);
80 trait T7<X: ?Sized+T> {
82 // not an error (for now)
83 fn m1(&self, x: &dyn T4<X>);
84 fn m2(&self, x: &dyn T5<X>);
87 // The last field in a struct may be unsized
88 struct S2<X: ?Sized> {
91 struct S3<X: ?Sized> {