3 #![allow(unconditional_recursion)]
5 #![allow(unused_variables)]
6 #![allow(unused_imports)]
8 // Test sized-ness checking in substitution.
13 fn f1<X: ?Sized>(x: &X) {
22 trait T { fn dummy(&self) { } }
23 fn f3<X: T+?Sized>(x: &X) {
41 fn f5<X: ?Sized+T2>(x: &X) {
42 let _: Box<X> = T2::f();
45 let _: Box<X> = T2::f();
56 fn f7<X: ?Sized+T3>(x: &X) {
57 // This is valid, but the unsized bound on X is irrelevant because any type
58 // which implements T3 must have statically known size.
59 let _: Box<X> = T3::f();
64 fn m1(&self, x: &dyn T4<X>, y: X);
65 fn m2(&self, x: &dyn T5<X>, y: X);
69 // not an error (for now)
70 fn m1(&self, x: &dyn T4<X>);
71 fn m2(&self, x: &dyn T5<X>);
76 fn m1(&self, x: &dyn T4<X>);
77 fn m2(&self, x: &dyn T5<X>);
79 trait T7<X: ?Sized+T> {
81 // not an error (for now)
82 fn m1(&self, x: &dyn T4<X>);
83 fn m2(&self, x: &dyn T5<X>);
86 // The last field in a struct may be unsized
87 struct S2<X: ?Sized> {
90 struct S3<X: ?Sized> {