Make sure type_param_predicates resolves correctly for RPITIT
This commit is contained in:
parent
298c7462c3
commit
d53ca63453
@ -764,6 +764,16 @@ pub(super) fn type_param_predicates<'tcx>(
|
|||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
(item_def_id, def_id, assoc_name): (LocalDefId, LocalDefId, Ident),
|
(item_def_id, def_id, assoc_name): (LocalDefId, LocalDefId, Ident),
|
||||||
) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
|
) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
|
||||||
|
match tcx.opt_rpitit_info(item_def_id.to_def_id()) {
|
||||||
|
Some(ty::ImplTraitInTraitData::Trait { opaque_def_id, .. }) => {
|
||||||
|
return tcx.type_param_predicates((opaque_def_id.expect_local(), def_id, assoc_name));
|
||||||
|
}
|
||||||
|
Some(ty::ImplTraitInTraitData::Impl { .. }) => {
|
||||||
|
unreachable!("should not be lowering bounds on RPITIT in impl")
|
||||||
|
}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
|
||||||
use rustc_hir::*;
|
use rustc_hir::*;
|
||||||
use rustc_middle::ty::Ty;
|
use rustc_middle::ty::Ty;
|
||||||
|
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
//@ check-pass
|
||||||
|
|
||||||
|
// Ensure that we can resolve a shorthand projection in an item bound in an RPITIT.
|
||||||
|
|
||||||
|
pub trait Bar {
|
||||||
|
type Foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Baz {
|
||||||
|
fn boom<X: Bar>() -> impl Bar<Foo = X::Foo>;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Reference in New Issue
Block a user