Skip to content

Rollup of 14 pull requests #59461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
36bcbc3
Add FromStr impl for NonZero types
hellow554 Feb 25, 2019
ce30d4e
replaced nonzeroparseerror with regular interror
hellow554 Feb 27, 2019
912ad68
fixed nonzero tests
hellow554 Feb 28, 2019
ad240ea
add feature flag to test
hellow554 Feb 28, 2019
7330525
fixed tests again
hellow554 Feb 28, 2019
8740d5d
Add benchmarks for [u8]::make_ascii_uppercase
SimonSapin Mar 18, 2019
ce933f7
Make u8::to_ascii_lowercase and to_ascii_uppercase branchless
SimonSapin Mar 18, 2019
fbe34cc
Add benchmark for not-quite-correct “fake SIMD” make_ascii_uppercase
SimonSapin Mar 18, 2019
e3fb6f8
Tidy
SimonSapin Mar 18, 2019
525a043
Rename src/libcore/benches/ascii_case.rs to ascii.rs
SimonSapin Mar 18, 2019
6d3840b
Add benchmarks for `u8::is_ascii*`
SimonSapin Mar 18, 2019
b4faa9b
Remove ASCII_CHARACTER_CLASS table, use `match` with range patterns i…
SimonSapin Mar 18, 2019
4a3241a
Benchmark more possibles impls of [u8]::make_ascii_uppercase
SimonSapin Mar 18, 2019
0ad91f7
Simplify u8::to_ascii_{upp,low}ercase while keeping it fast
SimonSapin Mar 18, 2019
c1ec29a
ASCII uppercase: add "subtract shifted bool" benchmark
SimonSapin Mar 19, 2019
7fad370
ASCII uppercase: add "subtract multiplied bool" benchmark
SimonSapin Mar 19, 2019
b34a71b
add suggestions to trim_{left,right} deprecations
euclio Mar 22, 2019
ac3290e
Add suggestion to use `&*var` when `&str: From<String>` is expected
estebank Mar 18, 2019
2f7b320
extend on-unimplemented docs
estebank Mar 18, 2019
e929d19
review comments
estebank Mar 23, 2019
4b38294
syntax: Remove warning for unnecessary path disambiguators
petrochenkov Jan 13, 2019
7e156c2
Make some lints incremental
Zoxc Jun 11, 2018
32bc4a5
Make more lints incremental
Zoxc Mar 3, 2019
00d8fa3
Update tests
Zoxc Mar 13, 2019
4bad56e
When moving out of a for loop head, suggest borrowing it in nll mode
estebank Mar 26, 2019
630d5a4
renames EvalContext to InterpretCx.
kenta7777 Mar 26, 2019
0e0383a
adjust MaybeUninit API to discussions
RalfJung Mar 18, 2019
853ae8d
fix some uses I missed
RalfJung Mar 19, 2019
6ea6e62
Update jemalloc-sys to version 0.3.0
gnzlbg Mar 26, 2019
b73886d
Update Cargo.lock
gnzlbg Mar 26, 2019
4093bec
Exclude UnusedBrokenConst from module lints
Zoxc Mar 26, 2019
24a0cae
librustc_driver => 2018
taiki-e Mar 26, 2019
8733b2a
Add `Default` to `std::alloc::System`
TimDiekmann Mar 26, 2019
892f7c4
renames EvalContext to InterpretCx in docs and comments.
kenta7777 Mar 27, 2019
14f3f6c
librustc_interface => 2018
Centril Mar 26, 2019
bf1068b
librustc_interface => 2018; rename rustc-rayon to rayon in Cargo.toml
Centril Mar 27, 2019
2368aa8
Add some tests
JohnTitor Mar 27, 2019
4c76175
Rollup merge of #57293 - Zoxc:incr-passes3, r=michaelwoerister
Centril Mar 27, 2019
a489ec6
Rollup merge of #57565 - petrochenkov:turbowarn, r=Centril
Centril Mar 27, 2019
290146c
Rollup merge of #58253 - taiki-e:librustc_driver-2018, r=petrochenkov
Centril Mar 27, 2019
7070d87
Rollup merge of #58717 - hellow554:nonzero_parse, r=Amanieu
Centril Mar 27, 2019
692760d
Rollup merge of #58837 - Centril:librustc_interface_2018, r=petrochenkov
Centril Mar 27, 2019
dfce933
Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavus
Centril Mar 27, 2019
2ccc054
Rollup merge of #59283 - SimonSapin:branchless-ascii-case, r=joshtrip…
Centril Mar 27, 2019
0052b80
Rollup merge of #59284 - RalfJung:maybe-uninit, r=sfackler
Centril Mar 27, 2019
58bda0c
Rollup merge of #59372 - euclio:rename-trim, r=rkruppe
Centril Mar 27, 2019
61a8293
Rollup merge of #59429 - estebank:for-loop-move-nll, r=petrochenkov
Centril Mar 27, 2019
0ea791e
Rollup merge of #59430 - kenta7777:rename-evalcontext-to-interpretcx,…
Centril Mar 27, 2019
c22ed88
Rollup merge of #59436 - gnzlbg:update_jemalloc, r=alexcrichton
Centril Mar 27, 2019
a077493
Rollup merge of #59451 - TimDiekmann:patch-1, r=sfackler
Centril Mar 27, 2019
1d5a6b6
Rollup merge of #59459 - JohnTitor:add-tests, r=Centril
Centril Mar 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
renames EvalContext to InterpretCx.
  • Loading branch information
