Rollup merge of #120101 - mj10021:issue-120090-fix, r=WaffleLapkin

change `.unwrap()` to `?` on write where `fmt::Result` is returned

Fixes #120090 which points out that some of the `.unwrap()`s in `rustc_middle/src/mir/pretty.rs` are likely meant to be `?`s
This commit is contained in:
Matthias Krüger 2024-01-18 20:56:22 +01:00 committed by GitHub
commit ca0c740041
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1098,10 +1098,10 @@ fn pre_fmt_projection(projection: &[PlaceElem<'_>], fmt: &mut Formatter<'_>) ->
| ProjectionElem::Subtype(_)
| ProjectionElem::Downcast(_, _)
| ProjectionElem::Field(_, _) => {
write!(fmt, "(").unwrap();
write!(fmt, "(")?;
}
ProjectionElem::Deref => {
write!(fmt, "(*").unwrap();
write!(fmt, "(*")?;
}
ProjectionElem::Index(_)
| ProjectionElem::ConstantIndex { .. }