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 // Test sized-ness checking in substitution.
16 fn f1<X: ?Sized>(x: &X) {
26 fn f3<X: T+?Sized>(x: &X) {
44 fn f5<X: ?Sized+T2>(x: &X) {
45 let _: Box<X> = T2::f();
48 let _: Box<X> = T2::f();
59 fn f7<X: ?Sized+T3>(x: &X) {
60 // This is valid, but the unsized bound on X is irrelevant because any type
61 // which implements T3 must have statically known size.
62 let _: Box<X> = T3::f();
70 // not an error (for now)
79 trait T7<X: ?Sized+T> {
80 // not an error (for now)
85 // The last field in a struct or variant may be unsized
86 struct S2<X: ?Sized> {
89 struct S3<X: ?Sized> {