Skip to content

block arguments to macros are broken #13678

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

Closed
comex opened this issue Apr 22, 2014 · 0 comments · Fixed by #14432
Closed

block arguments to macros are broken #13678

comex opened this issue Apr 22, 2014 · 0 comments · Fixed by #14432

Comments

@comex
Copy link
Contributor

comex commented Apr 22, 2014

#![feature(macro_rules)]

macro_rules! foo(
    ($b:block) => ($b)
)

fn main() {
    foo!({})
}

I don't see any reason why this shouldn't work.

Result:

huh.rs:4:21: 4:22 error: unexpected token: `an interpolated block`
huh.rs:4     ($b:block) => ($b)

rustc 0.11-pre-nightly (d35804e 2014-04-18 00:01:22 -0700)

lilyball added a commit to lilyball/rust that referenced this issue May 26, 2014
bors added a commit that referenced this issue May 26, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 9, 2023
Encode the variants of `HirFileId` in a u32 with MSB as the tag

This saves 10mb on `self` analysis, while this does limit us to 2billion real files and 2 billion macro expansions, I doubt we will ever hit that limit :) `HirFileId` is used a lot, so going from 8 bytes to 4 is a decent win.
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 a pull request may close this issue.

1 participant