no more Reveal :(
This commit is contained in:
parent
f4b516b10c
commit
319843d8cd
46 changed files with 112 additions and 299 deletions
|
@ -321,7 +321,7 @@ where
|
|||
|
||||
let mut candidates = vec![];
|
||||
|
||||
if let TypingMode::Coherence = self.typing_mode(goal.param_env) {
|
||||
if let TypingMode::Coherence = self.typing_mode() {
|
||||
if let Ok(candidate) = self.consider_coherence_unknowable_candidate(goal) {
|
||||
return vec![candidate];
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ where
|
|||
|
||||
self.assemble_param_env_candidates(goal, &mut candidates);
|
||||
|
||||
match self.typing_mode(goal.param_env) {
|
||||
match self.typing_mode() {
|
||||
TypingMode::Coherence => {}
|
||||
TypingMode::Analysis { .. } | TypingMode::PostAnalysis => {
|
||||
self.discard_impls_shadowed_by_env(goal, &mut candidates);
|
||||
|
|
|
@ -55,7 +55,6 @@ where
|
|||
&self,
|
||||
goal: Goal<I, T>,
|
||||
) -> (Vec<I::GenericArg>, CanonicalInput<I, T>) {
|
||||
let param_env_for_debug_assertion = goal.param_env;
|
||||
let opaque_types = self.delegate.clone_opaque_types_for_query_response();
|
||||
let (goal, opaque_types) =
|
||||
(goal, opaque_types).fold_with(&mut EagerResolver::new(self.delegate));
|
||||
|
@ -72,10 +71,7 @@ where
|
|||
.mk_predefined_opaques_in_body(PredefinedOpaquesData { opaque_types }),
|
||||
},
|
||||
);
|
||||
let query_input = ty::CanonicalQueryInput {
|
||||
canonical,
|
||||
typing_mode: self.typing_mode(param_env_for_debug_assertion),
|
||||
};
|
||||
let query_input = ty::CanonicalQueryInput { canonical, typing_mode: self.typing_mode() };
|
||||
(orig_values, query_input)
|
||||
}
|
||||
|
||||
|
|
|
@ -214,8 +214,8 @@ where
|
|||
D: SolverDelegate<Interner = I>,
|
||||
I: Interner,
|
||||
{
|
||||
pub(super) fn typing_mode(&self, param_env_for_debug_assertion: I::ParamEnv) -> TypingMode<I> {
|
||||
self.delegate.typing_mode(param_env_for_debug_assertion)
|
||||
pub(super) fn typing_mode(&self) -> TypingMode<I> {
|
||||
self.delegate.typing_mode()
|
||||
}
|
||||
|
||||
pub(super) fn set_is_normalizes_to_goal(&mut self) {
|
||||
|
|
|
@ -71,7 +71,7 @@ where
|
|||
Ok(())
|
||||
}
|
||||
ty::AliasTermKind::OpaqueTy => {
|
||||
match self.typing_mode(param_env) {
|
||||
match self.typing_mode() {
|
||||
// Opaques are never rigid outside of analysis mode.
|
||||
TypingMode::Coherence | TypingMode::PostAnalysis => Err(NoSolution),
|
||||
// During analysis, opaques are only rigid if we may not define it.
|
||||
|
|
|
@ -22,7 +22,7 @@ where
|
|||
let opaque_ty = goal.predicate.alias;
|
||||
let expected = goal.predicate.term.as_type().expect("no such thing as an opaque const");
|
||||
|
||||
match self.typing_mode(goal.param_env) {
|
||||
match self.typing_mode() {
|
||||
TypingMode::Coherence => {
|
||||
// An impossible opaque type bound is the only way this goal will fail
|
||||
// e.g. assigning `impl Copy := NotCopy`
|
||||
|
|
|
@ -67,7 +67,7 @@ where
|
|||
let maximal_certainty = match (impl_polarity, goal.predicate.polarity) {
|
||||
// In intercrate mode, this is ambiguous. But outside of intercrate,
|
||||
// it's not a real impl.
|
||||
(ty::ImplPolarity::Reservation, _) => match ecx.typing_mode(goal.param_env) {
|
||||
(ty::ImplPolarity::Reservation, _) => match ecx.typing_mode() {
|
||||
TypingMode::Coherence => Certainty::AMBIGUOUS,
|
||||
TypingMode::Analysis { .. } | TypingMode::PostAnalysis => return Err(NoSolution),
|
||||
},
|
||||
|
@ -174,7 +174,7 @@ where
|
|||
// ideally we want to avoid, since we can make progress on this goal
|
||||
// via an alias bound or a locally-inferred hidden type instead.
|
||||
if let ty::Alias(ty::Opaque, opaque_ty) = goal.predicate.self_ty().kind() {
|
||||
match ecx.typing_mode(goal.param_env) {
|
||||
match ecx.typing_mode() {
|
||||
TypingMode::Coherence | TypingMode::PostAnalysis => {
|
||||
unreachable!("rigid opaque outside of analysis: {goal:?}");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue