diff options
| author | Ralf Jung <post@ralfj.de> | 2020-05-23 17:24:33 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-05-25 15:44:17 +0200 |
| commit | ad7179d2a409faaf45465862f44efe7f989cd71e (patch) | |
| tree | 92fa4d8508c5185ebe756d7c53a5f5dd15753830 /src/librustc_mir | |
| parent | 64fbe2fc485477406724a68372f4351dc7a08b0a (diff) | |
| download | rust-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.rs | 4 |
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 |
