Summary
I tried to format this code:
fn test() {
if outer {
if inner {
if even_more_inner {
let items = page
.into_iter()
.map(
|list_media_response::ListEntry {
cdn,
media_id,
length,
}|
-> Result<_, RequestError<BackupAuthCredentialRejected>> {
Ok(ListMediaItem {
cdn,
media_id,
object_length: length,
})
},
)
.try_collect()?;
}
}
}
}
Expected behavior
I expected to see the final try_collect() line align to the others.
Actual behavior
Instead, nothing changed. It does format correctly if I remove the closure return type.
(Previously filed as #7010, but I misunderstood what exactly was going wrong and it was prematurely closed.)
Configuration
rustfmt cli options used:
$ rustfmt --config=max_width=100
Meta
Reproduces in both rustfmt 1.9.0-stable (8bab26f4f6 2026-07-14) and rustfmt 1.10.0-nightly (11177f2235 2026-08-02).
Summary
I tried to format this code:
Expected behavior
I expected to see the final
try_collect()line align to the others.Actual behavior
Instead, nothing changed. It does format correctly if I remove the closure return type.
(Previously filed as #7010, but I misunderstood what exactly was going wrong and it was prematurely closed.)
Configuration
rustfmtcli options used:Meta
Reproduces in both
rustfmt 1.9.0-stable (8bab26f4f6 2026-07-14)andrustfmt 1.10.0-nightly (11177f2235 2026-08-02).