From: Ralf Jung Date: Thu, 6 Aug 2015 16:35:30 +0000 (+0200) Subject: correct the comment on the unsafe powers X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/430c62a4f32989f1bf27967f70bbbd49f9d790fa?ds=sidebyside;hp=--cc correct the comment on the unsafe powers --- 430c62a4f32989f1bf27967f70bbbd49f9d790fa diff --git a/src/part16.rs b/src/part16.rs index f5735b8..3b0a1d0 100644 --- a/src/part16.rs +++ b/src/part16.rs @@ -59,8 +59,8 @@ pub struct LinkedList { //@ We declare `raw_into_box` to be an `unsafe` function, telling Rust that calling this function is not generally safe. //@ This grants us the unsafe powers for the body of the function: We can dereference raw pointers, and - most importantly - we -//@ can call unsafe functions. (There's a third power, related to mutable static variables, but we didn't talk about static variables -//@ in the course, so that won't be relevant here.)
+//@ can call unsafe functions. (The other unsafe powers won't be relevant here. Go read [The Rustonomicon](https://doc.rust-lang.org/nightly/nomicon/) +//@ if you want to learn all about this, but be warned - That Way Lies Madness.)
//@ Here, the caller will have to ensure that `r` is a valid pointer, and that nobody else has a pointer to this data. unsafe fn raw_into_box(r: *mut T) -> Box { mem::transmute(r)