Skip to content

Commit

Permalink
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query…
Browse files Browse the repository at this point in the history
…_mode, r=lcnr

with_query_mode -> new

r? ``@lcnr``
  • Loading branch information
matthiaskrgr authored Nov 24, 2022
2 parents 97d71bb + 66b4b8b commit 0fd2585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2112,10 +2112,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
};

let obligation = obligation.with(self.tcx, trait_ref.to_poly_trait_predicate());
let mut selcx = SelectionContext::with_query_mode(
&self,
crate::traits::TraitQueryMode::Standard,
);
let mut selcx = SelectionContext::new(&self);
match selcx.select_from_obligation(&obligation) {
Ok(None) => {
let impls = ambiguity::recompute_applicable_impls(self.infcx, &obligation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use rustc_middle::ty;

use crate::infer::canonical::OriginalQueryValues;
use crate::infer::InferCtxt;
use crate::traits::{
EvaluationResult, OverflowError, PredicateObligation, SelectionContext, TraitQueryMode,
};
use crate::traits::{EvaluationResult, OverflowError, PredicateObligation, SelectionContext};

pub trait InferCtxtExt<'tcx> {
fn predicate_may_hold(&self, obligation: &PredicateObligation<'tcx>) -> bool;
Expand Down Expand Up @@ -97,7 +95,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
match self.evaluate_obligation(obligation) {
Ok(result) => result,
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 {
OverflowError::Canonical => {
span_bug!(
Expand Down

0 comments on commit 0fd2585

Please sign in to comment.