begin rust 0.5 -> rust 0.8 port. does not yet compile.