Skip to content

Commit

Permalink
Unrolled build for rust-lang#120101
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#120101 - mj10021:issue-120090-fix, r=WaffleLapkin

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

Fixes rust-lang#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
rust-timer authored Jan 19, 2024
2 parents 16fadb3 + c13c746 commit e912234
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 e912234

Please sign in to comment.