new solver: prefer trivial builtin impls over where-clauses
for now, only builtin `Sized` impls are tracked as being `Trivial`
This commit is contained in:
parent
73c0ae6aec
commit
00844be421
8 changed files with 41 additions and 6 deletions
|
@ -991,7 +991,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
|
|||
Err(ErrorGuaranteed { .. }) => true,
|
||||
}
|
||||
}
|
||||
ImplSource::Builtin(BuiltinImplSource::Misc, _) => {
|
||||
ImplSource::Builtin(BuiltinImplSource::Misc | BuiltinImplSource::Trivial, _) => {
|
||||
// While a builtin impl may be known to exist, the associated type may not yet
|
||||
// be known. Any type with multiple potential associated types is therefore
|
||||
// not eligible.
|
||||
|
@ -1296,7 +1296,7 @@ fn confirm_select_candidate<'cx, 'tcx>(
|
|||
) -> Progress<'tcx> {
|
||||
match impl_source {
|
||||
ImplSource::UserDefined(data) => confirm_impl_candidate(selcx, obligation, data),
|
||||
ImplSource::Builtin(BuiltinImplSource::Misc, data) => {
|
||||
ImplSource::Builtin(BuiltinImplSource::Misc | BuiltinImplSource::Trivial, data) => {
|
||||
let tcx = selcx.tcx();
|
||||
let trait_def_id = obligation.predicate.trait_def_id(tcx);
|
||||
if tcx.is_lang_item(trait_def_id, LangItem::Coroutine) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue