blob: 943cf5ee1e57439990065dcbb2ef7b9e135413b9 [file]
// { dg-output "d\r*\nd\r*\nd\r*\n" }
// { dg-additional-options "-w" }
#![feature(no_core)]
#![feature(lang_items)]
#![no_core]
extern "C" {
fn printf(s: *const i8, ...);
}
#[lang = "sized"]
pub trait Sized {}
#[lang = "drop"]
pub trait Drop {
fn drop(&mut self);
}
struct Droppable;
impl Drop for Droppable {
fn drop(&mut self) {
let msg = "d\n\0" as *const str as *const i8;
unsafe {
printf(msg);
}
}
}
fn main() -> i32 {
{
let _x = Droppable;
}
{
let x = Droppable;
}
{
let mut x = Droppable;
}
0
}