Skip to content

Commit 1048a85

Browse files
authored
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, r=lcnr
with_query_mode -> new r? ```@lcnr```
2 parents 73f01ff + 66b4b8b commit 1048a85

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2112,10 +2112,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
21122112
};
21132113

21142114
let obligation = obligation.with(self.tcx, trait_ref.to_poly_trait_predicate());
2115-
let mut selcx = SelectionContext::with_query_mode(
2116-
&self,
2117-
crate::traits::TraitQueryMode::Standard,
2118-
);
2115+
let mut selcx = SelectionContext::new(&self);
21192116
match selcx.select_from_obligation(&obligation) {
21202117
Ok(None) => {
21212118
let impls = ambiguity::recompute_applicable_impls(self.infcx, &obligation);

compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ use rustc_middle::ty;
22

33
use crate::infer::canonical::OriginalQueryValues;
44
use crate::infer::InferCtxt;
5-
use crate::traits::{
6-
EvaluationResult, OverflowError, PredicateObligation, SelectionContext, TraitQueryMode,
7-
};
5+
use crate::traits::{EvaluationResult, OverflowError, PredicateObligation, SelectionContext};
86

97
pub trait InferCtxtExt<'tcx> {
108
fn predicate_may_hold(&self, obligation: &PredicateObligation<'tcx>) -> bool;
@@ -97,7 +95,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
9795
match self.evaluate_obligation(obligation) {
9896
Ok(result) => result,
9997
Err(OverflowError::Canonical) => {
100-
let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
98+
let mut selcx = SelectionContext::new(&self);
10199
selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r {
102100
OverflowError::Canonical => {
103101
span_bug!(

0 commit comments

Comments
 (0)