about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/debuginfo
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <eddyb@lyken.rs>2021-08-25 18:05:10 +0300
committerEduard-Mihai Burtescu <eddyb@lyken.rs>2021-08-30 00:44:09 +0300
commit8e6d126b7d69281072f16dcc3cfff140e8947c58 (patch)
tree293ebfbe26edb8e4baf22cec93eb517f2f1c6714 /compiler/rustc_codegen_cranelift/src/debuginfo
parent87d1fb747f8ed3dde3cd36c17d1ef735872a7bf9 (diff)
downloadrust-8e6d126b7d69281072f16dcc3cfff140e8947c58.tar.gz
rust-8e6d126b7d69281072f16dcc3cfff140e8947c58.zip
rustc_target: `TyAndLayout::field` should never error.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs b/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs
index c471da83de2..95216f1c3d7 100644
--- a/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/debuginfo/mod.rs
@@ -160,12 +160,10 @@ impl<'tcx> DebugContext<'tcx> {
 
                 for (field_idx, field_def) in variant.fields.iter().enumerate() {
                     let field_offset = layout.fields.offset(field_idx);
-                    let field_layout = layout
-                        .field(
-                            &layout::LayoutCx { tcx: self.tcx, param_env: ParamEnv::reveal_all() },
-                            field_idx,
-                        )
-                        .unwrap();
+                    let field_layout = layout.field(
+                        &layout::LayoutCx { tcx: self.tcx, param_env: ParamEnv::reveal_all() },
+                        field_idx,
+                    );
 
                     let field_type = self.dwarf_ty(field_layout.ty);