]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
5099ac24 1#![allow(unused)]
5e7ed085 2#![feature(const_trait_impl, inline_const, negative_impls)]
5099ac24 3
5e7ed085
FG
4use std::marker::Destruct;
5
6const fn f<T: ~const Destruct>(x: T) {}
5099ac24
FG
7
8struct UnconstDrop;
9
10impl Drop for UnconstDrop {
11 fn drop(&mut self) {}
12}
13
14struct NonDrop;
15
16impl !Drop for NonDrop {}
17
18fn main() {
19 const {
20 f(UnconstDrop);
5e7ed085 21 //~^ ERROR can't drop
5099ac24 22 f(NonDrop);
5e7ed085 23 //~^ ERROR can't drop
5099ac24
FG
24 }
25}