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

Groups with Delimiter::None not (really) preserved #1

Open
steffahn opened this issue Aug 21, 2021 · 2 comments
Open

Groups with Delimiter::None not (really) preserved #1

steffahn opened this issue Aug 21, 2021 · 2 comments

Comments

@steffahn
Copy link

steffahn commented Aug 21, 2021

Is this a bug in this crate or in rustc? (Or intended behavior?)

use rust_2018::rust_2018;

macro_rules! foo {
    ($e:expr) => {
        bar!{$e * 2}
    }
}
macro_rules! bar {
    ($e:expr) => {
        ($e, rust_2018!($e))
    };
}

fn main() {
    dbg!(foo!(5+5));
    // [src/main.rs:18] foo!(5 + 5) = (
    //     20,
    //     15,
    // )
}
@steffahn steffahn changed the title Groups with Delimiter::None not really preserved Groups with Delimiter::None not (really) preserved Aug 21, 2021
@m-ou-se
Copy link
Owner

m-ou-se commented Aug 21, 2021

That's a known bug in Rustc, unfortunately:

rust-lang/rust#67062
rust-lang/rust#74036

@m-ou-se
Copy link
Owner

m-ou-se commented Aug 21, 2021

(This issue was also encountered in assert2. That crate now replaces all None delimiters by regular parenthesis as a workaround: de-vri-es/assert2-rs@2344cf1)

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

No branches or pull requests

2 participants