Skip to content

Commit 90c2b23

Browse files
Failing test for computing drop shim that has const param
1 parent 99f77a2 commit 90c2b23

File tree

2 files changed

+278
-0
lines changed

2 files changed

+278
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ compile-flags: -Zinline-mir=yes --crate-type=lib
2+
3+
//@ known-bug: unknown
4+
//@ build-fail
5+
//@ failure-status: 101
6+
7+
use std::mem::ManuallyDrop;
8+
9+
pub struct Foo<T, const N: usize>([T; N]);
10+
11+
pub struct Dorp {}
12+
13+
impl Drop for Dorp {
14+
fn drop(&mut self) {}
15+
}
16+
17+
#[inline]
18+
// SAFETY: call this with a valid allocation idk
19+
pub unsafe fn drop<const M: usize>(x: *mut Foo<Dorp, M>) {
20+
std::ptr::drop_in_place(x);
21+
}

0 commit comments

Comments
 (0)