Skip to content

Commit

Permalink
Use ensure when the result of the query is not needed beyond its `R…
Browse files Browse the repository at this point in the history
…esult`ness
  • Loading branch information
oli-obk committed Feb 8, 2024
1 parent 870a01a commit aa6f45e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn check_legal_trait_for_method_call(
};
return Err(tcx.dcx().emit_err(errors::ExplicitDestructorCall { span, sugg }));
}
tcx.coherent_trait(trait_id)
tcx.ensure().coherent_trait(trait_id)
}

#[derive(Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ fn report_conflicting_impls<'tcx>(
match used_to_be_allowed {
None => {
let reported = if overlap.with_impl.is_local()
|| tcx.orphan_check_impl(impl_def_id).is_ok()
|| tcx.ensure().orphan_check_impl(impl_def_id).is_ok()
{
let mut err = tcx.dcx().struct_span_err(impl_span, msg);
err.code(E0119);
Expand Down

0 comments on commit aa6f45e

Please sign in to comment.