Skip to content

Commit ca0c740

Browse files
authoredJan 18, 2024
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
2 parents c6d25cf + c13c746 commit ca0c740

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎compiler/rustc_middle/src/mir/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1098,10 +1098,10 @@ fn pre_fmt_projection(projection: &[PlaceElem<'_>], fmt: &mut Formatter<'_>) ->
10981098
| ProjectionElem::Subtype(_)
10991099
| ProjectionElem::Downcast(_, _)
11001100
| ProjectionElem::Field(_, _) => {
1101-
write!(fmt, "(").unwrap();
1101+
write!(fmt, "(")?;
11021102
}
11031103
ProjectionElem::Deref => {
1104-
write!(fmt, "(*").unwrap();
1104+
write!(fmt, "(*")?;
11051105
}
11061106
ProjectionElem::Index(_)
11071107
| ProjectionElem::ConstantIndex { .. }

0 commit comments

Comments
 (0)
Please sign in to comment.