Plumb dyn trait representation through ty::Dynamic
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user