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

macros: Improve tt matchers #34908

Merged
merged 2 commits into from
Jul 28, 2016
Merged

Conversation

jseyfried
Copy link
Contributor

Fixes #5846, fixes #22819.
r? @nrc

@jseyfried
Copy link
Contributor Author

jseyfried commented Jul 19, 2016

Looks like this breaks some non-trivial macro-expanded macro_rules!, which I thought were already broken but actually happen to work in some cases due to the strange behavior of today's tt fragments.

This should be able to land without breakage once I fix non-trivial macro-expanded macro_rules! (EDIT: c.f. #34925).

@jseyfried
Copy link
Contributor Author

cc @eddyb

@eddyb
Copy link
Member

eddyb commented Jul 19, 2016

LGTM, pending on #34925 landing.

@jseyfried jseyfried force-pushed the improve_tt_matchers branch 2 times, most recently from ddf7ae9 to 082970c Compare July 25, 2016 18:03
@jseyfried
Copy link
Contributor Author

This is ready to land now pending review (cc @nrc).
The travis failure is spurious.

@nrc
Copy link
Member

nrc commented Jul 26, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 26, 2016

📌 Commit 082970c has been approved by nrc

@bors
Copy link
Contributor

bors commented Jul 26, 2016

⌛ Testing commit 082970c with merge ee0dc3a...

@bors
Copy link
Contributor

bors commented Jul 26, 2016

💔 Test failed - auto-win-msvc-64-opt

@eddyb
Copy link
Member

eddyb commented Jul 26, 2016

@bors retry

@bors
Copy link
Contributor

bors commented Jul 26, 2016

⌛ Testing commit 082970c with merge bb5f00b...

@bors
Copy link
Contributor

bors commented Jul 26, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

On Tue, Jul 26, 2016 at 3:24 AM, bors notifications@github.com wrote:

💔 Test failed - auto-win-msvc-64-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt-rustbuild/builds/1950


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#34908 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95KyTz9n_saqsgq37uFRMoYY94xe5ks5qZeBagaJpZM4JPPEN
.

@bors
Copy link
Contributor

bors commented Jul 28, 2016

⌛ Testing commit 082970c with merge d69a893...

@bors
Copy link
Contributor

bors commented Jul 28, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@jseyfried
Copy link
Contributor Author

@bors r=nrc

@bors
Copy link
Contributor

bors commented Jul 28, 2016

📌 Commit 4485502 has been approved by nrc

@bors
Copy link
Contributor

bors commented Jul 28, 2016

⌛ Testing commit 4485502 with merge 4e0fcad...

@alexcrichton
Copy link
Member

@bors: retry force clean

  • restarted buildbot

@bors
Copy link
Contributor

bors commented Jul 28, 2016

⌛ Testing commit 4485502 with merge 1895bf7...

bors added a commit that referenced this pull request Jul 28, 2016
macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc
@bors bors merged commit 4485502 into rust-lang:master Jul 28, 2016
@durka
Copy link
Contributor

durka commented Aug 3, 2016

Has this innocuously named PR finally killed the reparse hack? https://is.gd/tV0iba

macro_rules! as_item { ($i:item) => { $i } }

macro_rules! foo {
    ($x:tt) => {
        //as_item!{          // uncomment for stable
        struct Item($x);
        //}
    }
}

foo!(i32);

fn main() {}

@eddyb
Copy link
Member

eddyb commented Aug 3, 2016

@durka That's what was fixed here, yeah.

@durka
Copy link
Contributor

durka commented Aug 3, 2016

That makes me unjustifiably happy. Please tag this with relnotes, trumpet from rooftops, etc.

@nrc nrc added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 3, 2016
@durka durka mentioned this pull request Aug 17, 2016
@jseyfried jseyfried deleted the improve_tt_matchers branch October 16, 2016 09:30
hcpl added a commit to hcpl/if_chain that referenced this pull request Jan 27, 2019
Rust 1.11 had an old behaviour for `tt` matchers that has been fixed in
Rust 1.12 (rust-lang/rust#34908).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Traverse interpolated TTs so we can parse them as other things tt-macro doesn't work
6 participants