Opt-in diagnostics reporting to avoid doing extra work in the new solver
This commit is contained in:
@@ -15,7 +15,7 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::symbol::sym;
|
||||
|
||||
use crate::traits::FulfillmentError;
|
||||
use crate::traits::{FulfillmentError, ScrubbedTraitError};
|
||||
|
||||
use super::eval_ctxt::GenerateProofTree;
|
||||
use super::inspect::{self, ProofTreeInferCtxtExt, ProofTreeVisitor};
|
||||
@@ -226,6 +226,17 @@ impl<'tcx> FromSolverError<'tcx, NextSolverError<'tcx>> for FulfillmentError<'tc
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> FromSolverError<'tcx, NextSolverError<'tcx>> for ScrubbedTraitError {
|
||||
fn from_solver_error(_infcx: &InferCtxt<'tcx>, error: NextSolverError<'tcx>) -> Self {
|
||||
match error {
|
||||
NextSolverError::TrueError(_) => ScrubbedTraitError::TrueError,
|
||||
NextSolverError::Ambiguity(_) | NextSolverError::Overflow(_) => {
|
||||
ScrubbedTraitError::Ambiguity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn fulfillment_error_for_no_solution<'tcx>(
|
||||
infcx: &InferCtxt<'tcx>,
|
||||
root_obligation: PredicateObligation<'tcx>,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
use rustc_ast_ir::try_visit;
|
||||
use rustc_ast_ir::visit::VisitorResult;
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk};
|
||||
use rustc_infer::traits::FulfillmentErrorLike as _;
|
||||
use rustc_macros::extension;
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::traits::solve::{inspect, QueryResult};
|
||||
|
||||
Reference in New Issue
Block a user