There's more...

Do you want to know how a sophisticated low-level function like std::mem::drop is implemented:

pub fn drop<T>(_x: T) { }

That's right, it does nothing! The reason this works is that it takes T by value, moving it into the function. The function does nothing and all its owned variables go out of scope. Hurray for Rust's borrow checker!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.5.57