kenta7777 committed Mar 26, 2019
commit 630d5a489552e671bf9dc7c0e72c77b0a1ad353c
28 changes: 14 additions & 14 deletions src/librustc_mir/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use syntax::source_map::{Span, DUMMY_SP};
use crate::interpret::{self,
PlaceTy, MPlaceTy, MemPlace, OpTy, ImmTy, Immediate, Scalar, Pointer,
RawConst, ConstValue,
EvalResult, EvalError, EvalErrorKind, GlobalId, EvalContext, StackPopCleanup,
EvalResult, EvalError, EvalErrorKind, GlobalId, InterpretCx, StackPopCleanup,
Allocation, AllocId, MemoryKind,
snapshot, RefTracking,
};
Expand All @@ -47,7 +47,7 @@ pub(crate) fn mk_eval_cx<'a, 'mir, 'tcx>(
param_env: ty::ParamEnv<'tcx>,
) -> CompileTimeEvalContext<'a, 'mir, 'tcx> {
debug!("mk_eval_cx: {:?}", param_env);
EvalContext::new(tcx.at(span), param_env, CompileTimeInterpreter::new())
InterpretCx::new(tcx.at(span), param_env, CompileTimeInterpreter::new())
}

pub(crate) fn eval_promoted<'a, 'mir, 'tcx>(
Expand Down Expand Up @@ -116,7 +116,7 @@ fn eval_body_and_ecx<'a, 'mir, 'tcx>(
// and try improving it down the road when more information is available
let span = tcx.def_span(cid.instance.def_id());
let span = mir.map(|mir| mir.span).unwrap_or(span);
let mut ecx = EvalContext::new(tcx.at(span), param_env, CompileTimeInterpreter::new());
let mut ecx = InterpretCx::new(tcx.at(span), param_env, CompileTimeInterpreter::new());
let r = eval_body_using_ecx(&mut ecx, cid, mir, param_env);
(r, ecx)
}
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxHashMap<K, V> {
}

type CompileTimeEvalContext<'a, 'mir, 'tcx> =
EvalContext<'a, 'mir, 'tcx, CompileTimeInterpreter<'a, 'mir, 'tcx>>;
InterpretCx<'a, 'mir, 'tcx, CompileTimeInterpreter<'a, 'mir, 'tcx>>;

