Probably because its wrong. It was likely a compiler bug that got fixed. The compiler says pretty clearly what the issue is. What if A has a shorter lifetime than B? Then you are basically holding a reference to data that has been disposed, which is what "can't" happen in rust.
On Thu, Sep 11, 2014 at 9:26 PM, Christophe Pedretti <christophe.pedre...@gmail.com> wrote: > Hello, > > with 0.11.0, this code was ok > >> pub struct Cursor<'a, 'b> { >> pStmt : &'b Statement<'a>, >> error : bool >> } > > > now, with the nighly, i receive a > > sql\connection.rs:50:1: 53:2 error: in type `&'b > sql::connection::Statement<'a>`, reference has a longer lifetime than the > data it references > sql\connection.rs:50 pub struct Cursor<'a, 'b> { > sql\connection.rs:51 pStmt : &'b Statement<'a>, > sql\connection.rs:52 error : bool > sql\connection.rs:53 } > sql\connection.rs:50:1: 53:2 note: the pointer is valid for the lifetime 'b > as defined on the struct at 50:0 > sql\connection.rs:50 pub struct Cursor<'a, 'b> { > sql\connection.rs:51 pStmt : &'b Statement<'a>, > sql\connection.rs:52 error : bool > sql\connection.rs:53 } > sql\connection.rs:50:1: 53:2 note: but the referenced data is only valid for > the lifetime 'a as defined on the struct at 50:0 > sql\connection.rs:50 pub struct Cursor<'a, 'b> { > sql\connection.rs:51 pStmt : &'b Statement<'a>, > sql\connection.rs:52 error : bool > sql\connection.rs:53 } > error: aborting due to previous error > > why this change ? > > > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev > _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev