diff options
| author | Florian Sextl <florian.sextl@tuwien.ac.at> | 2025-06-28 13:54:44 +0200 |
|---|---|---|
| committer | Florian Sextl <florian.sextl@tuwien.ac.at> | 2025-06-28 14:47:27 +0200 |
| commit | 1c25bfba9d5bc6e4dfc295e016aac32ff0546f97 (patch) | |
| tree | 5864939a54cf094aa9d6bfcfb9f8fa99cb406928 /compiler/rustc_codegen_ssa/src | |
| parent | 3d968973c9563fb19ef041145b8e0ef7bb183b85 (diff) | |
| download | rust-1c25bfba9d5bc6e4dfc295e016aac32ff0546f97.tar.gz rust-1c25bfba9d5bc6e4dfc295e016aac32ff0546f97.zip | |
move discr=varid check to layout_sanity_check
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/operand.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 99957c67708..da615cc9a00 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -479,17 +479,8 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { _ => (tag_imm, bx.cx().immediate_backend_type(tag_op.layout)), }; - // Layout ensures that we only get here for cases where the discriminant + // `layout_sanity_check` ensures that we only get here for cases where the discriminant // value and the variant index match, since that's all `Niche` can encode. - // But for emphasis and debugging, let's double-check one anyway. - debug_assert_eq!( - self.layout - .ty - .discriminant_for_variant(bx.tcx(), untagged_variant) - .unwrap() - .val, - u128::from(untagged_variant.as_u32()), - ); let relative_max = niche_variants.end().as_u32() - niche_variants.start().as_u32(); |
