]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-block-const-bound.rs
Improve selection errors for `~const` trait bounds
[rust.git] / src / test / ui / consts / const-block-const-bound.rs
1 #![allow(unused)]
2 #![feature(const_fn_trait_bound, const_trait_impl, inline_const, negative_impls)]
3
4 const fn f<T: ~const Drop>(x: T) {}
5
6 struct UnconstDrop;
7
8 impl Drop for UnconstDrop {
9     fn drop(&mut self) {}
10 }
11
12 struct NonDrop;
13
14 impl !Drop for NonDrop {}
15
16 fn main() {
17     const {
18         f(UnconstDrop);
19         //~^ ERROR the trait bound `UnconstDrop: ~const Drop` is not satisfied
20         f(NonDrop);
21         //~^ ERROR the trait bound `NonDrop: ~const Drop` is not satisfied
22     }
23 }