Skip to content
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

Merged
merged 1 commit into from Jul 17, 2015

Conversation

nikomatsakis
Copy link
Contributor

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:

trait Trait { }
fn foo(x: &Box<Trait>) { ... }

would be rewritten as:

trait Trait { }
fn foo(x: &'a Box<Trait+'a>) { ... }

if one wanted to preserve the current typing.

@pnkfelix
Copy link
Member

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.

@pnkfelix
Copy link
Member

@nikomatsakis yay for removing tons of code.

r=me after you revise the description as advised above.

@nikomatsakis
Copy link
Contributor Author

@pnkfelix

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?)

Updated.

@nikomatsakis
Copy link
Contributor Author

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented Jul 17, 2015

📌 Commit de6b3c2 has been approved by pnkfelix

@alexcrichton
Copy link
Member

@bors: p=1

@bors
Copy link
Contributor

bors commented Jul 17, 2015

⌛ Testing commit de6b3c2 with merge a146ab2...

@bors
Copy link
Contributor

bors commented Jul 17, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Fri, Jul 17, 2015 at 9:18 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/5756


Reply to this email directly or view it on GitHub
#27045 (comment).

@bors
Copy link
Contributor

bors commented Jul 17, 2015

⌛ Testing commit de6b3c2 with merge e05ac39...

bors added a commit that referenced this pull request Jul 17, 2015
…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
@bors bors merged commit de6b3c2 into rust-lang:master Jul 17, 2015
@arielb1 arielb1 mentioned this pull request Sep 15, 2015
@nikomatsakis nikomatsakis deleted the better-object-defaults-error branch March 30, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants