You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected either a compiler error, or for the macro to be legally definable, and for the compiler to accept this silly definition. Instead, the compiler complains and then panics.
Here's the output, which seems reasonable, up until the panic:
error: expected identifier, found `$`
--> <anon>:2:14
2 |> { $a:expr $$ $b:expr } => {{ 0 }};
|> ^
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'internal error: entered unreachable code', ../src/libsyntax/parse/parser.rs:2848
note: Run with `RUST_BACKTRACE=1` for a backtrace.
A "token tree" is how the contents of a macro_rules! definition is parsed,
before expanding it. This is a very permissive form of parsing.
Fixesrust-lang#33569.
Nightly compiler panics on a silly macro pattern that uses a double dollar sign (
$$
).I tried this code:
https://play.rust-lang.org/?gist=0aafe97edc13def2e090e3a09527dcc6&version=nightly&backtrace=0
I expected either a compiler error, or for the macro to be legally definable, and for the compiler to accept this silly definition. Instead, the compiler complains and then panics.
Here's the output, which seems reasonable, up until the panic:
Backtrace
The text was updated successfully, but these errors were encountered: