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

Enable fall through past $:lifetime matcher #51480

Merged
merged 1 commit into from
Jun 11, 2018
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jun 10, 2018

macro_rules! is_lifetime {
    ($lifetime:lifetime) => { true };
    ($other:tt) => { false };
}

fn main() {
    println!("{}", is_lifetime!('lifetime));
    println!("{}", is_lifetime!(@));
}

Before this fix, the is_lifetime! invocation would fail to compile with:

error: expected a lifetime, found `@`
 --> src/main.rs:8:33
  |
8 |     println!("{}", is_lifetime!(@));
  |                                 ^

Fixes #50903.
Fixes #51477.

r? @kennytm

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

This comment has been minimized.

@kennytm
Copy link
Member

kennytm commented Jun 11, 2018

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 11, 2018

📌 Commit 9870208 has been approved by kennytm

@bors bors 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 Jun 11, 2018
@bors
Copy link
Contributor

bors commented Jun 11, 2018

⌛ Testing commit 9870208 with merge 13f8d07...

bors added a commit that referenced this pull request Jun 11, 2018
Enable fall through past $:lifetime matcher

```rust
macro_rules! is_lifetime {
    ($lifetime:lifetime) => { true };
    ($other:tt) => { false };
}

fn main() {
    println!("{}", is_lifetime!('lifetime));
    println!("{}", is_lifetime!(@));
}
```

Before this fix, the `is_lifetime!` invocation would fail to compile with:

```
error: expected a lifetime, found `@`
 --> src/main.rs:8:33
  |
8 |     println!("{}", is_lifetime!(@));
  |                                 ^
```

Fixes #50903.
Fixes #51477.

r? @kennytm
@bors
Copy link
Contributor

bors commented Jun 11, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 13f8d07 to master...

@bors bors merged commit 9870208 into rust-lang:master Jun 11, 2018
@dtolnay dtolnay deleted the lifetime branch June 11, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
4 participants