mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
with_query_mode -> new
This commit is contained in:
parent
341d8b8a2c
commit
66b4b8b907
@ -2112,10 +2112,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let obligation = obligation.with(self.tcx, trait_ref.to_poly_trait_predicate());
|
let obligation = obligation.with(self.tcx, trait_ref.to_poly_trait_predicate());
|
||||||
let mut selcx = SelectionContext::with_query_mode(
|
let mut selcx = SelectionContext::new(&self);
|
||||||
&self,
|
|
||||||
crate::traits::TraitQueryMode::Standard,
|
|
||||||
);
|
|
||||||
match selcx.select_from_obligation(&obligation) {
|
match selcx.select_from_obligation(&obligation) {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
let impls = ambiguity::recompute_applicable_impls(self.infcx, &obligation);
|
let impls = ambiguity::recompute_applicable_impls(self.infcx, &obligation);
|
||||||
|
@ -2,9 +2,7 @@ use rustc_middle::ty;
|
|||||||
|
|
||||||
use crate::infer::canonical::OriginalQueryValues;
|
use crate::infer::canonical::OriginalQueryValues;
|
||||||
use crate::infer::InferCtxt;
|
use crate::infer::InferCtxt;
|
||||||
use crate::traits::{
|
use crate::traits::{EvaluationResult, OverflowError, PredicateObligation, SelectionContext};
|
||||||
EvaluationResult, OverflowError, PredicateObligation, SelectionContext, TraitQueryMode,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub trait InferCtxtExt<'tcx> {
|
pub trait InferCtxtExt<'tcx> {
|
||||||
fn predicate_may_hold(&self, obligation: &PredicateObligation<'tcx>) -> bool;
|
fn predicate_may_hold(&self, obligation: &PredicateObligation<'tcx>) -> bool;
|
||||||
@ -97,7 +95,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
|
|||||||
match self.evaluate_obligation(obligation) {
|
match self.evaluate_obligation(obligation) {
|
||||||
Ok(result) => result,
|
Ok(result) => result,
|
||||||
Err(OverflowError::Canonical) => {
|
Err(OverflowError::Canonical) => {
|
||||||
let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
|
let mut selcx = SelectionContext::new(&self);
|
||||||
selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r {
|
selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r {
|
||||||
OverflowError::Canonical => {
|
OverflowError::Canonical => {
|
||||||
span_bug!(
|
span_bug!(
|
||||||
|
Loading…
Reference in New Issue
Block a user