]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/unsized.rs
Imported Upstream version 1.0.0~beta.3
[rustc.git] / src / test / run-pass / unsized.rs
CommitLineData
1a4d82fc
JJ
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.
4//
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.
1a4d82fc
JJ
10
11// Test syntax checks for `?Sized` syntax.
12
c34b1796
AL
13// pretty-expanded FIXME #23616
14
9346a6ac 15use std::marker::PhantomData;
85aaf69f 16
9346a6ac
AL
17trait T1 { }
18pub trait T2 { }
19trait T3<X: T1> : T2 { }
20trait T4<X: ?Sized> { }
21trait T5<X: ?Sized, Y> { }
22trait T6<Y, X: ?Sized> { }
23trait T7<X: ?Sized, Y: ?Sized> { }
24trait T8<X: ?Sized+T2> { }
25trait T9<X: T2 + ?Sized> { }
85aaf69f
SL
26struct S1<X: ?Sized>(PhantomData<X>);
27enum E<X: ?Sized> { E1(PhantomData<X>) }
1a4d82fc
JJ
28impl <X: ?Sized> T1 for S1<X> {}
29fn f<X: ?Sized>() {}
30type TT<T: ?Sized> = T;
31
32pub fn main() {
33}