mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
24 lines
365 B
Rust
24 lines
365 B
Rust
//@ run-pass
|
|
//@ check-run-results
|
|
#![feature(dyn_star)]
|
|
#![allow(incomplete_features)]
|
|
|
|
use std::fmt::Debug;
|
|
|
|
#[derive(Debug)]
|
|
struct Foo(#[allow(dead_code)] usize);
|
|
|
|
impl Drop for Foo {
|
|
fn drop(&mut self) {
|
|
println!("destructor called");
|
|
}
|
|
}
|
|
|
|
fn make_dyn_star(i: Foo) {
|
|
let _dyn_i: dyn* Debug = i;
|
|
}
|
|
|
|
fn main() {
|
|
make_dyn_star(Foo(42));
|
|
}
|