about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-18 20:56:22 +0100
committerGitHub <noreply@github.com>2024-01-18 20:56:22 +0100
commitca0c740041c9275aa3c4967ac90ebac4632218dd (patch)
tree09b8854515f7aee38bbc42b9e9efb5594a88126d /compiler/rustc_middle/src
parentc6d25cf1b05d024bd5a02be834788798bc98283e (diff)
parentc13c746b477cfa3887bd88236c452bb57048f6c6 (diff)
downloadrust-ca0c740041c9275aa3c4967ac90ebac4632218dd.tar.gz
rust-ca0c740041c9275aa3c4967ac90ebac4632218dd.zip
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
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/pretty.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs
index 2cf6410990e..3b60eba2dfe 100644
--- a/compiler/rustc_middle/src/mir/pretty.rs
+++ b/compiler/rustc_middle/src/mir/pretty.rs
@@ -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 { .. }