Introduce trivial WF functions, use it in fast path
This commit is contained in:
@@ -143,6 +143,16 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
|
||||
None
|
||||
}
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
|
||||
let arg = self.shallow_resolve_term(arg);
|
||||
if arg.is_trivially_wf(self.tcx) {
|
||||
Some(Certainty::Yes)
|
||||
} else if arg.is_infer() {
|
||||
Some(Certainty::AMBIGUOUS)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user