-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9aaca1d
commit 37fa925
Showing
2 changed files
with
26 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,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() {} |
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,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`. |