summary refs log tree commit diff
path: root/src/test/ui/consts/const-block-const-bound.rs
blob: f3c82c5f96816280de4c0de4e239561b3f5c9bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![allow(unused)]
#![feature(const_fn_trait_bound, const_trait_impl, inline_const, negative_impls)]

const fn f<T: ~const Drop>(x: T) {}

struct UnconstDrop;

impl Drop for UnconstDrop {
    fn drop(&mut self) {}
}

struct NonDrop;

impl !Drop for NonDrop {}

fn main() {
    const {
        f(UnconstDrop);
        //~^ ERROR the trait bound `UnconstDrop: ~const Drop` is not satisfied
        f(NonDrop);
        //~^ ERROR the trait bound `NonDrop: ~const Drop` is not satisfied
    }
}