Use predicate_must_hold_modulo_regions
This commit is contained in:
parent
63be7a2424
commit
b3edd9f775
2 changed files with 8 additions and 14 deletions
|
@ -2,10 +2,10 @@ pub mod on_unimplemented;
|
||||||
pub mod suggestions;
|
pub mod suggestions;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
EvaluationResult, FulfillmentContext, FulfillmentError, FulfillmentErrorCode,
|
FulfillmentContext, FulfillmentError, FulfillmentErrorCode, MismatchedProjectionTypes,
|
||||||
MismatchedProjectionTypes, Obligation, ObligationCause, ObligationCauseCode,
|
Obligation, ObligationCause, ObligationCauseCode, OnUnimplementedDirective,
|
||||||
OnUnimplementedDirective, OnUnimplementedNote, OutputTypeParameterMismatch, Overflow,
|
OnUnimplementedNote, OutputTypeParameterMismatch, Overflow, PredicateObligation,
|
||||||
PredicateObligation, SelectionContext, SelectionError, TraitNotObjectSafe,
|
SelectionContext, SelectionError, TraitNotObjectSafe,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::infer::error_reporting::{TyCategory, TypeAnnotationNeeded as ErrorCode};
|
use crate::infer::error_reporting::{TyCategory, TypeAnnotationNeeded as ErrorCode};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use super::{
|
use super::{
|
||||||
EvaluationResult, Obligation, ObligationCause, ObligationCauseCode, PredicateObligation,
|
Obligation, ObligationCause, ObligationCauseCode, PredicateObligation, SelectionContext,
|
||||||
SelectionContext,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::autoderef::Autoderef;
|
use crate::autoderef::Autoderef;
|
||||||
|
@ -839,15 +838,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
let new_obligation =
|
let new_obligation =
|
||||||
self.mk_trait_obligation_with_new_self_ty(obligation.param_env, trait_pred_and_self);
|
self.mk_trait_obligation_with_new_self_ty(obligation.param_env, trait_pred_and_self);
|
||||||
|
|
||||||
match self.evaluate_obligation(&new_obligation) {
|
if !self.predicate_must_hold_modulo_regions(&new_obligation) {
|
||||||
Ok(
|
return false;
|
||||||
EvaluationResult::EvaluatedToOk
|
|
||||||
| EvaluationResult::EvaluatedToOkModuloRegions
|
|
||||||
| EvaluationResult::EvaluatedToOkModuloOpaqueTypes
|
|
||||||
| EvaluationResult::EvaluatedToAmbig,
|
|
||||||
) => {}
|
|
||||||
_ => return false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let hir = self.tcx.hir();
|
let hir = self.tcx.hir();
|
||||||
// Get the name of the callable and the arguments to be used in the suggestion.
|
// Get the name of the callable and the arguments to be used in the suggestion.
|
||||||
let (snippet, sugg) = match hir.get_if_local(def_id) {
|
let (snippet, sugg) = match hir.get_if_local(def_id) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue