Skip to content

Commit c2db7fa

Browse files
Rollup merge of #132403 - lcnr:typing-mode, r=compiler-errors
continue `TypingMode` refactor There are still quite a few places which (indirectly) rely on the `Reveal` of a `ParamEnv`, but we're slowly getting there r? `@compiler-errors`
2 parents 9f89421 + d7850ec commit c2db7fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_middle::mir::{
1717
};
1818
use rustc_middle::traits::{BuiltinImplSource, ImplSource, ObligationCause};
1919
use rustc_middle::ty::adjustment::PointerCoercion;
20-
use rustc_middle::ty::{self, GenericArgKind, TraitRef, Ty, TyCtxt, TypingMode};
20+
use rustc_middle::ty::{self, GenericArgKind, TraitRef, Ty, TyCtxt};
2121
use rustc_span::Span;
2222
use rustc_span::symbol::sym;
2323
use rustc_trait_selection::traits::{ObligationCtxt, SelectionContext};
@@ -420,7 +420,7 @@ fn is_ty_const_destruct<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>
420420
TraitRef::new(tcx, tcx.require_lang_item(LangItem::Destruct, Some(body.span)), [ty]),
421421
);
422422

423-
let infcx = tcx.infer_ctxt().build(TypingMode::from_param_env(obligation.param_env));
423+
let infcx = tcx.infer_ctxt().build(body.typing_mode(tcx));
424424
let mut selcx = SelectionContext::new(&infcx);
425425
let Some(impl_src) = selcx.select(&obligation).ok().flatten() else {
426426
return false;

clippy_utils/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn is_normalizable_helper<'tcx>(
362362
}
363363
// prevent recursive loops, false-negative is better than endless loop leading to stack overflow
364364
cache.insert(ty, false);
365-
let infcx = cx.tcx.infer_ctxt().build(TypingMode::from_param_env(param_env));
365+
let infcx = cx.tcx.infer_ctxt().build(cx.typing_mode());
366366
let cause = ObligationCause::dummy();
367367
let result = if infcx.at(&cause, param_env).query_normalize(ty).is_ok() {
368368
match ty.kind() {

0 commit comments

Comments
 (0)