impl interpret::MayLeak for ! {
#[inline(always)]
Expand All @@ -317,12 +317,12 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
const STATIC_KIND: Option<!> = None; // no copying of statics allowed

#[inline(always)]
fn enforce_validity(_ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool {
fn enforce_validity(_ecx: &InterpretCx<'a, 'mir, 'tcx, Self>) -> bool {
false // for now, we don't enforce validity
}

fn find_fn(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: Option<PlaceTy<'tcx>>,
Expand Down Expand Up @@ -362,7 +362,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
}

fn call_intrinsic(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx>],
dest: PlaceTy<'tcx>,
Expand All @@ -378,7 +378,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
}

fn ptr_op(
_ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &InterpretCx<'a, 'mir, 'tcx, Self>,
_bin_op: mir::BinOp,
_left: ImmTy<'tcx>,
_right: ImmTy<'tcx>,
Expand Down Expand Up @@ -406,15 +406,15 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
}

fn box_alloc(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
_dest: PlaceTy<'tcx>,
) -> EvalResult<'tcx> {
Err(
ConstEvalError::NeedsRfc("heap allocations via `box` keyword".to_string()).into(),
)
}

fn before_terminator(ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx> {
fn before_terminator(ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx> {
{
let steps = &mut ecx.machine.steps_since_detector_enabled;

Expand All @@ -440,7 +440,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>

#[inline(always)]
fn tag_new_allocation(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
ptr: Pointer,
_kind: MemoryKind<Self::MemoryKinds>,
) -> Pointer {
Expand All @@ -449,15 +449,15 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>

#[inline(always)]
fn stack_push(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
) -> EvalResult<'tcx> {
Ok(())
}

/// Called immediately before a stack frame gets popped.
#[inline(always)]
fn stack_pop(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
_extra: (),
) -> EvalResult<'tcx> {
Ok(())
Expand Down Expand Up @@ -504,7 +504,7 @@ pub fn const_variant_index<'a, 'tcx>(
}

pub fn error_to_const_error<'a, 'mir, 'tcx>(
ecx: &EvalContext<'a, 'mir, 'tcx, CompileTimeInterpreter<'a, 'mir, 'tcx>>,
ecx: &InterpretCx<'a, 'mir, 'tcx, CompileTimeInterpreter<'a, 'mir, 'tcx>>,
mut error: EvalError<'tcx>
) -> ConstEvalErr<'tcx> {
error.print_backtrace();
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use rustc::mir::interpret::{
use rustc::mir::CastKind;
use rustc_apfloat::Float;

use super::{EvalContext, Machine, PlaceTy, OpTy, ImmTy, Immediate};
use super::{InterpretCx, Machine, PlaceTy, OpTy, ImmTy, Immediate};

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
fn type_is_fat_ptr(&self, ty: Ty<'tcx>) -> bool {
match ty.sty {
ty::RawPtr(ty::TypeAndMut { ty, .. }) |
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_mir/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use super::{
Memory, Machine
};

pub struct EvalContext<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'a, 'mir, 'tcx>> {
pub struct InterpretCx<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'a, 'mir, 'tcx>> {
/// Stores the `Machine` instance.
pub machine: M,

Expand Down Expand Up @@ -141,15 +141,15 @@ impl<'tcx, Tag> LocalState<'tcx, Tag> {
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> HasDataLayout
for EvalContext<'a, 'mir, 'tcx, M>
for InterpretCx<'a, 'mir, 'tcx, M>
{
#[inline]
fn data_layout(&self) -> &layout::TargetDataLayout {
&self.tcx.data_layout
}
}

impl<'a, 'mir, 'tcx, M> layout::HasTyCtxt<'tcx> for EvalContext<'a, 'mir, 'tcx, M>
impl<'a, 'mir, 'tcx, M> layout::HasTyCtxt<'tcx> for InterpretCx<'a, 'mir, 'tcx, M>
where M: Machine<'a, 'mir, 'tcx>
{
#[inline]
Expand All @@ -159,7 +159,7 @@ impl<'a, 'mir, 'tcx, M> layout::HasTyCtxt<'tcx> for EvalContext<'a, 'mir, 'tcx,
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> LayoutOf
for EvalContext<'a, 'mir, 'tcx, M>
for InterpretCx<'a, 'mir, 'tcx, M>
{
type Ty = Ty<'tcx>;
type TyLayout = EvalResult<'tcx, TyLayout<'tcx>>;
Expand All @@ -171,13 +171,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> LayoutOf
}
}

impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
pub fn new(
tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
param_env: ty::ParamEnv<'tcx>,
machine: M,
) -> Self {
EvalContext {
InterpretCx {
machine,
tcx,
param_env,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc::mir::interpret::{
};

use super::{
Machine, PlaceTy, OpTy, EvalContext,
Machine, PlaceTy, OpTy, InterpretCx,
};


Expand All @@ -36,7 +36,7 @@ fn numeric_intrinsic<'tcx, Tag>(
Ok(Scalar::from_uint(bits_out, size))
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
/// Returns `true` if emulation happened.
pub fn emulate_intrinsic(
&mut self,
Expand Down
24 changes: 12 additions & 12 deletions src/librustc_mir/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc::ty::{self, query::TyCtxtAt};

use super::{
Allocation, AllocId, EvalResult, Scalar, AllocationExtra,
EvalContext, PlaceTy, MPlaceTy, OpTy, ImmTy, Pointer, MemoryKind,
InterpretCx, PlaceTy, MPlaceTy, OpTy, ImmTy, Pointer, MemoryKind,
};

/// Whether this kind of memory is allowed to leak
Expand Down Expand Up @@ -95,11 +95,11 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
const STATIC_KIND: Option<Self::MemoryKinds>;

/// Whether to enforce the validity invariant
fn enforce_validity(ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool;
fn enforce_validity(ecx: &InterpretCx<'a, 'mir, 'tcx, Self>) -> bool;

/// Called before a basic block terminator is executed.
/// You can use this to detect endlessly running programs.
fn before_terminator(ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>;
fn before_terminator(ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>;

/// Entry point to all function calls.
///
Expand All @@ -112,7 +112,7 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
/// Passing `dest`and `ret` in the same `Option` proved very annoying when only one of them
/// was used.
fn find_fn(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, Self::PointerTag>],
dest: Option<PlaceTy<'tcx, Self::PointerTag>>,
Expand All @@ -122,7 +122,7 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
/// Directly process an intrinsic without pushing a stack frame.
/// If this returns successfully, the engine will take care of jumping to the next block.
fn call_intrinsic(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx, Self::PointerTag>],
dest: PlaceTy<'tcx, Self::PointerTag>,
Expand Down Expand Up @@ -156,21 +156,21 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
///
/// Returns a (value, overflowed) pair if the operation succeeded
fn ptr_op(
ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &InterpretCx<'a, 'mir, 'tcx, Self>,
bin_op: mir::BinOp,
left: ImmTy<'tcx, Self::PointerTag>,
right: ImmTy<'tcx, Self::PointerTag>,
) -> EvalResult<'tcx, (Scalar<Self::PointerTag>, bool)>;

/// Heap allocations via the `box` keyword.
fn box_alloc(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
dest: PlaceTy<'tcx, Self::PointerTag>,
) -> EvalResult<'tcx>;

/// Adds the tag for a newly allocated pointer.
fn tag_new_allocation(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
ptr: Pointer,
kind: MemoryKind<Self::MemoryKinds>,
) -> Pointer<Self::PointerTag>;
Expand All @@ -180,7 +180,7 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
/// `mutability` can be `None` in case a raw ptr is being dereferenced.
#[inline]
fn tag_dereference(
_ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &InterpretCx<'a, 'mir, 'tcx, Self>,
place: MPlaceTy<'tcx, Self::PointerTag>,
_mutability: Option<hir::Mutability>,
) -> EvalResult<'tcx, Scalar<Self::PointerTag>> {
Expand All @@ -190,7 +190,7 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {
/// Executes a retagging operation
#[inline]
fn retag(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
_kind: mir::RetagKind,
_place: PlaceTy<'tcx, Self::PointerTag>,
) -> EvalResult<'tcx> {
Expand All @@ -199,12 +199,12 @@ pub trait Machine<'a, 'mir, 'tcx>: Sized {

/// Called immediately before a new stack frame got pushed
fn stack_push(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
) -> EvalResult<'tcx, Self::FrameExtra>;

/// Called immediately after a stack frame gets popped
fn stack_pop(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
extra: Self::FrameExtra,
) -> EvalResult<'tcx>;
}
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod visitor;
pub use rustc::mir::interpret::*; // have all the `interpret` symbols in one place: here

pub use self::eval_context::{
EvalContext, Frame, StackPopCleanup, LocalState, LocalValue,
InterpretCx, Frame, StackPopCleanup, LocalState, LocalValue,
};

pub use self::place::{Place, PlaceTy, MemPlace, MPlaceTy};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rustc::mir::interpret::{
sign_extend, truncate,
};
use super::{
EvalContext, Machine,
InterpretCx, Machine,
MemPlace, MPlaceTy, PlaceTy, Place, MemoryKind,
};
pub use rustc::mir::interpret::ScalarMaybeUndef;
Expand Down Expand Up @@ -267,7 +267,7 @@ pub(super) fn from_known_layout<'tcx>(
}
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
/// Try reading an immediate in memory; this is interesting particularly for ScalarPair.
/// Returns `None` if the layout does not permit loading this as a value.
fn try_read_immediate_from_mplace(
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_mir/interpret/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::Float;
use rustc::mir::interpret::{EvalResult, Scalar};

use super::{EvalContext, PlaceTy, Immediate, Machine, ImmTy};
use super::{InterpretCx, PlaceTy, Immediate, Machine, ImmTy};


impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
/// Applies the binary operation `op` to the two operands and writes a tuple of the result
/// and a boolean signifying the potential overflow to the destination.
pub fn binop_with_overflow(
Expand Down Expand Up @@ -37,7 +37,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
}
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
fn binary_char_op(
&self,
bin_op: mir::BinOp,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_mir/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc::ty::TypeFoldable;

use super::{
GlobalId, AllocId, Allocation, Scalar, EvalResult, Pointer, PointerArithmetic,
EvalContext, Machine, AllocMap, AllocationExtra,
InterpretCx, Machine, AllocMap, AllocationExtra,
RawConst, Immediate, ImmTy, ScalarMaybeUndef, Operand, OpTy, MemoryKind
};

Expand Down Expand Up @@ -305,7 +305,7 @@ impl<'tcx, Tag: ::std::fmt::Debug> PlaceTy<'tcx, Tag> {
}

// separating the pointer tag for `impl Trait`, see https://github.com/rust-lang/rust/issues/54385
impl<'a, 'mir, 'tcx, Tag, M> EvalContext<'a, 'mir, 'tcx, M>
impl<'a, 'mir, 'tcx, Tag, M> InterpretCx<'a, 'mir, 'tcx, M>
where
// FIXME: Working around https://github.com/rust-lang/rust/issues/54385
Tag: ::std::fmt::Debug+Default+Copy+Eq+Hash+'static,
Expand Down Expand Up @@ -606,7 +606,7 @@ where
// global table but not in its local memory: It calls back into tcx through
// a query, triggering the CTFE machinery to actually turn this lazy reference
// into a bunch of bytes. IOW, statics are evaluated with CTFE even when
// this EvalContext uses another Machine (e.g., in miri). This is what we
// this InterpretCx uses another Machine (e.g., in miri). This is what we
// want! This way, computing statics works concistently between codegen
// and miri: They use the same query to eventually obtain a `ty::Const`
// and use that for further computation.
Expand Down
Loading