Skip to content

Commit e22f0e3

Browse files
committed
fix NormalizesTo exception
1 parent 5fa04d4 commit e22f0e3

File tree

1 file changed

+12
-2
lines changed
  • compiler/rustc_trait_selection/src/solve/inspect

1 file changed

+12
-2
lines changed

compiler/rustc_trait_selection/src/solve/inspect/analyse.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
6767
}
6868

6969
for &goal in &instantiated_goals {
70+
// We need to be careful with `NormalizesTo` goals as the
71+
// expected term has to be replaced with an unconstrained
72+
// inference variable.
73+
if let Some(kind) = goal.predicate.kind().no_bound_vars()
74+
&& let ty::PredicateKind::NormalizesTo(_) = kind
75+
{
76+
// FIXME: We currently skip these goals as
77+
// `fn evaluate_root_goal` ICEs if there are any
78+
// `NestedNormalizationGoals`.
79+
continue;
80+
};
7081
let (_, proof_tree) = infcx.evaluate_root_goal(goal, GenerateProofTree::Yes);
7182
let proof_tree = proof_tree.unwrap();
7283
try_visit!(visitor.visit_goal(&InspectGoal::new(
@@ -106,8 +117,7 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
106117
// expected term has to be replaced with an unconstrained
107118
// inference variable.
108119
if let Some(kind) = goal.predicate.kind().no_bound_vars()
109-
&& let ty::PredicateKind::NormalizesTo(predicate) = kind
110-
&& !predicate.alias.is_opaque(infcx.tcx)
120+
&& let ty::PredicateKind::NormalizesTo(_) = kind
111121
{
112122
// FIXME: We currently skip these goals as
113123
// `fn evaluate_root_goal` ICEs if there are any

0 commit comments

Comments
 (0)