mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
56f43b5142
When a macro expands to a call whose callee is a block (or other "complete" expression like `match`, `if`, `loop`), the AST pretty printer emits the callee without parentheses. In statement position the closing brace ends the expression and the argument list is parsed as a separate tuple expression, producing a parse error.
18 lines
408 B
Rust
18 lines
408 B
Rust
#![feature(prelude_import)]
|
|
#![no_std]
|
|
extern crate std;
|
|
#[prelude_import]
|
|
use ::std::prelude::rust_2015::*;
|
|
//@ pretty-mode:expanded
|
|
//@ pp-exact:block-index-paren.pp
|
|
|
|
macro_rules! block_arr { () => {{ [0u8; 4] }}; }
|
|
|
|
macro_rules! as_slice { () => {{ &block_arr!()[..] }}; }
|
|
|
|
macro_rules! group { ($e:expr) => { $e }; }
|
|
|
|
fn scope() { &({ drop })(0); }
|
|
|
|
fn main() { let _: &[u8] = { &({ [0u8; 4] })[..] }; }
|