1
Fork 0

Plumb dyn trait representation through ty::Dynamic

This commit is contained in:
Eric Holk 2022-04-13 16:11:28 -07:00
parent eff35e59c6
commit 6c01273a15
29 changed files with 110 additions and 57 deletions

View file

@ -69,7 +69,7 @@ impl<'a, 'tcx> VirtualIndex {
fn expect_dyn_trait_in_self<'tcx>(ty: Ty<'tcx>) -> ty::PolyExistentialTraitRef<'tcx> {
for arg in ty.peel_refs().walk() {
if let GenericArgKind::Type(ty) = arg.unpack() {
if let ty::Dynamic(data, _) = ty.kind() {
if let ty::Dynamic(data, _, _) = ty.kind() {
return data.principal().expect("expected principal trait object");
}
}