summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs-enums/struct-literal-dtor.rs
blob: 6d1b1dfb9b6c7c8e87a2b4fa22dbecb781c4638a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// run-pass
#![allow(non_camel_case_types)]

struct foo {
    x: String,
}

impl Drop for foo {
    fn drop(&mut self) {
        println!("{}", self.x);
    }
}

pub fn main() {
    let _z = foo {
        x: "Hello".to_string()
    };
}