_Most_ of Rust 0.6 compatibility.

Thanks to doy for doing the hard part  :)