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.
19 fn f1<X: ?Sized>(x: &X) {
29 fn f3<X: T+?Sized>(x: &X) {
47 fn f5<X: ?Sized+T2>(x: &X) {
48 let _: Box<X> = T2::f();
51 let _: Box<X> = T2::f();
62 fn f7<X: ?Sized+T3>(x: &X) {
63 // This is valid, but the unsized bound on X is irrelevant because any type
64 // which implements T3 must have statically known size.
65 let _: Box<X> = T3::f();
73 // not an error (for now)
82 trait T7<X: ?Sized+T> {
83 // not an error (for now)
88 // The last field in a struct or variant may be unsized
89 struct S2<X: ?Sized> {
92 struct S3<X: ?Sized> {