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

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

Merged
merged 1 commit into from Oct 25, 2018

Conversation

Projects
None yet
7 participants
@estebank
Contributor

estebank commented Oct 10, 2018

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.

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>>;
}
```
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Oct 10, 2018

r? @pnkfelix

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

@estebank

This comment was marked as resolved.

Contributor

estebank commented Oct 10, 2018

@bors try

Let's have a crater run just in case.

@bors

This comment was marked as resolved.

Contributor

bors commented Oct 10, 2018

⌛️ Trying commit c77a0cf with merge 4021bd0...

bors added a commit that referenced this pull request Oct 10, 2018

Auto merge of #54977 - estebank:macro-arg-parse, r=<try>
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 was marked as resolved.

Contributor

bors commented Oct 11, 2018

☀️ Test successful - status-travis
State: approved= try=True

@estebank

This comment has been minimized.

Contributor

estebank commented Oct 11, 2018

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

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Oct 11, 2018

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

@estebank

This comment was marked as outdated.

Contributor

estebank commented Oct 11, 2018

@pietroalbini oh, thanks! Last time I tried it failed with some error, but it was a long while ago.

@craterbot run start=master#5af0bb83044c3fb43d59ad5f49ee5ae1a293901f end=try#5af0bb83044c3fb43d59ad5f49ee5ae1a293901f mode=build-and-test

@craterbot

This comment was marked as outdated.

Collaborator

craterbot commented Oct 11, 2018

👌 Experiment pr-54977 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment was marked as outdated.

Collaborator

craterbot commented Oct 11, 2018

🚧 Experiment pr-54977 is now running on agent aws-2.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@kennytm

This comment has been minimized.

Member

kennytm commented Oct 12, 2018

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

@pietroalbini

This comment was marked as outdated.

Member

pietroalbini commented Oct 12, 2018

Yep.

@craterbot abort

@craterbot

This comment was marked as outdated.

Collaborator

craterbot commented Oct 12, 2018

🗑 Experiment pr-54977 deleted!

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@pietroalbini

This comment was marked as resolved.

Member

pietroalbini commented Oct 12, 2018

@craterbot run start=master#5af0bb83044c3fb43d59ad5f49ee5ae1a293901f end=try#4021bd0b3c5815b087d6db10ce461e7e4854ade7 mode=check-only

@craterbot

This comment was marked as outdated.

Collaborator

craterbot commented Oct 12, 2018

👌 Experiment pr-54977 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment was marked as outdated.

Collaborator

craterbot commented Oct 12, 2018

🚧 Experiment pr-54977 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Oct 13, 2018

🎉 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

@estebank

This comment has been minimized.

Contributor

estebank commented Oct 15, 2018

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

@estebank

This comment has been minimized.

Contributor

estebank commented Oct 22, 2018

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

@pnkfelix

This comment has been minimized.

Member

pnkfelix commented Oct 24, 2018

@bors r+ rollup

@bors

This comment has been minimized.

Contributor

bors commented Oct 24, 2018

📌 Commit c77a0cf has been approved by pnkfelix

kennytm added a commit to kennytm/rust that referenced this pull request Oct 24, 2018

Rollup merge of rust-lang#54977 - estebank:macro-arg-parse, r=pnkfelix
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 rust-lang#25274.

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55320 - kennytm:rollup, r=kennytm
Rollup of 22 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #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)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #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)
 - #55257 (Allow extern statics with an extern type)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)
 - #55303 (Update compiler-builtins submodule)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55320 - kennytm:rollup, r=kennytm
Rollup of 28 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #53931 (Gradually expanding libstd's keyword documentation)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54921 (Add line numbers option to rustdoc)
 - #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)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55200 (Documents `From` implementations for `Stdio`)
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #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)
 - #55257 (Allow extern statics with an extern type)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #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)
 - #55303 (Update compiler-builtins submodule)
 - #55306 (Regression test for #54478.)
 - #55328 (Fix doc for new copysign functions)

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 25, 2018

Rollup merge of rust-lang#54977 - estebank:macro-arg-parse, r=pnkfelix
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 rust-lang#25274.

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55347 - pietroalbini:rollup, r=pietroalbini
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 5afdf8b7 to b1d03437)
 - #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:master Oct 25, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@matthewjasper matthewjasper referenced this pull request Oct 27, 2018

Merged

Grammar: macros #458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment