Closed
Description
// main.rs
#![feature(postfix_match)]
macro_rules! repro {
($e:expr) => {
$e.match { _ => {} }
};
}
fn main() {
repro!({ 1 } + 1);
}
As of current nightly, rustc -Zunpretty=expanded main.rs
produces this:
#![feature(prelude_import)]
#![no_std]
// main.rs
#![feature(postfix_match)]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
macro_rules! repro { ($e:expr) => { $e.match { _ => {} } }; }
fn main() { { 1 } + 1.match { _ => {} }; }
which is not valid Rust syntax.
error: leading `+` is not supported
--> <anon>:13:19
|
13 | fn main() { { 1 } + 1.match { _ => {} }; }
| ^ unexpected `+`
|
help: parentheses are required to parse this as an expression
|
13 | fn main() { ({ 1 }) + 1.match { _ => {} }; }
| + +
The correct output would contain ({ 1 } + 1).match { _ => {} }
.
F-postfix_match