On Wed, May 29, 2013 at 04:55:31PM -0500, Tommy M. McGuire wrote:
> The problem is that I want to use a completely unrelated vector as the
> argument to find() instead of an alias for part of the buffer or a pair
> of indices into the buffer.
>
> Currently, with my quick change to incoming, the code
>
> let kkey : &[u8] = key; // key : ~[u8]
> match dictionary.find(&kkey) {
>
> produces:
>
> 55:38 error: borrowed value does not live long enough
> let kkey : &[u8] = key;
> ^~~
> 67:1 note: borrowed pointer must be valid for the lifetime
> &br_named({repr: 83, ctxt: 0}) as defined on the block at 48:0...
> ...
> 65:5 note: ...but borrowed value is only valid for the block at 50:46
>
> The lifetime '&br_named(...)' stuff should be "'b", the lifetime
> parameter of the function (the block at 48:0) that is associated with
> the keys and values from the HashMap (was LinearMap) and the buffer.
This seems like a bug (also, what a lousy error message! sorry.), I
will further investigate.
Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev