]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
Auto merge of #100705 - compiler-errors:issue-100620, r=oli-obk
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / tilde-const-invalid-places.rs
1 #![feature(const_trait_impl)]
2 #![feature(associated_type_bounds)]
3
4 trait T {}
5 struct S;
6 impl T for S {}
7
8 fn rpit() -> impl ~const T { S }
9 //~^ ERROR `~const` is not allowed
10
11 fn apit(_: impl ~const T) {}
12 //~^ ERROR `~const` is not allowed
13
14 fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
15 //~^ ERROR `~const` is not allowed
16
17 fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
18 //~^ ERROR `~const` is not allowed
19
20 fn generic<P: ~const T>() {}
21 //~^ ERROR `~const` is not allowed
22
23 fn where_clause<P>() where P: ~const T {}
24 //~^ ERROR `~const` is not allowed
25
26 struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
27 //~^ ERROR `~const` and `?` are mutually exclusive
28
29 fn main() {}