mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
TypingMode::from_param_env
begone
This commit is contained in:
parent
d667dd5677
commit
b9dea31ea9
@ -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.
|
||||
///
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user