Merge pull request #370 from alexreg/nightly-fix
Fixed build for latest rust master
This commit is contained in:
commit
76573bac16
3 changed files with 9 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ use rustc::hir::def_id::{DefId, CRATE_DEF_INDEX};
|
|||
use rustc::mir;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use rustc_data_structures::indexed_vec::Idx;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use syntax::attr;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ fn write_discriminant_value<'a, 'mir, 'tcx: 'a + 'mir>(
|
|||
if variant_index != dataful_variant {
|
||||
let (niche_dest, niche) =
|
||||
ecx.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);
|
||||
ecx.write_primval(niche_dest, PrimVal::Bytes(niche_value), niche.ty)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
use super::{Pointer, EvalResult, PrimVal, EvalContext};
|
||||
use mir;
|
||||
use rustc::ty::Ty;
|
||||
use rustc::ty::layout::LayoutOf;
|
||||
|
||||
use super::{Pointer, EvalResult, PrimVal, EvalContext};
|
||||
|
||||
pub trait EvalContextExt<'tcx> {
|
||||
fn wrapping_pointer_offset(
|
||||
&self,
|
||||
|
|
@ -63,7 +65,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
|
|||
}
|
||||
Ok(ptr)
|
||||
} else {
|
||||
err!(OverflowingMath)
|
||||
err!(Overflow(mir::BinOp::Mul))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#![feature(
|
||||
rustc_private,
|
||||
catch_expr,
|
||||
inclusive_range_fields
|
||||
inclusive_range_fields,
|
||||
inclusive_range_methods,
|
||||
)]
|
||||
|
||||
#[macro_use]
|
||||
|
|
@ -13,6 +14,7 @@ extern crate rustc;
|
|||
extern crate rustc_mir;
|
||||
extern crate rustc_target;
|
||||
extern crate rustc_data_structures;
|
||||
extern crate rustc_target;
|
||||
extern crate syntax;
|
||||
extern crate regex;
|
||||
#[macro_use]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue