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

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

Closed
wants to merge 36 commits into from

Conversation

pnkfelix
Copy link
Member

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
Collaborator

r? @sfackler

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

@pnkfelix
Copy link
Member Author

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
Copy link
Contributor

bors commented Jun 18, 2015

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

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.)
@bors
Copy link
Contributor

bors commented Jul 18, 2015

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

@nikomatsakis
Copy link
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
Member Author

@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
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
Member Author

closing in favor of PR #27215.

@pnkfelix pnkfelix closed this Jul 22, 2015
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 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.

5 participants