2024-02-16 14:02:50 -06:00
|
|
|
//@ run-pass
|
|
|
|
//@ check-run-results
|
2022-08-29 14:02:03 -05:00
|
|
|
#![feature(dyn_star)]
|
2022-08-30 14:44:00 -05:00
|
|
|
#![allow(incomplete_features)]
|
2022-08-17 18:58:49 -05:00
|
|
|
|
|
|
|
use std::fmt::Debug;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
2023-12-27 16:11:58 -06:00
|
|
|
struct Foo(#[allow(dead_code)] usize);
|
2022-08-17 18:58:49 -05:00
|
|
|
|
|
|
|
impl Drop for Foo {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
println!("destructor called");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn make_dyn_star(i: Foo) {
|
2022-09-14 18:20:03 -05:00
|
|
|
let _dyn_i: dyn* Debug = i;
|
2022-08-17 18:58:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
make_dyn_star(Foo(42));
|
|
|
|
}
|