]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/place_op.rs
Rollup merge of #103924 - PeteDevoy:patch-1, r=estebank
[rust.git] / compiler / rustc_hir_typeck / src / place_op.rs
index ba8cf6926f30b19e1b3800043f7316a2fa6da176..952ea14887f7bc7f279de7c1863e523c61c0195a 100644 (file)
@@ -90,8 +90,11 @@ fn negative_index(
                 Applicability::MachineApplicable,
             );
         }
-        err.emit();
-        Some((self.tcx.ty_error(), self.tcx.ty_error()))
+        let reported = err.emit();
+        Some((
+            self.tcx.ty_error_with_guaranteed(reported),
+            self.tcx.ty_error_with_guaranteed(reported),
+        ))
     }
 
     /// To type-check `base_expr[index_expr]`, we progressively autoderef