Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis
Support default-body trait functions with return-position `impl Trait` in traits Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form. This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later. Fixes #101665
This commit is contained in:
commit
0938e1680d
14 changed files with 166 additions and 129 deletions
|
@ -340,10 +340,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
|
|||
..
|
||||
}) => {
|
||||
if in_trait {
|
||||
span_bug!(item.span, "impl-trait in trait has no default")
|
||||
} else {
|
||||
find_opaque_ty_constraints_for_rpit(tcx, def_id, owner)
|
||||
assert!(tcx.impl_defaultness(owner).has_value());
|
||||
}
|
||||
find_opaque_ty_constraints_for_rpit(tcx, def_id, owner)
|
||||
}
|
||||
ItemKind::Trait(..)
|
||||
| ItemKind::TraitAlias(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue