Skip to content

desugaring-based box placement-in (take-4 branch) - #26180

Closed
pnkfelix wants to merge 36 commits into
rust-lang:masterfrom
pnkfelix:fsk-box-placer-take-4
Closed

desugaring-based box placement-in (take-4 branch)#26180
pnkfelix wants to merge 36 commits into
rust-lang:masterfrom
pnkfelix:fsk-box-placer-take-4

Conversation

@pnkfelix

Copy link
Copy Markdown
Contributor

Macro-desugaring of box and placement-box into "simpler" expressions.

Includes Placer API that one can override to integrate support for box into one's own type.

Part of #22181

Does not turn on the in <place-expr> { <block> ... } syntax proposed in rust-lang/rfcs#809 , so there is still more to be done in that area. But I wanted to get this into the review pipeline now, since it is more invasive than we originally anticipated it being.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@pnkfelix

Copy link
Copy Markdown
ContributorAuthor

r? @nikomatsakis

Feel free to reassign.

Also, you've already looked at much of this before, so feel free to ask me to point out the bits that are most different. Actually, let me try to do some of that off the bat; the newest parts of this are:

  • pnkfelix@fe09edb : push_unsafe! and pop_unsafe! for "unsafety hygiene" (the macros themselves are not used by the box protocol -- the macros just illustrate/test the functionality that is used by the box protocol)
  • pnkfelix@a97598e Change signature for move_val_init intrinsic to take *mut T
  • pnkfelix@379a252 Revise lang_item demo to something unrelated to Box impl (which should probably be looked at by @steveklabnik independently)

@bors

bors commented Jun 18, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #26192) made this pull request unmergeable. Please resolve the merge conflicts.

pnkfelix added 24 commits July 16, 2015 11:54
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates.
Part of what lands with Issue 22181.
Namely:
* Update run-pass/new-box-syntax
* Fix doc-embedded test for `alloc::boxed` to reflect new syntax.
* Fix test/debuginfo/box.rs to reflect new syntax.
Part of what lands with Issue 22181.
…t suite.
Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
… depth.
This is a total hack; it not only needs a feature-gate, but probably
should be feature-gated forever (if possible).
ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs
…dest`.
rebase update to typeck/check/mod.rs
in effort to understand treatment of `allow_internal_unstable`.
… box protocol.
Actually for some reason I opted for type-annotations for most of
this. (And that's really what I should have been striving for in the
other commits, but its just easier to write `Box::new` most of the
time.)
@pnkfelix
pnkfelixforce-pushed the fsk-box-placer-take-4 branch from dca3dcf to a61490cCompareJuly 16, 2015 12:45
@bors

bors commented Jul 18, 2015

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #26955) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis

Copy link
Copy Markdown
Contributor

@pnkfelix let's talk about this branch; I liked the idea of isolating out the placement new work and landing that first to avoid box regressions

@pnkfelix

Copy link
Copy Markdown
ContributorAuthor

@nikomatsakis yeah I have just finished factoring the in code into such a branch. I'll put up an alternative PR soon and close this one.

@nikomatsakis

Copy link
Copy Markdown
Contributor

Nice.

Niko

-------- Original message --------
From: Felix S Klock II notifications@github.com
Date:07/21/2015 12:21 (GMT-05:00)
To: rust-lang/rust rust@noreply.github.com
Cc: Niko Matsakis niko@alum.mit.edu
Subject: Re: [rust] desugaring-based box placement-in (take-4 branch) (#26180)
@nikomatsakis yeah I have just finished factoring the in code into such a branch. I'll put up an alternative PR soon and close this one.


Reply to this email directly or view it on GitHub.

@pnkfelix

Copy link
Copy Markdown
ContributorAuthor

closing in favor of PR #27215.

bors added a commit that referenced this pull request Jul 24, 2015
…akis
Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol.
Includes Placer API that one can override to integrate support for `in` into one's own type. (See [RFC 809].)
[RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md
Part of #22181
Replaced PR #26180.
Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`.
(Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax. In particular I still want to play around with some other alternatives. Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.)
----
Also, this PR leaves out support for desugaring-based `box EXPR`. We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.
Sign up for freeto 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.

5 participants

@pnkfelix@rust-highfive@bors@nikomatsakis@sfackler