about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-01 10:10:46 +0000
committerbors <bors@rust-lang.org>2018-05-01 10:10:46 +0000
commita4a79472598e24a60301fb99f27dc688cc365d5a (patch)
treefe68f488a9b19bccc2845870fe40286543c6aaa0 /src/librustc_mir/interpret
parent0eb68b797b2d2d2ae20093b824f69fe817c96ed1 (diff)
parentf70b2ebd08f47c504681ca5f62c3ccdacdd69763 (diff)
downloadrust-a4a79472598e24a60301fb99f27dc688cc365d5a.tar.gz
rust-a4a79472598e24a60301fb99f27dc688cc365d5a.zip
Auto merge of #49724 - kennytm:range-inc-start-end-methods, r=Kimundi
Introduce RangeInclusive::{new, start, end} methods and make the fields private.

cc #49022
Diffstat (limited to 'src/librustc_mir/interpret')
-rw-r--r--src/librustc_mir/interpret/eval_context.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs
index f6e9994b5da..c8cebf8328d 100644
--- a/src/librustc_mir/interpret/eval_context.rs
+++ b/src/librustc_mir/interpret/eval_context.rs
@@ -917,8 +917,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
                 niche_start,
                 ..
             } => {
-                let variants_start = niche_variants.start as u128;
-                let variants_end = niche_variants.end as u128;
+                let variants_start = *niche_variants.start() as u128;
+                let variants_end = *niche_variants.end() as u128;
                 match raw_discr {
                     PrimVal::Ptr(_) => {
                         assert!(niche_start == 0);
@@ -984,7 +984,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
                 if variant_index != dataful_variant {
                     let (niche_dest, niche) =
                         self.place_field(dest, mir::Field::new(0), layout)?;
-                    let niche_value = ((variant_index - niche_variants.start) as u128)
+                    let niche_value = ((variant_index - niche_variants.start()) as u128)
                         .wrapping_add(niche_start);
                     self.write_primval(niche_dest, PrimVal::Bytes(niche_value), niche.ty)?;
                 }