]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-block-const-bound.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / consts / const-block-const-bound.rs
1 #![allow(unused)]
2 #![feature(const_trait_impl, inline_const, negative_impls)]
3
4 use std::marker::Destruct;
5
6 const fn f<T: ~const Destruct>(x: T) {}
7
8 struct UnconstDrop;
9
10 impl Drop for UnconstDrop {
11 fn drop(&mut self) {}
12 }
13
14 struct NonDrop;
15
16 impl !Drop for NonDrop {}
17
18 fn main() {
19 const {
20 f(UnconstDrop);
21 //~^ ERROR can't drop
22 f(NonDrop);
23 //~^ ERROR can't drop
24 }
25 }