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 // Test sized-ness checking in substitution within fn bodies..
15 fn f1<Sized? X>(x: &X) {
17 //~^ ERROR the trait `core::kinds::Sized` is not implemented
24 fn f3<Sized? X: T>(x: &X) {
26 //~^ ERROR the trait `core::kinds::Sized` is not implemented
31 // Test with unsized enum.
37 fn f6<Sized? X>(x: &X) {}
38 fn f7<Sized? X>(x1: &E<X>, x2: &E<X>) {
40 //~^ ERROR the trait `core::kinds::Sized` is not implemented
45 // Test with unsized struct.
50 fn f8<Sized? X>(x1: &S<X>, x2: &S<X>) {
52 //~^ ERROR the trait `core::kinds::Sized` is not implemented
57 fn f9<Sized? X>(x1: Box<S<X>>, x2: Box<E<X>>) {
59 //~^ ERROR the trait `core::kinds::Sized` is not implemented
61 //~^ ERROR the trait `core::kinds::Sized` is not implemented