Skip to content

Instantly share code, notes, and snippets.

@timothycrosley
Created May 12, 2016 23:21
Show Gist options
  • Save timothycrosley/41cde47aa46a922d9a52397e4cb0603d to your computer and use it in GitHub Desktop.
Save timothycrosley/41cde47aa46a922d9a52397e4cb0603d to your computer and use it in GitHub Desktop.
fn main() {
let x = the_world_is_not_safe();
}
unsafe fn the_world_is_not_safe() -> String {
String::from("Hello, world!")
}
@ranweiler
Copy link

This will compile if you do:

fn main() {
    let x = unsafe { the_world_is_not_safe() };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment