syn icon indicating copy to clipboard operation
syn copied to clipboard

Consider adding a Stmt::Macro variant

Open dtolnay opened this issue 3 years ago • 0 comments

In something like:

fn main() {
    thread_local! { static FOO: i32 = 1; }
    println! { "{}", FOO.with(i32::clone) }
}

it's syntactically ambiguous whether the macros represent an expression or an item. Currently this syntax is arbitrarily disambiguated to Stmt::Item by syn (as opposed to Stmt::Expr) but perhaps it would be clearer not to do that so arbitrarily.

dtolnay avatar Jun 27 '22 02:06 dtolnay