-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
This test case:
trait A {}
struct B;
impl A for B {}
fn foo(_: &mut A) {
}
fn main() {
let mut b = B;
foo(&mut b as &mut A);
}
fails with
foo.rs:10:8: 10:14 error: borrowed value does not live long enough
foo.rs:10 foo(&mut b as &mut A);
^~~~~~
note: borrowed pointer must be valid for the static lifetime...
foo.rs:8:10: 11:1 note: ...but borrowed value is only valid for the block at 8:10
foo.rs:8 fn main() {
foo.rs:9 let mut b = B;
foo.rs:10 foo(&mut b as &mut A);
foo.rs:11 }
error: aborting due to previous error
cc @msullivan
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.