]> git.lizzy.rs Git - rust.git/blob - src/test/ui/maybe-bounds-where.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / ui / maybe-bounds-where.rs
1 struct S1<T>(T) where (T): ?Sized;
2 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
3
4 struct S2<T>(T) where u8: ?Sized;
5 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
6
7 struct S3<T>(T) where &'static T: ?Sized;
8 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
9
10 trait Trait<'a> {}
11
12 struct S4<T>(T) where for<'a> T: ?Trait<'a>;
13 //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
14
15 struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized;
16 //~^ ERROR type parameter has more than one relaxed default bound
17 //~| WARN default bound relaxed for a type parameter
18
19 impl<T> S1<T> {
20     fn f() where T: ?Sized {}
21     //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
22 }
23
24 fn main() {
25     let u = vec![1, 2, 3];
26     let _s: S5<[u8]> = S5(&u[..]); // OK
27 }