diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2018-08-23 16:34:38 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-09-30 17:27:06 +0200 |
| commit | bd3c7812cbadf875ebcc79d65a1f65c29dea0c8c (patch) | |
| tree | 3dda20f43364bb563a0551efdb5459761dbc5b8e /src/librustc_codegen_llvm/mir | |
| parent | f9bbb5f31df8232fb1e17a3408b62590c30112c7 (diff) | |
| download | rust-bd3c7812cbadf875ebcc79d65a1f65c29dea0c8c.tar.gz rust-bd3c7812cbadf875ebcc79d65a1f65c29dea0c8c.zip | |
use is_uninhabited in more places
Diffstat (limited to 'src/librustc_codegen_llvm/mir')
| -rw-r--r-- | src/librustc_codegen_llvm/mir/place.rs | 4 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/mir/rvalue.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/mir/place.rs b/src/librustc_codegen_llvm/mir/place.rs index c781b456af6..e7b6f5908a4 100644 --- a/src/librustc_codegen_llvm/mir/place.rs +++ b/src/librustc_codegen_llvm/mir/place.rs @@ -275,7 +275,7 @@ impl PlaceRef<'ll, 'tcx> { /// Obtain the actual discriminant of a value. pub fn codegen_get_discr(self, bx: &Builder<'a, 'll, 'tcx>, cast_to: Ty<'tcx>) -> &'ll Value { let cast_to = bx.cx.layout_of(cast_to).immediate_llvm_type(bx.cx); - if self.layout.abi == layout::Abi::Uninhabited { + if self.layout.abi.is_uninhabited() { return C_undef(cast_to); } match self.layout.variants { @@ -338,7 +338,7 @@ impl PlaceRef<'ll, 'tcx> { /// Set the discriminant for a new value of the given case of the given /// representation. pub fn codegen_set_discr(&self, bx: &Builder<'a, 'll, 'tcx>, variant_index: usize) { - if self.layout.for_variant(bx.cx, variant_index).abi == layout::Abi::Uninhabited { + if self.layout.for_variant(bx.cx, variant_index).abi.is_uninhabited() { return; } match self.layout.variants { diff --git a/src/librustc_codegen_llvm/mir/rvalue.rs b/src/librustc_codegen_llvm/mir/rvalue.rs index c3ec347f608..fa22bdff94d 100644 --- a/src/librustc_codegen_llvm/mir/rvalue.rs +++ b/src/librustc_codegen_llvm/mir/rvalue.rs @@ -290,7 +290,7 @@ impl FunctionCx<'a, 'll, 'tcx> { mir::CastKind::Misc => { assert!(cast.is_llvm_immediate()); let ll_t_out = cast.immediate_llvm_type(bx.cx); - if operand.layout.abi == layout::Abi::Uninhabited { + if operand.layout.abi.is_uninhabited() { return (bx, OperandRef { val: OperandValue::Immediate(C_undef(ll_t_out)), layout: cast, |
