diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-19 14:13:22 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-19 14:54:31 +0000 |
| commit | 3f15521396f684eaef2a8293a19fd6d109d79f7a (patch) | |
| tree | 23618de7f94436a362f40f85a7769777ab4f5b4d /compiler/rustc_codegen_ssa | |
| parent | d7f9e81650dcee3e2d5ad1973a71da644a2eff93 (diff) | |
| download | rust-3f15521396f684eaef2a8293a19fd6d109d79f7a.tar.gz rust-3f15521396f684eaef2a8293a19fd6d109d79f7a.zip | |
Add `GenericArgKind::as_{type,const,region}`
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/meth.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/meth.rs b/compiler/rustc_codegen_ssa/src/meth.rs index 2421acab471..81b49afb883 100644 --- a/compiler/rustc_codegen_ssa/src/meth.rs +++ b/compiler/rustc_codegen_ssa/src/meth.rs @@ -67,10 +67,10 @@ impl<'a, 'tcx> VirtualIndex { /// ref of the type. fn expect_dyn_trait_in_self(ty: Ty<'_>) -> ty::PolyExistentialTraitRef<'_> { for arg in ty.peel_refs().walk() { - if let GenericArgKind::Type(ty) = arg.unpack() { - if let ty::Dynamic(data, _, _) = ty.kind() { - return data.principal().expect("expected principal trait object"); - } + if let GenericArgKind::Type(ty) = arg.unpack() + && let ty::Dynamic(data, _, _) = ty.kind() + { + return data.principal().expect("expected principal trait object"); } } |
