[rust-dev] Missing lifetime parameter in std::str::MaybeOwned

2014-04-20 Thread Edward Wang
The snippet is extracted from std::str: pub enum MaybeOwned'a { /// A borrowed string Slice('a str), /// An owned string Owned(~str) } impl'a Eq for MaybeOwned'a { #[inline] fn eq(self, _other: MaybeOwned) - bool { true } } fn main() {} Note the Eq

Re: [rust-dev] Shouldn't task::try(...).unwrap() fail to compile?

2014-04-18 Thread Edward Wang
fail a task with ~Any) On Thu, Apr 17, 2014 at 8:55 AM, Edward Wang edward.yu.w...@gmail.com wrote: It current can compile, but judging from signatures: std::task::try is pub fn tryT: Send(f: proc(): Send - T) - ResultT, ~Any:Send std::result::unwrap on the other hand is implT, E: Show

[rust-dev] Shouldn't task::try(...).unwrap() fail to compile?

2014-04-17 Thread Edward Wang
It current can compile, but judging from signatures: std::task::try is pub fn tryT: Send(f: proc(): Send - T) - ResultT, ~Any:Send std::result::unwrap on the other hand is implT, E: Show ResultT, E { fn unwrap(self) - T {...} } There's no way the error part of result from task::try(...) can

[rust-dev] Fwd: matching on a few bits in int

2014-03-28 Thread Edward Wang
Whoops, excluded the list. I always fancy some Erlang style binary pattern matching in rust: case X of 2#00:2, _:6 - 1; 2#01:2, _:6 - 2; 2#10:2, _:6 - 3; 2#11:2, _:6 - 4 end. Syntax is a bit alien but we can adapt that to the rust land. -Ed On Fri, Mar 28, 2014 at 9:09 PM,

Re: [rust-dev] Vector length specified by enum

2014-03-25 Thread Edward Wang
I think so. https://github.com/mozilla/rust/blob/master/src/librustc/middle/lang_items.rsemployes such a trick. -Ed On Wed, Mar 26, 2014 at 3:42 AM, Ziad Hatahet hata...@gmail.com wrote: Would a macro address this situation? -- Ziad On Mon, Mar 24, 2014 at 5:12 PM, comex

Re: [rust-dev] Refactor json.rs

2014-03-22 Thread Edward Wang
, but if you are doing more there's a chance you could run into each other. -Erick On Sat, Mar 22, 2014 at 7:24 AM, Edward Wang edward.yu.w...@gmail.comwrote: Hi, I'm in the process of fixing a `ty_trait` variance inference bug, which will void the following code in json.rs: pub struct

Re: [rust-dev] Refactor json.rs

2014-03-22 Thread Edward Wang
posted on this list and to a reddit thread on /r/rust, but it sounds like what I was trying to do is just not possible at present. On Sat, Mar 22, 2014 at 12:00 PM, Josh Matthews j...@joshmatthews.netwrote: Whoops, excluded the mailing list. On 22 March 2014 11:53, Edward Wang edward.yu.w

Re: [rust-dev] Refactor json.rs

2014-03-22 Thread Edward Wang
Comex, I think it would. And it's also quite close to my Hash/Hasher analogy. The only problem seems to be that the scope will be too big. -Ed On Sun, Mar 23, 2014 at 1:43 AM, comex com...@gmail.com wrote: On Sat, Mar 22, 2014 at 10:24 AM, Edward Wang edward.yu.w...@gmail.com wrote

[rust-dev] A regression: eh-personality lang item is always needed regardless no-landing-pads flag

2014-01-17 Thread Edward Wang
Hi list, I built a rustc minutes ago from the source to pull down Niko's fix for temporary lifetime (https://github.com/mozilla/rust/pull/11585). It works great. In the meantime, there seems to be a possible regression introduced by unknown commit of the past day or so. That is, the

Re: [rust-dev] A regression: eh-personality lang item is always needed regardless no-landing-pads flag

2014-01-17 Thread Edward Wang
Well, I did. It all works very well until I pulled down the latest source. I'd like to dive into the rust source code but where to start? On Sat, Jan 18, 2014 at 3:48 PM, Daniel Micay danielmi...@gmail.com wrote: On Sat, Jan 18, 2014 at 2:45 AM, Edward Wang edward.yu.w...@gmail.com wrote