Skip to content

Instantly share code, notes, and snippets.

@jld
Created June 4, 2013 05:00
Show Gist options
  • Select an option

  • Save jld/5703692 to your computer and use it in GitHub Desktop.

Select an option

Save jld/5703692 to your computer and use it in GitHub Desktop.
In which Rust code is evaluated over IRC, and monomorphize.rs has a bad day.
21:48 < jld> rusti: struct S<T>{i:u8,t:T} impl<T> S<T>{fn unwrap(self)->T{self.t}} struct A((u32, u32)); struct
B(u64); static Ca: S<A> = S{i:0,t:A((13, 104))}; static Cb: S<B> = S{i:0,t:B(31337)};
(Ca.unwrap(), Cb.unwrap())
21:48 -rusti:#rust- ({__field__: (13, 104)}, {__field__: 134591390154752})
21:49 < jld> rusti: struct S<T>{i:u8,t:T} impl<T> S<T>{fn unwrap(self)->T{self.t}} struct A((u32, u32)); struct
B(u64); static Ca: S<A> = S{i:0,t:A((13, 104))}; static Cb: S<B> = S{i:0,t:B(31337)}; Cb.unwrap()
21:49 -rusti:#rust- {__field__: 31337}
21:57 < jld> rusti: struct S<T>{i:u8,t:T} impl<T> S<T>{fn unwrap(self)->T{self.t}} struct A((u32, u32)); struct
B(u64); static Ca: S<A> = S{i:0,t:A((13, 104))}; static Cb: S<B> = S{i:0,t:B(31337)};
(Cb.unwrap(), Ca.unwrap())
21:57 -rusti:#rust- ({__field__: 31337}, {__field__: (104, 0)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment