mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Add test to make sure we run custom destructors
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// run-pass
|
||||
// check-run-results
|
||||
#![feature(async_fn_in_traits)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Foo(usize);
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&mut self) {
|
||||
println!("destructor called");
|
||||
}
|
||||
}
|
||||
|
||||
fn make_dyn_star(i: Foo) {
|
||||
let _dyn_i: dyn* Debug = i as dyn* Debug;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
make_dyn_star(Foo(42));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
destructor called
|
||||
Reference in New Issue
Block a user