-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed as not planned
Labels
C-bugCategory: This is a bug.Category: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
I tried this code:
fn main() {
let x = 0usize;
let _ = format!("{}{x}", if x == 0 { "-" } else { &x.to_string() }); // stable: OK, nightly: ERROR!
let _ = format!("{x}{}", if x == 0 { "-" } else { &x.to_string() }); // stable: OK, nightly: ERROR!
let _ = format!("{}", if x == 0 { "-" } else { &x.to_string() }); // stable, nightly: ERROR
}
I expected to see this happen: format_args!/format! etc. equivalent to writeln!
Instead, this happened: writeln! on nightly regressed in extending lifetime when called with 2 or more arguments
Reduced from here https://github.com/foundry-rs/foundry/actions/runs/17817373054/job/50653220499?pr=11697#step:5:738
Version it worked on
It most recently worked on: stable, yesterday's nightly
Version with regression
rustc --version --verbose
:
rustc 1.92.0-nightly (4645a7988 2025-09-17)
binary: rustc
commit-hash: 4645a7988177c286f61609cc667ecae4c571a2e8
commit-date: 2025-09-17
host: x86_64-unknown-linux-gnu
release: 1.92.0-nightly
LLVM version: 21.1.1
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.