Skip to content

Commit

Permalink
More rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Apr 1, 2020
1 parent 1fe4476 commit 83fa296
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/bin/rust_semver_public.rs
@@ -1,8 +1,8 @@
#![feature(rustc_private)]

extern crate rustc;
extern crate rustc_driver;
extern crate rustc_interface;
extern crate rustc_middle;
extern crate rustc_span;

use log::debug;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/rust_semverver.rs
@@ -1,10 +1,10 @@
#![feature(rustc_private)]

extern crate rustc;
extern crate rustc_driver;
extern crate rustc_errors;
extern crate rustc_interface;
extern crate rustc_metadata;
extern crate rustc_middle;
extern crate rustc_span;

use log::debug;
Expand Down
2 changes: 1 addition & 1 deletion src/changes.rs
Expand Up @@ -9,8 +9,8 @@
//! complicated by the fact that we still group changes by the item they refer to, even if it's
//! path changes.

use rustc::ty::{error::TypeError, Predicate};
use rustc_hir::def_id::DefId;
use rustc_middle::ty::{error::TypeError, Predicate};
use rustc_session::Session;
use rustc_span::symbol::Symbol;
use rustc_span::{FileName, Span};
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -3,10 +3,10 @@
#![allow(clippy::single_match_else)]
#![allow(clippy::too_many_lines)]
#![deny(warnings)]
extern crate rustc;
extern crate rustc_ast;
extern crate rustc_hir;
extern crate rustc_infer;
extern crate rustc_middle;
extern crate rustc_mir;
extern crate rustc_session;
extern crate rustc_span;
Expand Down
8 changes: 4 additions & 4 deletions src/mapping.rs
Expand Up @@ -3,16 +3,16 @@
//! This module provides facilities to record item correspondence of various kinds, as well as a
//! map used to temporarily match up unsorted item sequences' elements by name.

use rustc::{
hir::exports::Export,
ty::{AssocKind, GenericParamDef, GenericParamDefKind},
};
use rustc_ast::ast::Name;
use rustc_hir::{
def::Res,
def_id::{CrateNum, DefId},
HirId,
};
use rustc_middle::{
hir::exports::Export,
ty::{AssocKind, GenericParamDef, GenericParamDefKind},
};
use std::collections::{BTreeSet, HashMap, HashSet, VecDeque};
use std::hash::{Hash, Hasher};

Expand Down
10 changes: 5 additions & 5 deletions src/mismatch.rs
Expand Up @@ -6,14 +6,14 @@

use crate::mapping::IdMapping;
use log::debug;
use rustc::ty::{
use rustc_hir::def::{DefKind, Res};
use rustc_middle::ty::{
self,
relate::{Relate, RelateResult, TypeRelation},
subst::SubstsRef,
ParamEnv, Ty, TyCtxt,
Visibility::Public,
};
use rustc_hir::def::{DefKind, Res};
use std::collections::{HashMap, HashSet, VecDeque};

/// A relation searching for items appearing at the same spot in a type.
Expand Down Expand Up @@ -49,7 +49,7 @@ impl<'a, 'tcx> MismatchRelation<'a, 'tcx> {

/// Process the next pair of `DefId`s in the queue.
pub fn process(&mut self) {
// use rustc::hir::def::DefKind::*;
// use rustc_middle::hir::def::DefKind::*;

while let Some((old_res, new_res)) = self.item_queue.pop_front() {
debug!(
Expand Down Expand Up @@ -85,7 +85,7 @@ impl<'a, 'tcx> MismatchRelation<'a, 'tcx> {

/// Ensure that the pair of given `SubstsRef`s is suitable to be related.
fn check_substs(&self, a_substs: SubstsRef<'tcx>, b_substs: SubstsRef<'tcx>) -> bool {
use rustc::ty::subst::GenericArgKind::*;
use rustc_middle::ty::subst::GenericArgKind::*;

for (a, b) in a_substs.iter().zip(b_substs) {
match (a.unpack(), b.unpack()) {
Expand Down Expand Up @@ -130,7 +130,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
}

fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
use rustc::ty::TyKind;
use rustc_middle::ty::TyKind;

if self.current_old_types.contains(a) || self.current_new_types.contains(b) {
return Ok(self.tcx.types.err);
Expand Down
32 changes: 16 additions & 16 deletions src/translate.rs
Expand Up @@ -3,13 +3,13 @@

use crate::mapping::{IdMapping, InherentEntry};
use log::{debug, info};
use rustc::ty::{
use rustc_hir::def_id::DefId;
use rustc_infer::infer::InferCtxt;
use rustc_middle::ty::{
fold::{BottomUpFolder, TypeFoldable, TypeFolder},
subst::{GenericArg, InternalSubsts, SubstsRef},
GenericParamDefKind, ParamEnv, Predicate, Region, TraitRef, Ty, TyCtxt,
};
use rustc_hir::def_id::DefId;
use rustc_infer::infer::InferCtxt;
use std::collections::HashMap;

/// The context in which `DefId` translation happens.
Expand Down Expand Up @@ -101,8 +101,8 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
orig_def_id: DefId,
orig_substs: SubstsRef<'tcx>,
) -> Option<(DefId, SubstsRef<'tcx>)> {
use rustc::ty::subst::GenericArgKind;
use rustc::ty::ReEarlyBound;
use rustc_middle::ty::subst::GenericArgKind;
use rustc_middle::ty::ReEarlyBound;
use std::cell::Cell;

debug!(
Expand Down Expand Up @@ -161,10 +161,10 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {

/// Fold a structure, translating all `DefId`s reachable by the folder.
fn translate<T: TypeFoldable<'tcx>>(&self, index_map: &HashMap<u32, DefId>, orig: &T) -> T {
use rustc::ty::ExistentialPredicate::*;
use rustc::ty::TyKind;
use rustc::ty::TypeAndMut;
use rustc::ty::{AdtDef, Binder, ExistentialProjection, ExistentialTraitRef};
use rustc_middle::ty::ExistentialPredicate::*;
use rustc_middle::ty::TyKind;
use rustc_middle::ty::TypeAndMut;
use rustc_middle::ty::{AdtDef, Binder, ExistentialProjection, ExistentialTraitRef};

orig.fold_with(&mut BottomUpFolder {
tcx: self.tcx,
Expand Down Expand Up @@ -291,7 +291,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
// `Self` is special
let orig_def_id = index_map[&param.index];
if self.needs_translation(orig_def_id) {
use rustc::ty::subst::GenericArgKind;
use rustc_middle::ty::subst::GenericArgKind;

let target_def_id = self.translate_orig(orig_def_id);
debug!("translating type param: {:?}", param);
Expand All @@ -318,9 +318,9 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {

/// Translate a region.
fn translate_region(&self, region: Region<'tcx>) -> Region<'tcx> {
use rustc::ty::BoundRegion::BrNamed;
use rustc::ty::RegionKind::*;
use rustc::ty::{EarlyBoundRegion, FreeRegion};
use rustc_middle::ty::BoundRegion::BrNamed;
use rustc_middle::ty::RegionKind::*;
use rustc_middle::ty::{EarlyBoundRegion, FreeRegion};

if !self.translate_params {
return region;
Expand Down Expand Up @@ -361,7 +361,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
index_map: &HashMap<u32, DefId>,
predicate: Predicate<'tcx>,
) -> Option<Predicate<'tcx>> {
use rustc::ty::{
use rustc_middle::ty::{
Binder, /*EquatePredicate,*/ OutlivesPredicate, ProjectionPredicate, ProjectionTy,
SubtypePredicate, TraitPredicate,
};
Expand Down Expand Up @@ -539,8 +539,8 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
}

fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
use rustc::ty::TyKind;
use rustc::ty::TypeAndMut;
use rustc_middle::ty::TyKind;
use rustc_middle::ty::TypeAndMut;

let t1 = ty.super_fold_with(self);
match t1.kind {
Expand Down
20 changes: 10 additions & 10 deletions src/traverse.rs
Expand Up @@ -17,7 +17,11 @@ use crate::{
typeck::{BoundContext, TypeComparisonContext},
};
use log::{debug, info};
use rustc::{
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res, Res::Def};
use rustc_hir::def_id::DefId;
use rustc_hir::hir_id::HirId;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::{
hir::exports::Export,
ty::{
subst::{InternalSubsts, Subst},
Expand All @@ -26,10 +30,6 @@ use rustc::{
Visibility::Public,
},
};
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res, Res::Def};
use rustc_hir::def_id::DefId;
use rustc_hir::hir_id::HirId;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_mir::const_eval::is_const_fn;
use std::collections::{BTreeMap, HashSet, VecDeque};

Expand Down Expand Up @@ -568,9 +568,9 @@ fn diff_traits<'tcx>(
new: DefId,
output: bool,
) {
use rustc::ty::subst::GenericArgKind::Type;
use rustc::ty::{ParamTy, Predicate, TyS};
use rustc_hir::Unsafety::Unsafe;
use rustc_middle::ty::subst::GenericArgKind::Type;
use rustc_middle::ty::{ParamTy, Predicate, TyS};

debug!(
"diff_traits: old: {:?}, new: {:?}, output: {:?}",
Expand Down Expand Up @@ -673,8 +673,8 @@ fn diff_generics(
old: DefId,
new: DefId,
) {
use rustc::ty::Variance;
use rustc::ty::Variance::*;
use rustc_middle::ty::Variance;
use rustc_middle::ty::Variance::*;
use std::cmp::max;

fn diff_variance<'tcx>(old_var: Variance, new_var: Variance) -> Option<ChangeType<'tcx>> {
Expand Down Expand Up @@ -1197,7 +1197,7 @@ fn match_inherent_impl<'tcx>(
orig_item: AssocItem,
target_item: AssocItem,
) -> bool {
use rustc::ty::AssocKind;
use rustc_middle::ty::AssocKind;

debug!(
"match_inherent_impl: orig_impl/item: {:?}/{:?}, target_impl/item: {:?}/{:?}",
Expand Down
18 changes: 9 additions & 9 deletions src/typeck.rs
Expand Up @@ -9,7 +9,10 @@ use crate::{
translate::{InferenceCleanupFolder, TranslationContext},
};
use log::debug;
use rustc::{
use rustc_hir::def_id::DefId;
use rustc_infer::infer::InferCtxt;
use rustc_infer::traits::{FulfillmentError, Obligation, TraitEngine};
use rustc_middle::{
traits::ObligationCause,
ty::{
error::TypeError,
Expand All @@ -18,9 +21,6 @@ use rustc::{
GenericParamDefKind, ParamEnv, Predicate, TraitRef, Ty, TyCtxt,
},
};
use rustc_hir::def_id::DefId;
use rustc_infer::infer::InferCtxt;
use rustc_infer::traits::{FulfillmentError, Obligation, TraitEngine};
use rustc_trait_selection::traits::FulfillmentContext;

/// The context in which bounds analysis happens.
Expand Down Expand Up @@ -72,8 +72,8 @@ impl<'a, 'tcx> BoundContext<'a, 'tcx> {

/// Register the trait bound represented by a `TraitRef`.
pub fn register_trait_ref(&mut self, checked_trait_ref: TraitRef<'tcx>) {
use rustc::ty::{Binder, TraitPredicate};
use rustc_hir::Constness;
use rustc_middle::ty::{Binder, TraitPredicate};

let predicate = Predicate::Trait(
Binder::bind(TraitPredicate {
Expand Down Expand Up @@ -185,7 +185,7 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {

/// Construct a set of subsitutions for an item, which normalizes defaults.
pub fn compute_target_default_substs(&self, target_def_id: DefId) -> SubstsRef<'tcx> {
use rustc::ty::ReEarlyBound;
use rustc_middle::ty::ReEarlyBound;

InternalSubsts::for_item(self.infcx.tcx, target_def_id, |def, _| match def.kind {
GenericParamDefKind::Lifetime => GenericArg::from(
Expand Down Expand Up @@ -216,10 +216,10 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
orig: Ty<'tcx>,
target: Ty<'tcx>,
) -> Option<TypeError<'tcx2>> {
use rustc::middle::region::ScopeTree;
use rustc::ty::Lift;
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
use rustc_infer::infer::{InferOk, RegionckMode};
use rustc_middle::middle::region::ScopeTree;
use rustc_middle::ty::Lift;

let error = self
.infcx
Expand Down Expand Up @@ -272,7 +272,7 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
target_def_id: DefId,
target_substs: SubstsRef<'tcx>,
) -> Option<Vec<Predicate<'tcx2>>> {
use rustc::ty::Lift;
use rustc_middle::ty::Lift;
debug!(
"check_bounds_error: orig env: {:?}, target did: {:?}, target substs: {:?}",
orig_param_env, target_def_id, target_substs
Expand Down

0 comments on commit 83fa296

Please sign in to comment.