We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35392dd commit 63c2199Copy full SHA for 63c2199
compiler/rustc_trait_selection/src/solve/project_goals/opaques.rs
@@ -53,6 +53,20 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
53
return self.flounder(&matches);
54
}
55
56
+
57
+ let expected = match self.try_normalize_ty(goal.param_env, expected) {
58
+ Some(ty) => if ty.is_ty_var() {
59
+ return self.evaluate_added_goals_and_make_canonical_response(
60
+ Certainty::AMBIGUOUS,
61
+ )
62
+ } else {
63
+ ty
64
+ },
65
+ None => return self.evaluate_added_goals_and_make_canonical_response(
66
+ Certainty::OVERFLOW,
67
+ ),
68
+ };
69
70
// Otherwise, define a new opaque type
71
self.insert_hidden_type(opaque_type_key, goal.param_env, expected)?;
72
self.add_item_bounds_for_hidden_type(
0 commit comments