0a1,2 > ///! Version of main.rs with no dependancies, for compiling with rustc 1.14.1 on otter > ///! compile with `build.sh` 7c9,12 < use derive_more::{Add, AddAssign, Sub, SubAssign}; --- > use std::u16; > > // Macros we could use on Addr, but don't because otter doesn't have cargo. > // use derive_more::{Add, AddAssign, Sub, SubAssign}; 11c16 < #[derive(Default, Copy, Clone, Add, AddAssign, Sub, SubAssign)] --- > #[derive(Default, Copy, Clone)] //, Add, AddAssign, Sub, SubAssign 21c26 < addr.0.0 --- > (addr.0).0 26c31 < addr.0.0 as usize --- > (addr.0).0 as usize 37c42,71 < f.write_fmt(format_args!("{:#04x}", self.0.0)) --- > f.write_fmt(format_args!("{:#04x}", (self.0).0)) > } > } > > // Could use derive_more instead of manual impl, but cargo isn't installed on the lab machines :( > // (these impl's were generated by `cargo expand`) > impl ::core::ops::Add for Addr { > type Output = Addr; > #[inline] > fn add(self, rhs: Addr) -> Addr { > Addr(self.0.add(rhs.0)) > } > } > impl ::core::ops::AddAssign for Addr { > #[inline] > fn add_assign(&mut self, rhs: Addr) { > self.0.add_assign(rhs.0); > } > } > impl ::core::ops::Sub for Addr { > type Output = Addr; > #[inline] > fn sub(self, rhs: Addr) -> Addr { > Addr(self.0.sub(rhs.0)) > } > } > impl ::core::ops::SubAssign for Addr { > #[inline] > fn sub_assign(&mut self, rhs: Addr) { > self.0.sub_assign(rhs.0);