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
When borrowing an owned value, the lifetime of the value should be extended at least to the end of the current statement, and perhaps extended to the full lifetime of the borrow.
Extending the lifetime to the end of the current statement would allow constructs like the following to work:
foo(vec::from_elem(16, 0).slice(0,4));
Extending the lifetime to the full lifetime of the borrow would just be a bit more convenient for the programmer who doesn't care about having an owned pointer, although it may not be worth the complexity.
… r=flip1995
Change unnecessary_wraps to pedantic
changelog: Change unnecessary_wraps to pedantic
There seems to be enough evidence that this lint is not wanted as warn-by-default. Attempted before at rust-lang#6380. False positives at rust-lang#6721 and rust-lang#6427. Actually requested to change the category at rust-lang#6726.
Closesrust-lang#6726
When borrowing an owned value, the lifetime of the value should be extended at least to the end of the current statement, and perhaps extended to the full lifetime of the borrow.
Extending the lifetime to the end of the current statement would allow constructs like the following to work:
Extending the lifetime to the full lifetime of the borrow would just be a bit more convenient for the programmer who doesn't care about having an owned pointer, although it may not be worth the complexity.
@nikomatsakis
The text was updated successfully, but these errors were encountered: