1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-lexer-test FIXME #15879
13 #![allow(unknown_features)]
14 #![feature(box_syntax)]
16 // Test sized-ness checking in substitution.
21 fn f1<X: ?Sized>(x: &X) {
30 trait T { fn dummy(&self) { } }
31 fn f3<X: T+?Sized>(x: &X) {
49 fn f5<X: ?Sized+T2>(x: &X) {
50 let _: Box<X> = T2::f();
53 let _: Box<X> = T2::f();
64 fn f7<X: ?Sized+T3>(x: &X) {
65 // This is valid, but the unsized bound on X is irrelevant because any type
66 // which implements T3 must have statically known size.
67 let _: Box<X> = T3::f();
72 fn m1(x: &T4<X>, y: X);
73 fn m2(x: &T5<X>, y: X);
77 // not an error (for now)
87 trait T7<X: ?Sized+T> {
89 // not an error (for now)
94 // The last field in a struct or variant may be unsized
95 struct S2<X: ?Sized> {
98 struct S3<X: ?Sized> {