Skip to content

Commit ea35192

Browse files
committed
Adjust imports to librustc::mir::interpret
1 parent df5e122 commit ea35192

File tree

21 files changed

+209
-102
lines changed

21 files changed

+209
-102
lines changed

src/Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustc/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ rustc_errors = { path = "../librustc_errors" }
2323
serialize = { path = "../libserialize" }
2424
syntax = { path = "../libsyntax" }
2525
syntax_pos = { path = "../libsyntax_pos" }
26+
log_settings = "0.1.1"
27+
lazy_static = "0.2.8"
28+
regex = "0.2.2"
29+
backtrace = "0.3.3"
30+
byteorder = { version = "1.1", features = ["i128"]}
31+
2632

2733
# Note that these dependencies are a lie, they're just here to get linkage to
2834
# work.

src/librustc/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#![feature(specialization)]
5555
#![feature(unboxed_closures)]
5656
#![feature(trace_macros)]
57+
#![feature(catch_expr)]
5758
#![feature(test)]
5859

5960
#![cfg_attr(stage0, feature(const_fn))]
@@ -82,6 +83,13 @@ extern crate jobserver;
8283

8384
extern crate serialize as rustc_serialize; // used by deriving
8485

86+
extern crate log_settings;
87+
extern crate byteorder;
88+
#[macro_use]
89+
extern crate lazy_static;
90+
extern crate regex;
91+
extern crate backtrace;
92+
8593
// Note that librustc doesn't actually depend on these crates, see the note in
8694
// `Cargo.toml` for this crate about why these are here.
8795
#[allow(unused_extern_crates)]

src/librustc/mir/interpret/cast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc::ty::{self, Ty};
1+
use ty::{self, Ty};
22
use syntax::ast::{FloatTy, IntTy, UintTy};
33

44
use super::{PrimVal, EvalContext, EvalResult, MemoryPointer, PointerArithmetic, Machine};
@@ -72,7 +72,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
7272
negative: bool,
7373
) -> EvalResult<'tcx, PrimVal> {
7474
trace!("cast_from_int: {}, {}, {}", v, ty, negative);
75-
use rustc::ty::TypeVariants::*;
75+
use ty::TypeVariants::*;
7676
match ty.sty {
7777
// Casts to bool are not permitted by rustc, no need to handle them here.
7878
TyInt(ty) => Ok(PrimVal::Bytes(self.int_to_int(v as i128, ty))),
@@ -94,7 +94,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
9494
}
9595

9696
fn cast_from_float(&self, val: f64, ty: Ty<'tcx>) -> EvalResult<'tcx, PrimVal> {
97-
use rustc::ty::TypeVariants::*;
97+
use ty::TypeVariants::*;
9898
match ty.sty {
9999
// Casting negative floats to unsigned integers yields zero.
100100
TyUint(_) if val < 0.0 => self.cast_from_int(0, ty, false),
@@ -109,7 +109,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
109109
}
110110

111111
fn cast_from_ptr(&self, ptr: MemoryPointer, ty: Ty<'tcx>) -> EvalResult<'tcx, PrimVal> {
112-
use rustc::ty::TypeVariants::*;
112+
use ty::TypeVariants::*;
113113
match ty.sty {
114114
// Casting to a reference or fn pointer is not permitted by rustc, no need to support it here.
115115
TyRawPtr(_) |

src/librustc/mir/interpret/const_eval.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use rustc::traits::Reveal;
2-
use rustc::ty::{self, TyCtxt, Ty, Instance, layout};
3-
use rustc::mir;
1+
use traits::Reveal;
2+
use ty::{self, TyCtxt, Ty, Instance, layout};
3+
use mir;
44

55
use syntax::ast::Mutability;
66
use syntax::codemap::Span;
@@ -83,7 +83,7 @@ pub fn eval_body_as_integer<'a, 'tcx>(
8383
let (prim, ty) = eval_body_as_primval(tcx, instance)?;
8484
let prim = prim.to_bytes()?;
8585
use syntax::ast::{IntTy, UintTy};
86-
use rustc::ty::TypeVariants::*;
86+
use ty::TypeVariants::*;
8787
use rustc_const_math::{ConstIsize, ConstUsize};
8888
Ok(match ty.sty {
8989
TyInt(IntTy::I8) => ConstInt::I8(prim as i128 as i8),

src/librustc/mir/interpret/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::error::Error;
22
use std::{fmt, env};
33

4-
use rustc::mir;
5-
use rustc::ty::{FnSig, Ty, layout};
4+
use mir;
5+
use ty::{FnSig, Ty, layout};
66

77
use super::{
88
MemoryPointer, Lock, AccessKind

0 commit comments

Comments
 (0)