-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transition to the new object lifetime defaults #27045
Transition to the new object lifetime defaults #27045
Conversation
defaults completely.
Just to be clear, the description should probably say "this is a [breaking change], but all such breaking cases are currently flagged with a warning, as specified in RFC 1156." (Right?) That is, I find it less scary to spell that out explicitly to the person writing up the release notes for the associated release. |
@nikomatsakis yay for removing tons of code. r=me after you revise the description as advised above. |
Updated. |
@bors r=pnkfelix |
📌 Commit de6b3c2 has been approved by |
@bors: p=1 |
⌛ Testing commit de6b3c2 with merge a146ab2... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Fri, Jul 17, 2015 at 9:18 AM, bors notifications@github.com wrote:
|
…nkfelix Transition to the new object lifetime defaults, replacing the old defaults completely. r? @pnkfelix This is a [breaking-change] as specified by [RFC 1156][1156] (though all cases that would break should have been receiving warnings starting in Rust 1.2). Types like `&'a Box<Trait>` (or `&'a Rc<Trait>`, etc) will change from being interpreted as `&'a Box<Trait+'a>` to `&'a Box<Trait+'static>`. To restore the old behavior, write the `+'a` explicitly. For example, the function: ```rust trait Trait { } fn foo(x: &Box<Trait>) { ... } ``` would be rewritten as: ```rust trait Trait { } fn foo(x: &'a Box<Trait+'a>) { ... } ``` if one wanted to preserve the current typing. [1156]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md
Transition to the new object lifetime defaults, replacing the old defaults completely.
r? @pnkfelix
This is a [breaking-change] as specified by RFC 1156 (though all cases that would break should have been receiving warnings starting in Rust 1.2). Types like
&'a Box<Trait>
(or&'a Rc<Trait>
, etc) will change from being interpreted as&'a Box<Trait+'a>
to&'a Box<Trait+'static>
. To restore the old behavior, write the+'a
explicitly. For example, the function:would be rewritten as:
if one wanted to preserve the current typing.