Skip to content

Commit

Permalink
Rollup merge of #120101 - mj10021:issue-120090-fix, r=WaffleLapkin
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matthiaskrgr authored Jan 18, 2024
2 parents c6d25cf + c13c746 commit ca0c740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 { .. }
Expand Down

0 comments on commit ca0c740

Please sign in to comment.