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

Prepare runway for RFC 809 (overloaded box/placement-in) #23002

Merged
merged 4 commits into from
Mar 4, 2015

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Mar 3, 2015

Runway for RFC 809 (overloaded box/placement-in) by adding type annotations or explicit calls to Box::new where I found it necessary on PR #22086.

I have broken this up into more than one PR because the entire commit chain (see PR #22086) is long, widespread and unwieldy to rebase frequently.

To my knowledge this is not a breaking change. Also, there is in principle nothing stopping someone from reverting some/all of these annotations, since without the rest of the commit chain in #22086, the associated code would continue to compile.

All I can do is ask: Try to discourage others from removing seemingly "unnecessary" uses of the Box type or the Box::new() function, until the rest of RFC 809 lands.

pnkfelix added 2 commits March 3, 2015 20:29
This is the kind of change that one is expected to need to make to
accommodate overloaded-`box`.

----

Note that this is not *all* of the changes necessary to accommodate
Issue 22181.  It is merely the subset of those cases where there was
already a let-binding in place that made it easy to add the necesasry
type ascription.

(For unnamed intermediate `Box` values, one must go down a different
route; `Box::new` is the option that maximizes portability, but has
potential inefficiency depending on whether the call is inlined.)

----

There is one place worth note, `run-pass/coerce-match.rs`, where I
used an ugly form of `Box<_>` type ascription where I would have
preferred to use `Box::new` to accommodate overloaded-`box`.  I
deliberately did not use `Box::new` here, because that is already done
in coerce-match-calls.rs.

----

Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
(You shouldn't use it, but it is a semi-reasonable way to annotate
types when necessary.)
@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@bors r=nikomatsakis 270f0ee

@bors
Copy link
Contributor

bors commented Mar 3, 2015

🙀 270f0ee is not a valid commit SHA. Please try again with 56e83b3.

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

(also, I can predict that this PR as posted (commit 56e83b3be ) and PR #22873 are going to hit a merge conflict, e.g. due to my change to this line, which is just too close to the changes from #22873. I plan to just remove the files that conflict from this PR as best I can (i.e. delaying those changes for the rest of the landing), so that everything can go swimmingly if PR #22873 actually lands.)

@pnkfelix pnkfelix force-pushed the fsk-box-place-runway branch from 56e83b3 to 392e673 Compare March 3, 2015 19:53
@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@bors r=nikomatsakis 392e673

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@bors p=1

Many of the modifications putting in `Box::new` calls also include a
pointer to Issue 22405, which tracks going back to `box <expr>` if
possible in the future.

(Still tried to use `Box<_>` where it sufficed; thus some tests still
have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.)

Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
@pnkfelix pnkfelix force-pushed the fsk-box-place-runway branch from 392e673 to 0d5bcb1 Compare March 3, 2015 20:06
@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@bors p=1 r=nikomatsakis 0d5bcb1

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 3, 2015

@bors p=1 r=nikomatsakis cb1b0dd

@bors
Copy link
Contributor

bors commented Mar 3, 2015

⌛ Testing commit cb1b0dd with merge fed1249...

bors added a commit that referenced this pull request Mar 3, 2015
Runway for RFC 809 (overloaded box/placement-in) by adding type annotations or explicit calls to `Box::new` where I found it necessary on PR #22086.

I have broken this up into more than one PR because the entire commit chain (see PR #22086) is long, widespread and unwieldy to rebase frequently.

To my knowledge this is not a breaking change.  Also, there is in principle nothing stopping someone from reverting some/all of these annotations, since without the rest of the commit chain in #22086, the associated code would continue to compile.

All I can do is ask: Try to discourage others from removing seemingly "unnecessary" uses of the `Box` type or the `Box::new()` function, until the rest of RFC 809 lands.
@bors bors merged commit cb1b0dd into rust-lang:master Mar 4, 2015
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.

2 participants