Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, r=lcnr

with_query_mode -> new

r? ```@lcnr```
This commit is contained in:
Matthias Krüger 2022-11-24 21:34:57 +01:00 committed by GitHub
commit 1048a85dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -2112,10 +2112,7 @@ fn maybe_report_ambiguity(
};
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);

View File

@ -2,9 +2,7 @@
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;
@ -97,7 +95,7 @@ fn evaluate_obligation_no_overflow(
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!(