Re: [rust-dev] Specifying lifetimes in return types of overloaded operators

2014-04-16 Thread Artella Coding
Hi Eric, this is an example of code which gives the error : struct Cls { vec : ~[~int] } /* Does not compile, yielding error message : method `index` has an incompatible type for trait: expected concrete lifetime,

Re: [rust-dev] Specifying lifetimes in return types of overloaded operators

2014-04-16 Thread Brendan Zabarauskas
For one, the Index trait is in dire need of an overhaul. In respect to the operator traits in general, I have actually been thinking of submitting an RFC proposing that they take thier parameters by-value instead of by-ref. That would remove the auto-ref behaviour of the operators which is more

Re: [rust-dev] Specifying lifetimes in return types of overloaded operators

2014-04-16 Thread SiegeLord
On 04/16/2014 03:09 PM, Brendan Zabarauskas wrote: For one, the Index trait is in dire need of an overhaul. In respect to the operator traits in general, I have actually been thinking of submitting an RFC proposing that they take thier parameters by-value instead of by-ref. That would remove

[rust-dev] Keeping up with Breaking Changes

2014-04-16 Thread Alex Crichton
Greetings Rustlers! Projects such as cargo and Servo have recently expressed interest in having a breaking changes changelog as part of the rust repository. It's often difficult for those not closely tied to the compiler itself to keep up with all the changes that are getting made. Additionally,

[rust-dev] Storing Handle (for Select) in a collection causes a crash

2014-04-16 Thread Frank Huang
Hello all, I have two somewhat related questions to ask you fine folks. I'm trying to implement something that selects on a variable number of receivers, which can change during program execution. I've been attempting to do so by making Handles to those receivers and storing the handles in a

Re: [rust-dev] Storing Handle (for Select) in a collection causes a crash

2014-04-16 Thread Patrick Walton
On 4/16/14 5:39 PM, Frank Huang wrote: Second somewhat related question: why can't I write this? fn main() { let mut v = Vec::new(); v.push(10); // get last item let n = v.get_mut(v.len()-1); println!(item = {}, *n); } For this program, the compiler complains at the line with

Re: [rust-dev] Storing Handle (for Select) in a collection causes a crash

2014-04-16 Thread Frank Huang
Ah, yes I failed to see the warning in the documentation. add()ing the handle after moving it into the hashmap does seem to make things better. Thanks for your help! Frank On Wed, Apr 16, 2014 at 5:45 PM, Alex Crichton a...@crichton.co wrote: unsafe { h.add(); }

[rust-dev] Expected fields in traits

2014-04-16 Thread Tommi
I can't figure out how GitHub works, so can someone please commit the following RFC, thank you: - Start Date: 2014-04-17 - RFC PR #: - Rust Issue #: # Summary Add the ability to specify that a type, which implements a certain trait, must have certain set of fields (data members) of certain