1
Fork 0

Rollup merge of #128160 - compiler-errors:auto, r=jackh726

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

Kinda a pointless change to make, but it's observable w/o the feature gate, so let's just fix it. I reintroduced this ICE when I removed the "auto impl" kind from `ImplSource` in #112687.

Fixes #117829
Fixes #127746
This commit is contained in:
Matthias Krüger 2024-07-25 04:43:20 +02:00 committed by GitHub
commit 1fda084290
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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:?}")
}