You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: