Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upGeneralize object and type parameter bounds #16453
Conversation
This comment has been minimized.
This comment has been minimized.
|
r? @pnkfelix Note: there are still a lot of commits here. I got tired of grouping them together. I will likely come back and group them some more later, but I'd also like to walk you through the code a bit. |
This comment has been minimized.
This comment has been minimized.
|
Per discussion with @nick29581 and @pnkfelix, we're going to delay review (or at least landing) somewhat so as to try and avoid conflicts with DST branch. |
This comment has been minimized.
This comment has been minimized.
|
OK, I cleaned up the set of commits, grouping things together as best I could. It's reasonably clean now, though the commits will not build independently. |
pnkfelix
referenced this pull request
Aug 14, 2014
Closed
librustc: Implement arbitrary lifetimes in trait objects. #16068
nikomatsakis
referenced
this pull request
in pcwalton/rust
Aug 14, 2014
This comment has been minimized.
This comment has been minimized.
|
Closes #16462 |
bors
added a commit
that referenced
this pull request
Aug 15, 2014
bors
added a commit
that referenced
this pull request
Aug 16, 2014
nikomatsakis
referenced this pull request
Aug 16, 2014
Closed
Rust miscompiles Servo after upgrading to new revision of Rust #16366
bors
added a commit
that referenced
this pull request
Aug 17, 2014
nikomatsakis
force-pushed the
nikomatsakis:type-bounds-3
branch
from
1a584c0
to
d12d394
Aug 23, 2014
bors
added a commit
that referenced
this pull request
Aug 23, 2014
bors
added a commit
that referenced
this pull request
Aug 23, 2014
bors
added a commit
that referenced
this pull request
Aug 23, 2014
bors
added a commit
that referenced
this pull request
Aug 24, 2014
bors
added a commit
that referenced
this pull request
Aug 25, 2014
nikomatsakis
force-pushed the
nikomatsakis:type-bounds-3
branch
from
48887b6
to
e336eaf
Aug 25, 2014
bors
added a commit
that referenced
this pull request
Aug 25, 2014
bors
added a commit
that referenced
this pull request
Aug 26, 2014
bors
added a commit
that referenced
this pull request
Aug 26, 2014
nikomatsakis
force-pushed the
nikomatsakis:type-bounds-3
branch
from
1bd83ce
to
1b487a8
Aug 28, 2014
This comment has been minimized.
This comment has been minimized.
|
r=pcwalton |
This comment has been minimized.
This comment has been minimized.
|
@bors: retry |
This comment has been minimized.
This comment has been minimized.
|
@bors: retry (seemingly transient win32 permission error) |
This comment has been minimized.
This comment has been minimized.
alexcrichton
replied
Aug 28, 2014
|
@bors: retry |
This comment has been minimized.
This comment has been minimized.
|
Rebased over DST. At this point the history is ruined, so I squashed down to a single commit now that the review has been done. |
This comment has been minimized.
This comment has been minimized.
|
saw approval from pcwalton |
This comment has been minimized.
This comment has been minimized.
|
merging nikomatsakis/rust/type-bounds-3 = 1b487a8 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
some tests failed: |
This comment has been minimized.
This comment has been minimized.
|
saw approval from pcwalton |
This comment has been minimized.
This comment has been minimized.
|
saw approval from pcwalton |
This comment has been minimized.
This comment has been minimized.
|
merging nikomatsakis/rust/type-bounds-3 = 1b487a8 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = b516532 |
nikomatsakis commentedAug 12, 2014
Implements rust-lang/rfcs#192.
In particular:
Sendbound.T:'ameans "the type T outlives 'a" and something like'a:'b`" means "'a outlives 'b". Outlives here means "all borrowed data has a lifetime at least as long".This is a [breaking-change]. The most common things you have to fix after this change are:
struct Ref<'a, T> { x: &'a T }would be changed tostruct Ref<'a, T:'a> { x: &'a T }.struct RefWrapper<'a, 'b> { r: &'a Ref<'b, int> }(whereRefis defined as before) would need to be changed tostruct RefWrapper<'a, 'b:'a> { ... }.Box<Reader>toBox<Reader+'static>, so as to indicate that this is a reader without any borrowed data. (Note: you may wish to just change toBox<Reader+Send>while you're at it; it's a more restrictive type, technically, but means you can send the reader between threads.)The intuition for points 1 and 2 is that a reference must never outlive its referent (the thing it points at). Therefore, if you have a type
&'a T, we must know thatT(whatever it is) outlives'a. And so on.Closes #5723.