-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regions
Milestone
Description
This code fails to compile:
fn rereborrow(v: &r/int) -> &r/int { &_&_v }
fn main() {}
With error:
test.rs:1:38: 1:42 error: illegal borrow: borrowed value does not live long enough
test.rs:1 fn rereborrow(v: &r/int) -> &r/int { &_&v }
^~~~
test.rs:1:35: 1:44 note: borrowed pointer must be valid for the lifetime &r as defined on the block at 1:35...
test.rs:1 fn rereborrow(v: &r/int) -> &r/int { &&v }
^~~~~~~~~
test.rs:1:35: 1:44 note: ...but borrowed value is only valid for the block at 1:35
test.rs:1 fn rereborrow(v: &r/int) -> &r/int { &&_v }
^~~~~~~~~
error: aborting due to previous error
shell returned 101
Metadata
Metadata
Assignees
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regions