Skip to content

Accept Option<Box<$t:ty>> in macro argument - #54977

Merged
bors merged 1 commit into
rust-lang:masterfrom
estebank:macro-arg-parse
Oct 25, 2018
Merged

Accept Option<Box<$t:ty>> in macro argument#54977
bors merged 1 commit into
rust-lang:masterfrom
estebank:macro-arg-parse

Conversation

@estebank

Copy link
Copy Markdown
Contributor

Given the following code, compile successfuly:

macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}

Fix#25274.

Given the following code, compile successfuly:
```
macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}
```
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pnkfelix

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 10, 2018
@estebank

This comment has been minimized.

@bors

This comment has been minimized.

bors added a commit that referenced this pull request Oct 10, 2018
Accept `Option<Box<$t:ty>>` in macro argument
Given the following code, compile successfuly:
```
macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}
```
Fix#25274.
@bors

This comment has been minimized.

@estebank

Copy link
Copy Markdown
ContributorAuthor

@rust-lang/infra can I haz crater run?

@emilyalbini

Copy link
Copy Markdown
Member

@estebank you should have the rights to start runs by yourself. Check out the docs!

@estebank

This comment has been minimized.

@craterbot

This comment has been minimized.

@craterbotcraterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2018
@craterbot

This comment has been minimized.

@kennytm

Copy link
Copy Markdown
Member

The commit range seems wrong, should be start=master#5af0bb83044c3fb43d59ad5f49ee5ae1a293901f end=try#4021bd0b3c5815b087d6db10ce461e7e4854ade7. BTW a check-only run should be enough? @estebank

@emilyalbini

This comment has been minimized.

@craterbot

This comment has been minimized.

@craterbotcraterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Oct 12, 2018
@emilyalbini

This comment has been minimized.

@craterbot

This comment has been minimized.

@craterbotcraterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 12, 2018
@craterbot

This comment has been minimized.

@craterbot

Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-54977 is completed!
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbotcraterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Oct 13, 2018
@estebank

Copy link
Copy Markdown
ContributorAuthor

There seem to be no regressions caused by this PR, I believe it'll be safe to merge.

@estebank

Copy link
Copy Markdown
ContributorAuthor

@pnkfelix Ping. This is a very small change code-wise.

@pnkfelix

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Oct 24, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit c77a0cf has been approved by pnkfelix

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Oct 24, 2018
Accept `Option<Box<$t:ty>>` in macro argument
Given the following code, compile successfuly:
```
macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}
```
Fixrust-lang#25274.
@kennytmkennytm mentioned this pull request Oct 24, 2018
emilyalbini added a commit to emilyalbini/rust that referenced this pull request Oct 25, 2018
Accept `Option<Box<$t:ty>>` in macro argument
Given the following code, compile successfuly:
```
macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}
```
Fixrust-lang#25274.
bors added a commit that referenced this pull request Oct 25, 2018
Rollup of 22 pull requests
Successful merges:
- #53507 (Add doc for impl From for Waker)
- #53931 (Gradually expanding libstd's keyword documentation)
- #54965 (update tcp stream documentation)
- #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
- #55138 (in which unused-parens suggestions heed what the user actually wrote)
- #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
- #55200 (Documents `From` implementations for `Stdio`)
- #55245 (submodules: update clippy from 5afdf8b to b1d0343)
- #55247 (Clarified code example in char primitive doc)
- #55251 (Fix a typo in the documentation of RangeInclusive)
- #55253 (only issue "variant of the expected type" suggestion for enums)
- #55254 (Correct trailing ellipsis in name_from_pat)
- #55269 (fix typos in various places)
- #55282 (Remove redundant clone)
- #55285 (Do some copy editing on the release notes)
- #55291 (Update stdsimd submodule)
- #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
- #55306 (Regression test for #54478.)
- #55328 (Fix doc for new copysign functions)
- #55340 (Operands no longer appear in places)
- #55345 (Remove is_null)
- #55348 (Update RELEASES.md after destabilization of non_modrs_mods)
Failed merges:
r? @ghost
@bors
bors merged commit c77a0cf into rust-lang:masterOct 25, 2018
@estebank
estebank deleted the macro-arg-parse branch November 9, 2023 05:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@estebank@rust-highfive@bors@emilyalbini@craterbot@kennytm@pnkfelix