about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-13 10:44:50 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-13 10:44:54 +0000
commitd3a89cd214a41e8c339db0baf6fc7acb463e64ec (patch)
tree9860f764ddadf3a6943e9b9e2a265171bb562bb8 /compiler/rustc_borrowck/src
parent09d73fab0823ecddd5e67e042cd0de3863c3d501 (diff)
downloadrust-d3a89cd214a41e8c339db0baf6fc7acb463e64ec.tar.gz
rust-d3a89cd214a41e8c339db0baf6fc7acb463e64ec.zip
Avoid an ICE in diagnostics
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
index b3d684086c2..65643e93d27 100644
--- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
@@ -698,7 +698,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
                                     ),
                                 ..
                             }) => {
-                                let hir::Ty { span, .. } = inputs[local.index() - 1];
+                                let hir::Ty { span, .. } = *inputs.get(local.index() - 1)?;
                                 Some(span)
                             }
                             _ => None,