Skip to content

Commit dc2884f

Browse files
committed
Insert missing ensure_ok calls.
Two places where `ensure_ok` can be used but currently isn't. (These queries are marked with `return_result_from_ensure_ok`, which means that `ensure_ok` returns `Result<(), ErrorGuaranteed>`.) This is potentially a perf win, because `ensure_ok` query calls can be faster.
1 parent 28848d7 commit dc2884f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
294294

295295
// Avoid bogus move errors because of an incoherent `Copy` impl.
296296
self.infcx.type_implements_trait(copy_def_id, [ty], self.infcx.param_env).may_apply()
297-
&& self.infcx.tcx.coherent_trait(copy_def_id).is_err()
297+
&& self.infcx.tcx.ensure_ok().coherent_trait(copy_def_id).is_err()
298298
}
299299

300300
fn report_cannot_move_from_static(&mut self, place: Place<'tcx>, span: Span) -> Diag<'infcx> {

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ fn mir_borrowck(
123123
// We should eagerly check stalled coroutine obligations from HIR typeck.
124124
// Not doing so leads to silent normalization failures later, which will
125125
// fail to register opaque types in the next solver.
126-
tcx.check_coroutine_obligations(def)?;
126+
tcx.ensure_ok().check_coroutine_obligations(def)?;
127127

128128
let input_body: &Body<'_> = &input_body.borrow();
129129
if let Some(guar) = input_body.tainted_by_errors {

0 commit comments

Comments
 (0)