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.
10 #![feature(struct_variant)]
12 // Test `type` types not allowed in fields or local variables.
16 fn f5<type X>(x: &X) {
17 let _: X; // ERROR local variable with dynamically sized type X
18 let _: (int, (X, int)); // ERROR local variable with dynamically sized type (int,(X,int))
20 fn f6<type X: T>(x: &X) {
21 let _: X; // ERROR local variable with dynamically sized type X
22 let _: (int, (X, int)); // ERROR local variable with dynamically sized type (int,(X,int))
26 f1: X, //~ ERROR type `f1` is dynamically sized. dynamically sized types may only appear as the
31 g: X, //~ ERROR type `g` is dynamically sized. dynamically sized types may only appear as the ty
36 V1(X, int), //~ERROR type `X` is dynamically sized. dynamically sized types may only appear as t
37 V2{f1: X, f: int}, //~ERROR type `f1` is dynamically sized. dynamically sized types may only app