rename ErrorReported -> ErrorGuaranteed

This commit is contained in:
mark 2022-01-23 12:34:26 -06:00
parent c42d846add
commit e489a94dee
112 changed files with 580 additions and 559 deletions

View file

@ -1,4 +1,4 @@
use rustc_errors::ErrorReported;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::ty::subst::SubstsRef;
@ -114,7 +114,7 @@ impl<'tcx> TypeVisitor<'tcx> for BoundVarsCollector<'tcx> {
fn resolve_instance<'tcx>(
tcx: TyCtxt<'tcx>,
key: ty::ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>,
) -> Result<Option<Instance<'tcx>>, ErrorReported> {
) -> Result<Option<Instance<'tcx>>, ErrorGuaranteed> {
let (param_env, (did, substs)) = key.into_parts();
if let Some(did) = did.as_local() {
if let Some(param_did) = tcx.opt_const_param_of(did) {
@ -128,7 +128,7 @@ fn resolve_instance<'tcx>(
fn resolve_instance_of_const_arg<'tcx>(
tcx: TyCtxt<'tcx>,
key: ty::ParamEnvAnd<'tcx, (LocalDefId, DefId, SubstsRef<'tcx>)>,
) -> Result<Option<Instance<'tcx>>, ErrorReported> {
) -> Result<Option<Instance<'tcx>>, ErrorGuaranteed> {
let (param_env, (did, const_param_did, substs)) = key.into_parts();
inner_resolve_instance(
tcx,
@ -143,7 +143,7 @@ fn resolve_instance_of_const_arg<'tcx>(
fn inner_resolve_instance<'tcx>(
tcx: TyCtxt<'tcx>,
key: ty::ParamEnvAnd<'tcx, (ty::WithOptConstParam<DefId>, SubstsRef<'tcx>)>,
) -> Result<Option<Instance<'tcx>>, ErrorReported> {
) -> Result<Option<Instance<'tcx>>, ErrorGuaranteed> {
let (param_env, (def, substs)) = key.into_parts();
let result = if let Some(trait_def_id) = tcx.trait_of_item(def.did) {
@ -203,7 +203,7 @@ fn resolve_associated_item<'tcx>(
param_env: ty::ParamEnv<'tcx>,
trait_id: DefId,
rcvr_substs: SubstsRef<'tcx>,
) -> Result<Option<Instance<'tcx>>, ErrorReported> {
) -> Result<Option<Instance<'tcx>>, ErrorGuaranteed> {
debug!(?trait_item_id, ?param_env, ?trait_id, ?rcvr_substs, "resolve_associated_item");
let trait_ref = ty::TraitRef::from_method(tcx, trait_id, rcvr_substs);
@ -281,7 +281,7 @@ fn resolve_associated_item<'tcx>(
// we know the error would've been caught (e.g. in an upstream crate).
//
// A better approach might be to just introduce a query (returning
// `Result<(), ErrorReported>`) for the check that `rustc_typeck`
// `Result<(), ErrorGuaranteed>`) for the check that `rustc_typeck`
// performs (i.e. that the definition's type in the `impl` matches
// the declaration in the `trait`), so that we can cheaply check
// here if it failed, instead of approximating it.
@ -308,7 +308,7 @@ fn resolve_associated_item<'tcx>(
let span = tcx.def_span(leaf_def.item.def_id);
tcx.sess.delay_span_bug(span, &msg);
return Err(ErrorReported);
return Err(ErrorGuaranteed);
}
}