Stream: t-compiler/rust-analyzer

Topic: $_ in MBE


Laurențiu (Dec 18 2020 at 15:55, on Zulip):

I can't find anything in the docs about $_ being treated specially, does it work like a normal metavariable?

Laurențiu (Dec 18 2020 at 15:55, on Zulip):

(for context: https://github.com/rust-analyzer/rust-analyzer/issues/6926)

matklad (Dec 18 2020 at 15:57, on Zulip):

Have no idea, the best way is probably just to try this out

Jonas Schievink [he/him] (Dec 18 2020 at 15:59, on Zulip):

I think it works normally

Laurențiu (Dec 18 2020 at 15:59, on Zulip):

Not sure how to try it, but ($_:ident, $_: ident) complains about a duplicate binding

Jonas Schievink [he/him] (Dec 18 2020 at 15:59, on Zulip):

Had no idea it was allowed though

Edwin Cheng (Dec 18 2020 at 17:00, on Zulip):

What happend if your pr is not applied, but only run your test?

Edwin Cheng (Dec 18 2020 at 17:01, on Zulip):

IIRC, we dun treat any underscore specially

Laurențiu (Dec 18 2020 at 17:04, on Zulip):

It fails like in the referenced issue (I guess, but I traced the errors and it ends up on the Punct arm)

Edwin Cheng (Dec 18 2020 at 17:30, on Zulip):

Maybe related to composite punct handling code?

Last update: Jul 26 2021 at 12:15UTC