Allow ensure queries to return Result<(), ErrorGuaranteed>

This commit is contained in:
Oli Scherer 2023-10-18 15:53:06 +00:00
parent eb99a89bd7
commit fe8ebb1890
5 changed files with 75 additions and 9 deletions

View file

@ -25,7 +25,9 @@ use crate::mir::interpret::{
use crate::mir::interpret::{LitToConstError, LitToConstInput};
use crate::mir::mono::CodegenUnit;
use crate::query::erase::{erase, restore, Erase};
use crate::query::plumbing::{query_ensure, query_get_at, CyclePlaceholder, DynamicQuery};
use crate::query::plumbing::{
query_ensure, query_ensure_error_guaranteed, query_get_at, CyclePlaceholder, DynamicQuery,
};
use crate::thir;
use crate::traits::query::{
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
@ -967,6 +969,7 @@ rustc_queries! {
query check_mod_type_wf(key: LocalModDefId) -> Result<(), ErrorGuaranteed> {
desc { |tcx| "checking that types are well-formed in {}", describe_as_module(key, tcx) }
ensure_forwards_result_if_red
}
query collect_mod_item_types(key: LocalModDefId) -> () {
@ -1501,6 +1504,7 @@ rustc_queries! {
query check_well_formed(key: hir::OwnerId) -> Result<(), ErrorGuaranteed> {
desc { |tcx| "checking that `{}` is well-formed", tcx.def_path_str(key) }
ensure_forwards_result_if_red
}
// The `DefId`s of all non-generic functions and statics in the given crate