]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/maybe-bounds-where.rs
1 // Copyright 2016 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 struct S1
<T
>(T
) where (T
): ?Sized
;
12 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
14 struct S2
<T
>(T
) where u8: ?Sized
;
15 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
17 struct S3
<T
>(T
) where &'
static T
: ?Sized
;
18 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
22 struct S4
<T
>(T
) where for<'a
> T
: ?Trait
<'a
>;
23 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
25 struct S5
<T
>(*const T
) where T
: ?Trait
<'
static> + ?Sized
;
26 //~^ ERROR type parameter has more than one relaxed default bound
27 //~| WARN default bound relaxed for a type parameter
30 fn f() where T
: ?Sized {}
31 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
35 let u
= vec
![1, 2, 3];
36 let _s
: S5
<[u8]> = S5(&u
[..]); // OK