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` local variables.
15 fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
16 let _: W; // <-- this is OK, no bindings created, no initializer.
17 let _: (isize, (X, isize));
18 //~^ ERROR the size for values of type
20 //~^ ERROR the size for values of type
21 let y: (isize, (Z, usize));
22 //~^ ERROR the size for values of type
24 fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
26 //~^ ERROR the size for values of type
27 let y: (isize, (Y, isize));
28 //~^ ERROR the size for values of type
31 fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
33 //~^ ERROR the size for values of type
35 //~^ ERROR the size for values of type
36 let (y, z) = (*x3, 4);
37 //~^ ERROR the size for values of type
39 fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
41 //~^ ERROR the size for values of type
43 //~^ ERROR the size for values of type
44 let (y, z) = (*x3, 4);
45 //~^ ERROR the size for values of type
48 fn g1<X: ?Sized>(x: X) {}
49 //~^ ERROR the size for values of type
50 fn g2<X: ?Sized + T>(x: X) {}
51 //~^ ERROR the size for values of type