about summary refs log tree commit diff
path: root/tests/ui/structs-enums/struct-literal-dtor.rs
blob: 30b1f1139389d313778860001ad572a59188220a (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()
    };
}