about summary refs log tree commit diff
path: root/src/librustc_mir
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-23 17:24:33 +0200
committerRalf Jung <post@ralfj.de>2020-05-25 15:44:17 +0200
commitad7179d2a409faaf45465862f44efe7f989cd71e (patch)
tree92fa4d8508c5185ebe756d7c53a5f5dd15753830 /src/librustc_mir
parent64fbe2fc485477406724a68372f4351dc7a08b0a (diff)
downloadrust-ad7179d2a409faaf45465862f44efe7f989cd71e.tar.gz
rust-ad7179d2a409faaf45465862f44efe7f989cd71e.zip
fix discriminant_ty for non-enums
Diffstat (limited to 'src/librustc_mir')
-rw-r--r--src/librustc_mir/interpret/operand.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs
index 139871310fb..f546f6236d7 100644
--- a/src/librustc_mir/interpret/operand.rs
+++ b/src/librustc_mir/interpret/operand.rs
@@ -581,10 +581,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         trace!("read_discriminant_value {:#?}", op.layout);
 
         // Get type and layout of the discriminant.
-        let discr_layout = self.layout_of(op.layout.ty.discriminant_type(*self.tcx))?;
+        let discr_layout = self.layout_of(op.layout.ty.discriminant_ty(*self.tcx))?;
         trace!("discriminant type: {:?}", discr_layout.ty);
 
-        // We use "discriminant" to refer to the value associated with a particualr enum variant.
+        // We use "discriminant" to refer to the value associated with a particular enum variant.
         // This is not to be confused with its "variant index", which is just determining its position in the
         // declared list of variants -- they can differ with explicitly assigned discriminants.
         // We use "tag" to refer to how the discriminant is encoded in memory, which can be either