Skip to content

Commit

Permalink
Failing test for computing drop shim that has const param
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jun 28, 2024
1 parent 99f77a2 commit 90c2b23
Show file tree
Hide file tree
Showing 2 changed files with 278 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/ui/const-generics/polymorphic-drop-shim.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ compile-flags: -Zinline-mir=yes --crate-type=lib

//@ known-bug: unknown
//@ build-fail
//@ failure-status: 101

use std::mem::ManuallyDrop;

pub struct Foo<T, const N: usize>([T; N]);

pub struct Dorp {}

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

#[inline]
// SAFETY: call this with a valid allocation idk
pub unsafe fn drop<const M: usize>(x: *mut Foo<Dorp, M>) {
std::ptr::drop_in_place(x);
}
Loading

0 comments on commit 90c2b23

Please sign in to comment.