]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/maybe-bounds-where.rs
Rollup merge of #103163 - SUPERCILEX:uninit-array-assume2, r=scottmcm
[rust.git] / src / test / ui / unsized / 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 //~| WARN default bound relaxed for a type parameter
15
16 struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized;
17 //~^ ERROR type parameter has more than one relaxed default bound
18 //~| WARN default bound relaxed for a type parameter
19
20 impl<T> S1<T> {
21     fn f() where T: ?Sized {}
22     //~^ ERROR `?Trait` bounds are only permitted at the point where a type parameter is declared
23 }
24
25 fn main() {
26     let u = vec![1, 2, 3];
27     let _s: S5<[u8]> = S5(&u[..]); // OK
28 }