]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
Rollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-se
[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 #[const_trait]
5 trait T {}
6 struct S;
7 impl T for S {}
8
9 fn rpit() -> impl ~const T { S }
10 //~^ ERROR `~const` is not allowed
11
12 fn apit(_: impl ~const T) {}
13 //~^ ERROR `~const` is not allowed
14
15 fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
16 //~^ ERROR `~const` is not allowed
17
18 fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
19 //~^ ERROR `~const` is not allowed
20
21 struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
22 //~^ ERROR `~const` and `?` are mutually exclusive
23
24 fn main() {}