Open
Description
#![feature(coroutines, gen_blocks)]
fn main() {
let _ = gen { {}.yield.yield };
}
The output from rustc --edition=2024 -Zunpretty=expanded main.rs
is:
#![feature(prelude_import)]
#![feature(coroutines, gen_blocks)]
#[prelude_import]
use std::prelude::rust_2024::*;
#[macro_use]
extern crate std;
fn main() { let _ = gen { ({}.yield).yield }; }
The correct output would have {}.yield.yield
instead of ({}.yield).yield
. The pretty-printer is inserting parentheses that do not need to be there, as if the inner yield were prefix yield: (yield {}).yield
.
Meta
rustc --version --verbose
:
rustc 1.88.0-nightly (00095b3da 2025-04-03)
binary: rustc
commit-hash: 00095b3da4f23d9b3e7a809ac6a4e2b2530df84c
commit-date: 2025-04-03
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2