forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failing test for computing drop shim that has const param
- Loading branch information
1 parent
99f77a2
commit 90c2b23
Showing
2 changed files
with
278 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.