Created
October 2, 2019 14:05
-
-
Save pnkfelix/425ddc19aa968bbc36b8cb46fab7d15d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(core_panic)] | |
#![no_std] | |
extern crate std; | |
struct Droppable; | |
impl Drop for Droppable { | |
fn drop(&mut self) { | |
let msg = "Dropping a Droppable\n"; | |
extern "C" { fn putchar(b: u8); } | |
for c in msg.chars() { | |
unsafe { putchar(c as u8); } | |
} | |
} | |
} | |
fn main() { | |
let _guard = Droppable; | |
core::panicking::panic(&("???", "downstream.rs", 17, 4)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment