|
2 | 2 |
|
3 | 3 | use crate::utils::{clip, higher, sext, unsext};
|
4 | 4 | use if_chain::if_chain;
|
5 |
| -use rustc::ty::subst::{Subst, SubstsRef}; |
6 |
| -use rustc::ty::{self, Ty, TyCtxt}; |
7 |
| -use rustc::{bug, span_bug}; |
8 | 5 | use rustc_ast::ast::{FloatTy, LitFloatType, LitKind};
|
9 | 6 | use rustc_data_structures::sync::Lrc;
|
10 | 7 | use rustc_hir::def::{DefKind, Res};
|
11 | 8 | use rustc_hir::{BinOp, BinOpKind, Block, Expr, ExprKind, HirId, QPath, UnOp};
|
12 | 9 | use rustc_lint::LateContext;
|
| 10 | +use rustc_middle::ty::subst::{Subst, SubstsRef}; |
| 11 | +use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 12 | +use rustc_middle::{bug, span_bug}; |
13 | 13 | use rustc_span::symbol::Symbol;
|
14 | 14 | use std::cmp::Ordering::{self, Equal};
|
15 | 15 | use std::convert::TryInto;
|
@@ -333,7 +333,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
|
333 | 333 | .tcx
|
334 | 334 | .const_eval_resolve(self.param_env, def_id, substs, None, None)
|
335 | 335 | .ok()
|
336 |
| - .map(|val| rustc::ty::Const::from_value(self.lcx.tcx, val, ty))?; |
| 336 | + .map(|val| rustc_middle::ty::Const::from_value(self.lcx.tcx, val, ty))?; |
337 | 337 | let result = miri_to_const(&result);
|
338 | 338 | if result.is_some() {
|
339 | 339 | self.needed_resolution = true;
|
@@ -460,7 +460,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
|
460 | 460 | }
|
461 | 461 |
|
462 | 462 | pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
|
463 |
| - use rustc::mir::interpret::{ConstValue, Scalar}; |
| 463 | + use rustc_middle::mir::interpret::{ConstValue, Scalar}; |
464 | 464 | match result.val {
|
465 | 465 | ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data: d, .. })) => match result.ty.kind {
|
466 | 466 | ty::Bool => Some(Constant::Bool(d == 1)),
|
|
0 commit comments