TypingMode::from_param_env begone

This commit is contained in:
lcnr 2024-11-19 19:32:52 +01:00
parent d667dd5677
commit b9dea31ea9
2 changed files with 0 additions and 20 deletions

View File

@ -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.
///

View File

@ -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<I: Interner> TypingMode<I> {
pub fn analysis_in_body(cx: I, body_def_id: I::LocalDefId) -> TypingMode<I> {
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<I> {
match param_env.reveal() {
Reveal::UserFacing => TypingMode::non_body_analysis(),
Reveal::All => TypingMode::PostAnalysis,
}
}
}
pub trait InferCtxtLike: Sized {