summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dyn-star/drop.rs
blob: 46b232f3dd39996108697efe8476522100d7e379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// run-pass
// check-run-results
#![feature(dyn_star)]
#![allow(incomplete_features)]

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));
}