Add regression test for #90770

This commit is contained in:
Dylan MacKenzie 2021-12-01 10:04:21 -08:00
parent 9aaca1d38e
commit 37fa925525
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// check-fail
#![feature(const_precise_live_drops)]
struct S;
impl Drop for S {
fn drop(&mut self) {
println!("Hello!");
}
}
const fn foo() {
let s = S; //~ destructor
}
fn main() {}

View File

@ -0,0 +1,9 @@
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/drop_zst.rs:14:9
|
LL | let s = S;
| ^ constant functions cannot evaluate destructors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0493`.