Skip to content

Commit c8a6933

Browse files
committed
alias-relate: add fast reject optimization
1 parent 748941d commit c8a6933

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_trait_selection/src/solve/alias_relate.rs

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
3939
return Err(NoSolution);
4040
}
4141

42+
if self.fast_reject_unnameable_rigid_term(param_env, lhs, rhs)
43+
|| self.fast_reject_unnameable_rigid_term(param_env, rhs, lhs)
44+
{
45+
return Err(NoSolution);
46+
}
47+
4248
// Structurally normalize the lhs.
4349
let lhs = if let Some(alias) = lhs.to_alias_term() {
4450
let term = self.next_term_infer_of_kind(lhs);

0 commit comments

Comments
 (0)