1
Fork 0

Don't ICE when auto trait has assoc ty in old solver

This commit is contained in:
Michael Goulet 2024-07-24 17:19:41 -04:00
parent 2ccafed862
commit 0919d0714e
6 changed files with 103 additions and 23 deletions

View file

@ -1202,6 +1202,12 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
false
}
}
} else if tcx.trait_is_auto(trait_ref.def_id) {
tcx.dcx().span_delayed_bug(
tcx.def_span(obligation.predicate.def_id),
"associated types not allowed on auto traits",
);
false
} else {
bug!("unexpected builtin trait with associated type: {trait_ref:?}")
}