Skip to content

Commit ef7062d

Browse files
committed
Add test to make sure we run custom destructors
1 parent 48e7f24 commit ef7062d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// run-pass
2+
// check-run-results
3+
#![feature(async_fn_in_traits)]
4+
5+
use std::fmt::Debug;
6+
7+
#[derive(Debug)]
8+
struct Foo(usize);
9+
10+
impl Drop for Foo {
11+
fn drop(&mut self) {
12+
println!("destructor called");
13+
}
14+
}
15+
16+
fn make_dyn_star(i: Foo) {
17+
let _dyn_i: dyn* Debug = i as dyn* Debug;
18+
}
19+
20+
fn main() {
21+
make_dyn_star(Foo(42));
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
destructor called

0 commit comments

Comments
 (0)