From b9dea31ea96b6eef91ab26307b0870783d4931ef Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 19 Nov 2024 19:32:52 +0100 Subject: [PATCH] `TypingMode::from_param_env` begone --- compiler/rustc_middle/src/ty/mod.rs | 6 ------ compiler/rustc_type_ir/src/infer_ctxt.rs | 14 -------------- 2 files changed, 20 deletions(-) diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index cddd6110c23..d1f8d1b0949 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1140,12 +1140,6 @@ pub struct TypingEnv<'tcx> { } impl<'tcx> TypingEnv<'tcx> { - // FIXME(#132279): This method should be removed but simplifies the - // transition. - pub fn from_param_env(param_env: ParamEnv<'tcx>) -> TypingEnv<'tcx> { - TypingEnv { typing_mode: TypingMode::from_param_env(param_env), param_env } - } - /// Create a typing environment with no where-clauses in scope /// where all opaque types and default associated items are revealed. /// diff --git a/compiler/rustc_type_ir/src/infer_ctxt.rs b/compiler/rustc_type_ir/src/infer_ctxt.rs index 105ae76708b..b01d3dc5269 100644 --- a/compiler/rustc_type_ir/src/infer_ctxt.rs +++ b/compiler/rustc_type_ir/src/infer_ctxt.rs @@ -4,10 +4,8 @@ use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable}; use rustc_type_ir_macros::{TypeFoldable_Generic, TypeVisitable_Generic}; use crate::fold::TypeFoldable; -use crate::inherent::*; use crate::relate::RelateResult; use crate::relate::combine::PredicateEmittingRelation; -use crate::solve::Reveal; use crate::{self as ty, Interner}; /// The current typing mode of an inference context. We unfortunately have some @@ -58,18 +56,6 @@ impl TypingMode { pub fn analysis_in_body(cx: I, body_def_id: I::LocalDefId) -> TypingMode { TypingMode::Analysis { defining_opaque_types: cx.opaque_types_defined_by(body_def_id) } } - - /// FIXME(#132279): Using this function is questionable as the `param_env` - /// does not track `defining_opaque_types` and whether we're in coherence mode. - /// Many uses of this function should also use a not-yet implemented typing mode - /// which reveals already defined opaque types in the future. This function will - /// get completely removed at some point. - pub fn from_param_env(param_env: I::ParamEnv) -> TypingMode { - match param_env.reveal() { - Reveal::UserFacing => TypingMode::non_body_analysis(), - Reveal::All => TypingMode::PostAnalysis, - } - } } pub trait InferCtxtLike: Sized {