Rollup merge of #58193 - mark-i-m:rustc-2018, r=Centril

Move librustc to 2018

r? @Centril

Part of #58099

It would be great to get this reviewed quickly to avoid merge conflicts...
This commit is contained in:
kennytm 2019-02-07 13:57:45 +08:00 committed by GitHub
commit 26b157b23c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
179 changed files with 1227 additions and 1236 deletions

View file

@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc"
version = "0.0.0"
edition = "2018"
[lib]
name = "rustc"

View file

@ -1,11 +1,11 @@
use cfg::*;
use middle::region;
use crate::cfg::*;
use crate::middle::region;
use rustc_data_structures::graph::implementation as graph;
use syntax::ptr::P;
use ty::{self, TyCtxt};
use crate::ty::{self, TyCtxt};
use hir::{self, PatKind};
use hir::def_id::DefId;
use crate::hir::{self, PatKind};
use crate::hir::def_id::DefId;
struct CFGBuilder<'a, 'tcx: 'a> {
tcx: TyCtxt<'a, 'tcx, 'tcx>,

View file

@ -4,9 +4,9 @@
// For clarity, rename the graphviz crate locally to dot.
use graphviz as dot;
use cfg;
use hir;
use ty::TyCtxt;
use crate::cfg;
use crate::hir;
use crate::ty::TyCtxt;
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
pub type Edge<'a> = &'a cfg::CFGEdge;

View file

@ -2,9 +2,9 @@
//! Uses `Graph` as the underlying representation.
use rustc_data_structures::graph::implementation as graph;
use ty::TyCtxt;
use hir;
use hir::def_id::DefId;
use crate::ty::TyCtxt;
use crate::hir;
use crate::hir::def_id::DefId;
mod construct;
pub mod graphviz;

View file

@ -2,7 +2,7 @@
//! compilation. This is used for incremental compilation tests and debug
//! output.
use session::Session;
use crate::session::Session;
use rustc_data_structures::fx::FxHashMap;
use std::sync::{Arc, Mutex};
use syntax_pos::Span;

View file

@ -49,25 +49,25 @@
//! user of the `DepNode` API of having to know how to compute the expected
//! fingerprint for a given set of node parameters.
use mir::interpret::GlobalId;
use hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
use hir::map::DefPathHash;
use hir::HirId;
use crate::mir::interpret::GlobalId;
use crate::hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
use crate::hir::map::DefPathHash;
use crate::hir::HirId;
use ich::{Fingerprint, StableHashingContext};
use crate::ich::{Fingerprint, StableHashingContext};
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
use std::fmt;
use std::hash::Hash;
use syntax_pos::symbol::InternedString;
use traits;
use traits::query::{
use crate::traits;
use crate::traits::query::{
CanonicalProjectionGoal, CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal,
CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, CanonicalPredicateGoal,
CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal,
};
use ty::{TyCtxt, FnSig, Instance, InstanceDef,
use crate::ty::{TyCtxt, FnSig, Instance, InstanceDef,
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty};
use ty::subst::Substs;
use crate::ty::subst::Substs;
// erase!() just makes tokens go away. It's used to specify which macro argument
// is repeated (i.e., which sub-expression of the macro we are in) but don't need
@ -389,7 +389,7 @@ impl fmt::Debug for DepNode {
write!(f, "(")?;
::ty::tls::with_opt(|opt_tcx| {
crate::ty::tls::with_opt(|opt_tcx| {
if let Some(tcx) = opt_tcx {
if let Some(def_id) = self.extract_def_id(tcx) {
write!(f, "{}", tcx.def_path_debug_str(def_id))?;
@ -825,6 +825,6 @@ impl WorkProductId {
}
}
impl_stable_hash_for!(struct ::dep_graph::WorkProductId {
impl_stable_hash_for!(struct crate::dep_graph::WorkProductId {
hash
});

View file

@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxHashMap;
use std::cell::RefCell;
use std::hash::Hash;
use std::marker::PhantomData;
use util::common::MemoizationMap;
use crate::util::common::MemoizationMap;
use super::{DepKind, DepNodeIndex, DepGraph};

View file

@ -1,4 +1,4 @@
use errors::{Diagnostic, DiagnosticBuilder};
use crate::errors::{Diagnostic, DiagnosticBuilder};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
@ -7,11 +7,11 @@ use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, Ordering};
use std::env;
use std::hash::Hash;
use std::collections::hash_map::Entry;
use ty::{self, TyCtxt};
use util::common::{ProfileQueriesMsg, profq_msg};
use crate::ty::{self, TyCtxt};
use crate::util::common::{ProfileQueriesMsg, profq_msg};
use parking_lot::{Mutex, Condvar};
use ich::{StableHashingContext, StableHashingContextProvider, Fingerprint};
use crate::ich::{StableHashingContext, StableHashingContextProvider, Fingerprint};
use super::debug::EdgeFilter;
use super::dep_node::{DepNode, DepKind, WorkProductId};
@ -669,7 +669,7 @@ impl DepGraph {
// We failed to mark it green, so we try to force the query.
debug!("try_mark_previous_green({:?}) --- trying to force \
dependency {:?}", dep_node, dep_dep_node);
if ::ty::query::force_from_dep_node(tcx, dep_dep_node) {
if crate::ty::query::force_from_dep_node(tcx, dep_dep_node) {
let dep_dep_node_color = data.colors.get(dep_dep_node_index);
match dep_dep_node_color {

View file

@ -1,4 +1,4 @@
use ich::Fingerprint;
use crate::ich::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use super::dep_node::DepNode;
use super::serialized::{SerializedDepGraph, SerializedDepNodeIndex};

View file

@ -1,9 +1,9 @@
//! The `DepGraphSafe` trait
use hir::BodyId;
use hir::def_id::DefId;
use crate::hir::BodyId;
use crate::hir::def_id::DefId;
use syntax::ast::NodeId;
use ty::TyCtxt;
use crate::ty::TyCtxt;
/// The `DepGraphSafe` trait is used to specify what kinds of values
/// are safe to "leak" into a task. The idea is that this should be

View file

@ -1,7 +1,7 @@
//! The data that we will serialize and deserialize.
use dep_graph::DepNode;
use ich::Fingerprint;
use crate::dep_graph::DepNode;
use crate::ich::Fingerprint;
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
newtype_index! {

View file

@ -5,12 +5,12 @@
//! item.
use ty::TyCtxt;
use ty::query::Providers;
use crate::ty::TyCtxt;
use crate::ty::query::Providers;
use hir;
use hir::def_id::DefId;
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::hir;
use crate::hir::def_id::DefId;
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use std::fmt::{self, Display};
use syntax_pos::Span;

View file

@ -1,10 +1,10 @@
use hir::def_id::DefId;
use util::nodemap::{NodeMap, DefIdMap};
use crate::hir::def_id::DefId;
use crate::util::nodemap::{NodeMap, DefIdMap};
use syntax::ast;
use syntax::ext::base::MacroKind;
use syntax_pos::Span;
use hir;
use ty;
use crate::hir;
use crate::ty;
use self::Namespace::*;

View file

@ -1,6 +1,6 @@
use ty;
use ty::TyCtxt;
use hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX;
use crate::ty;
use crate::ty::TyCtxt;
use crate::hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX;
use rustc_data_structures::indexed_vec::Idx;
use serialize;
use std::fmt;

View file

@ -33,9 +33,9 @@
use syntax::ast::{NodeId, CRATE_NODE_ID, Ident, Name, Attribute};
use syntax_pos::Span;
use hir::*;
use hir::def::Def;
use hir::map::Map;
use crate::hir::*;
use crate::hir::def::Def;
use crate::hir::map::Map;
use super::itemlikevisit::DeepVisitor;
#[derive(Copy, Clone)]

View file

@ -30,24 +30,24 @@
//! get confused if the spans from leaf AST nodes occur in multiple places
//! in the HIR, especially for multiple identifiers.
use dep_graph::DepGraph;
use errors::Applicability;
use hir::{self, ParamName};
use hir::HirVec;
use hir::map::{DefKey, DefPathData, Definitions};
use hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CRATE_DEF_INDEX};
use hir::def::{Def, PathResolution, PerNS};
use hir::GenericArg;
use lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
use crate::dep_graph::DepGraph;
use crate::errors::Applicability;
use crate::hir::{self, ParamName};
use crate::hir::HirVec;
use crate::hir::map::{DefKey, DefPathData, Definitions};
use crate::hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CRATE_DEF_INDEX};
use crate::hir::def::{Def, PathResolution, PerNS};
use crate::hir::GenericArg;
use crate::lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
ELIDED_LIFETIMES_IN_PATHS};
use middle::cstore::CrateStore;
use crate::middle::cstore::CrateStore;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::thin_vec::ThinVec;
use session::Session;
use session::config::nightly_options;
use util::common::FN_OUTPUT_NAME;
use util::nodemap::{DefIdMap, NodeMap};
use crate::session::Session;
use crate::session::config::nightly_options;
use crate::util::common::FN_OUTPUT_NAME;
use crate::util::nodemap::{DefIdMap, NodeMap};
use std::collections::{BTreeSet, BTreeMap};
use std::fmt::Debug;

View file

@ -11,10 +11,10 @@
//! nested within a uniquely determined `FnLike`), and users can ask
//! for the `Code` associated with a particular NodeId.
use hir as ast;
use hir::map;
use hir::{Expr, FnDecl, Node};
use hir::intravisit::FnKind;
use crate::hir as ast;
use crate::hir::map;
use crate::hir::{Expr, FnDecl, Node};
use crate::hir::intravisit::FnKind;
use syntax::ast::{Attribute, Ident, NodeId};
use syntax_pos::Span;

View file

@ -1,19 +1,19 @@
use super::*;
use dep_graph::{DepGraph, DepKind, DepNodeIndex};
use hir;
use hir::def_id::{LOCAL_CRATE, CrateNum};
use hir::intravisit::{Visitor, NestedVisitorMap};
use crate::dep_graph::{DepGraph, DepKind, DepNodeIndex};
use crate::hir;
use crate::hir::def_id::{LOCAL_CRATE, CrateNum};
use crate::hir::intravisit::{Visitor, NestedVisitorMap};
use rustc_data_structures::svh::Svh;
use ich::Fingerprint;
use middle::cstore::CrateStore;
use session::CrateDisambiguator;
use session::Session;
use crate::ich::Fingerprint;
use crate::middle::cstore::CrateStore;
use crate::session::CrateDisambiguator;
use crate::session::Session;
use std::iter::repeat;
use syntax::ast::{NodeId, CRATE_NODE_ID};
use syntax::source_map::SourceMap;
use syntax_pos::Span;
use ich::StableHashingContext;
use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult};
/// A Visitor that walks over the HIR and collects Nodes into a HIR map
@ -253,7 +253,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
None => format!("{:?}", node)
};
let forgot_str = if hir_id == ::hir::DUMMY_HIR_ID {
let forgot_str = if hir_id == crate::hir::DUMMY_HIR_ID {
format!("\nMaybe you forgot to lower the node id {:?}?", id)
} else {
String::new()

View file

@ -1,6 +1,6 @@
use hir::map::definitions::*;
use hir::def_id::{CRATE_DEF_INDEX, DefIndex, DefIndexAddressSpace};
use session::CrateDisambiguator;
use crate::hir::map::definitions::*;
use crate::hir::def_id::{CRATE_DEF_INDEX, DefIndex, DefIndexAddressSpace};
use crate::session::CrateDisambiguator;
use syntax::ast::*;
use syntax::ext::hygiene::Mark;
@ -10,7 +10,7 @@ use syntax::symbol::Symbol;
use syntax::parse::token::{self, Token};
use syntax_pos::Span;
use hir::map::{ITEM_LIKE_SPACE, REGULAR_SPACE};
use crate::hir::map::{ITEM_LIKE_SPACE, REGULAR_SPACE};
/// Creates def ids for nodes in the AST.
pub struct DefCollector<'a> {

View file

@ -4,15 +4,15 @@
//! There are also some rather random cases (like const initializer
//! expressions) that are mostly just leftovers.
use hir;
use hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, DefIndexAddressSpace,
use crate::hir;
use crate::hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, DefIndexAddressSpace,
CRATE_DEF_INDEX};
use ich::Fingerprint;
use crate::ich::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::indexed_vec::{IndexVec};
use rustc_data_structures::stable_hasher::StableHasher;
use serialize::{Encodable, Decodable, Encoder, Decoder};
use session::CrateDisambiguator;
use crate::session::CrateDisambiguator;
use std::borrow::Borrow;
use std::fmt::Write;
use std::hash::Hash;
@ -20,7 +20,7 @@ use syntax::ast;
use syntax::ext::hygiene::Mark;
use syntax::symbol::{Symbol, InternedString};
use syntax_pos::{Span, DUMMY_SP};
use util::nodemap::NodeMap;
use crate::util::nodemap::NodeMap;
/// The DefPathTable maps DefIndexes to DefKeys and vice versa.
/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey

View file

@ -1,7 +1,7 @@
use hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
use hir::{self, intravisit, HirId, ItemLocalId};
use crate::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
use crate::hir::{self, intravisit, HirId, ItemLocalId};
use syntax::ast::NodeId;
use hir::itemlikevisit::ItemLikeVisitor;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter};

View file

@ -3,11 +3,11 @@ pub use self::def_collector::{DefCollector, MacroInvocationData};
pub use self::definitions::{Definitions, DefKey, DefPath, DefPathData,
DisambiguatedDefPathData, DefPathHash};
use dep_graph::{DepGraph, DepNode, DepKind, DepNodeIndex};
use crate::dep_graph::{DepGraph, DepNode, DepKind, DepNodeIndex};
use hir::def_id::{CRATE_DEF_INDEX, DefId, LocalDefId, DefIndexAddressSpace};
use crate::hir::def_id::{CRATE_DEF_INDEX, DefId, LocalDefId, DefIndexAddressSpace};
use middle::cstore::CrateStoreDyn;
use crate::middle::cstore::CrateStoreDyn;
use rustc_target::spec::abi::Abi;
use rustc_data_structures::svh::Svh;
@ -17,15 +17,15 @@ use syntax::source_map::Spanned;
use syntax::ext::base::MacroKind;
use syntax_pos::{Span, DUMMY_SP};
use hir::*;
use hir::itemlikevisit::ItemLikeVisitor;
use hir::print::Nested;
use util::nodemap::FxHashMap;
use util::common::time;
use crate::hir::*;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use crate::hir::print::Nested;
use crate::util::nodemap::FxHashMap;
use crate::util::common::time;
use std::io;
use std::result::Result::Err;
use ty::TyCtxt;
use crate::ty::TyCtxt;
pub mod blocks;
mod collector;
@ -1212,13 +1212,13 @@ impl Named for StructField { fn name(&self) -> Name { self.ident.name } }
impl Named for TraitItem { fn name(&self) -> Name { self.ident.name } }
impl Named for ImplItem { fn name(&self) -> Name { self.ident.name } }
pub fn map_crate<'hir>(sess: &::session::Session,
pub fn map_crate<'hir>(sess: &crate::session::Session,
cstore: &CrateStoreDyn,
forest: &'hir Forest,
definitions: &'hir Definitions)
-> Map<'hir> {
let ((map, crate_hash), hir_to_node_id) = join(|| {
let hcx = ::ich::StableHashingContext::new(sess, &forest.krate, definitions, cstore);
let hcx = crate::ich::StableHashingContext::new(sess, &forest.krate, definitions, cstore);
let mut collector = NodeCollector::root(sess,
&forest.krate,
@ -1329,7 +1329,7 @@ fn node_id_to_string(map: &Map<'_>, id: NodeId, include_id: bool) -> String {
let path_str = || {
// This functionality is used for debugging, try to use TyCtxt to get
// the user-friendly path, otherwise fall back to stringifying DefPath.
::ty::tls::with_opt(|tcx| {
crate::ty::tls::with_opt(|tcx| {
if let Some(tcx) = tcx {
tcx.node_path_str(id)
} else if let Some(path) = map.def_path_from_id(id) {

View file

@ -10,11 +10,11 @@ pub use self::PrimTy::*;
pub use self::UnOp::*;
pub use self::UnsafeSource::*;
use errors::FatalError;
use hir::def::Def;
use hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use util::nodemap::{NodeMap, FxHashSet};
use mir::mono::Linkage;
use crate::errors::FatalError;
use crate::hir::def::Def;
use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use crate::util::nodemap::{NodeMap, FxHashSet};
use crate::mir::mono::Linkage;
use syntax_pos::{Span, DUMMY_SP, symbol::InternedString};
use syntax::source_map::Spanned;
@ -27,8 +27,8 @@ use syntax::ptr::P;
use syntax::symbol::{Symbol, keywords};
use syntax::tokenstream::TokenStream;
use syntax::util::parser::ExprPrecedence;
use ty::AdtKind;
use ty::query::Providers;
use crate::ty::AdtKind;
use crate::ty::query::Providers;
use rustc_data_structures::sync::{ParallelIterator, par_iter, Send, Sync, scope};
use rustc_data_structures::thin_vec::ThinVec;

View file

@ -1,6 +1,6 @@
use hir::def::Def;
use hir::def_id::DefId;
use hir::{self, HirId, PatKind};
use crate::hir::def::Def;
use crate::hir::def_id::DefId;
use crate::hir::{self, HirId, PatKind};
use syntax::ast;
use syntax_pos::Span;

View file

@ -11,9 +11,9 @@ use syntax::symbol::keywords;
use syntax::util::parser::{self, AssocOp, Fixity};
use syntax_pos::{self, BytePos, FileName};
use hir;
use hir::{PatKind, GenericBound, TraitBoundModifier, RangeEnd};
use hir::{GenericParam, GenericParamKind, GenericArg};
use crate::hir;
use crate::hir::{PatKind, GenericBound, TraitBoundModifier, RangeEnd};
use crate::hir::{GenericParam, GenericParamKind, GenericArg};
use std::borrow::Cow;
use std::cell::Cell;
@ -2401,7 +2401,7 @@ fn stmt_ends_with_semi(stmt: &hir::StmtKind) -> bool {
}
fn bin_op_to_assoc_op(op: hir::BinOpKind) -> AssocOp {
use hir::BinOpKind::*;
use crate::hir::BinOpKind::*;
match op {
Add => AssocOp::Add,
Sub => AssocOp::Subtract,

View file

@ -1,11 +1,11 @@
use hir;
use hir::def_id::{DefId, DefIndex};
use hir::map::DefPathHash;
use hir::map::definitions::Definitions;
use ich::{self, CachingSourceMapView, Fingerprint};
use middle::cstore::CrateStore;
use ty::{TyCtxt, fast_reject};
use session::Session;
use crate::hir;
use crate::hir::def_id::{DefId, DefIndex};
use crate::hir::map::DefPathHash;
use crate::hir::map::definitions::Definitions;
use crate::ich::{self, CachingSourceMapView, Fingerprint};
use crate::middle::cstore::CrateStore;
use crate::ty::{TyCtxt, fast_reject};
use crate::session::Session;
use std::cmp::Ord;
use std::hash as std_hash;
@ -218,7 +218,7 @@ impl<'a> StableHashingContextProvider<'a> for StableHashingContext<'a> {
}
}
impl<'a> ::dep_graph::DepGraphSafe for StableHashingContext<'a> {
impl<'a> crate::dep_graph::DepGraphSafe for StableHashingContext<'a> {
}

View file

@ -1,23 +1,21 @@
//! This module contains `HashStable` implementations for various data types
//! from rustc::middle::cstore in no particular order.
use middle;
impl_stable_hash_for!(enum middle::cstore::DepKind {
impl_stable_hash_for!(enum crate::middle::cstore::DepKind {
UnexportedMacrosOnly,
MacrosOnly,
Implicit,
Explicit
});
impl_stable_hash_for!(enum middle::cstore::NativeLibraryKind {
impl_stable_hash_for!(enum crate::middle::cstore::NativeLibraryKind {
NativeStatic,
NativeStaticNobundle,
NativeFramework,
NativeUnknown
});
impl_stable_hash_for!(struct middle::cstore::NativeLibrary {
impl_stable_hash_for!(struct crate::middle::cstore::NativeLibrary {
kind,
name,
cfg,
@ -25,30 +23,30 @@ impl_stable_hash_for!(struct middle::cstore::NativeLibrary {
wasm_import_module
});
impl_stable_hash_for!(struct middle::cstore::ForeignModule {
impl_stable_hash_for!(struct crate::middle::cstore::ForeignModule {
foreign_items,
def_id
});
impl_stable_hash_for!(enum middle::cstore::LinkagePreference {
impl_stable_hash_for!(enum crate::middle::cstore::LinkagePreference {
RequireDynamic,
RequireStatic
});
impl_stable_hash_for!(struct middle::cstore::ExternCrate {
impl_stable_hash_for!(struct crate::middle::cstore::ExternCrate {
src,
span,
path_len,
direct
});
impl_stable_hash_for!(enum middle::cstore::ExternCrateSource {
impl_stable_hash_for!(enum crate::middle::cstore::ExternCrateSource {
Extern(def_id),
Use,
Path,
});
impl_stable_hash_for!(struct middle::cstore::CrateSource {
impl_stable_hash_for!(struct crate::middle::cstore::CrateSource {
dylib,
rlib,
rmeta

View file

@ -1,10 +1,10 @@
//! This module contains `HashStable` implementations for various HIR data
//! types in no particular order.
use hir;
use hir::map::DefPathHash;
use hir::def_id::{DefId, LocalDefId, CrateNum, CRATE_DEF_INDEX};
use ich::{StableHashingContext, NodeIdHashingMode, Fingerprint};
use crate::hir;
use crate::hir::map::DefPathHash;
use crate::hir::def_id::{DefId, LocalDefId, CrateNum, CRATE_DEF_INDEX};
use crate::ich::{StableHashingContext, NodeIdHashingMode, Fingerprint};
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,
StableHasher, StableHasherResult};
use std::mem;
@ -619,7 +619,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::MatchSource {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use hir::MatchSource;
use crate::hir::MatchSource;
mem::discriminant(self).hash_stable(hcx, hasher);
match *self {
@ -1116,12 +1116,12 @@ impl_stable_hash_for!(struct hir::def::Export {
span
});
impl_stable_hash_for!(struct ::middle::lib_features::LibFeatures {
impl_stable_hash_for!(struct crate::middle::lib_features::LibFeatures {
stable,
unstable
});
impl<'a> HashStable<StableHashingContext<'a>> for ::middle::lang_items::LangItem {
impl<'a> HashStable<StableHashingContext<'a>> for crate::middle::lang_items::LangItem {
fn hash_stable<W: StableHasherResult>(&self,
_: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
@ -1129,7 +1129,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for ::middle::lang_items::LangItem
}
}
impl_stable_hash_for!(struct ::middle::lang_items::LanguageItems {
impl_stable_hash_for!(struct crate::middle::lang_items::LanguageItems {
items,
missing
});

View file

@ -1,8 +1,8 @@
//! This module contains `HashStable` implementations for various MIR data
//! types in no particular order.
use ich::StableHashingContext;
use mir;
use crate::ich::StableHashingContext;
use crate::mir;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
StableHasherResult};
use std::mem;

View file

@ -1,7 +1,7 @@
//! This module contains `HashStable` implementations for various data types
//! that don't fit into any of the other impls_xxx modules.
impl_stable_hash_for!(enum ::session::search_paths::PathKind {
impl_stable_hash_for!(enum crate::session::search_paths::PathKind {
Native,
Crate,
Dependency,

View file

@ -1,7 +1,7 @@
//! This module contains `HashStable` implementations for various data types
//! from libsyntax in no particular order.
use ich::StableHashingContext;
use crate::ich::StableHashingContext;
use std::hash as std_hash;
use std::mem;
@ -13,7 +13,7 @@ use syntax::symbol::{InternedString, LocalInternedString};
use syntax::tokenstream;
use syntax_pos::SourceFile;
use hir::def_id::{DefId, CrateNum, CRATE_DEF_INDEX};
use crate::hir::def_id::{DefId, CrateNum, CRATE_DEF_INDEX};
use smallvec::SmallVec;
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,

View file

@ -1,18 +1,18 @@
//! This module contains `HashStable` implementations for various data types
//! from rustc::ty in no particular order.
use ich::{Fingerprint, StableHashingContext, NodeIdHashingMode};
use crate::ich::{Fingerprint, StableHashingContext, NodeIdHashingMode};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,
StableHasher, StableHasherResult};
use std::cell::RefCell;
use std::hash as std_hash;
use std::mem;
use middle::region;
use infer;
use traits;
use ty;
use mir;
use crate::middle::region;
use crate::infer;
use crate::traits;
use crate::ty;
use crate::mir;
impl<'a, 'gcx, T> HashStable<StableHashingContext<'a>>
for &'gcx ty::List<T>
@ -306,7 +306,7 @@ impl_stable_hash_for!(
ByRef(id, alloc, offset),
}
);
impl_stable_hash_for!(struct ::mir::interpret::RawConst<'tcx> {
impl_stable_hash_for!(struct crate::mir::interpret::RawConst<'tcx> {
alloc_id,
ty,
});
@ -512,20 +512,22 @@ impl_stable_hash_for!(enum ty::GenericParamDefKind {
});
impl_stable_hash_for!(
impl<T> for enum ::middle::resolve_lifetime::Set1<T> [ ::middle::resolve_lifetime::Set1 ] {
impl<T> for enum crate::middle::resolve_lifetime::Set1<T>
[ crate::middle::resolve_lifetime::Set1 ]
{
Empty,
Many,
One(value),
}
);
impl_stable_hash_for!(enum ::middle::resolve_lifetime::LifetimeDefOrigin {
impl_stable_hash_for!(enum crate::middle::resolve_lifetime::LifetimeDefOrigin {
ExplicitOrElided,
InBand,
Error,
});
impl_stable_hash_for!(enum ::middle::resolve_lifetime::Region {
impl_stable_hash_for!(enum crate::middle::resolve_lifetime::Region {
Static,
EarlyBound(index, decl, is_in_band),
LateBound(db_index, decl, is_in_band),
@ -547,9 +549,9 @@ impl_stable_hash_for!(enum ty::cast::CastKind {
FnPtrAddrCast
});
impl_stable_hash_for!(struct ::middle::region::Scope { id, data });
impl_stable_hash_for!(struct crate::middle::region::Scope { id, data });
impl_stable_hash_for!(enum ::middle::region::ScopeData {
impl_stable_hash_for!(enum crate::middle::region::ScopeData {
Node,
CallSite,
Arguments,
@ -588,7 +590,7 @@ for ty::TyKind<'gcx>
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use ty::TyKind::*;
use crate::ty::TyKind::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match *self {
@ -882,7 +884,7 @@ impl_stable_hash_for!(enum traits::Reveal {
All
});
impl_stable_hash_for!(enum ::middle::privacy::AccessLevel {
impl_stable_hash_for!(enum crate::middle::privacy::AccessLevel {
ReachableFromImplTrait,
Reachable,
Exported,
@ -890,12 +892,12 @@ impl_stable_hash_for!(enum ::middle::privacy::AccessLevel {
});
impl<'a> HashStable<StableHashingContext<'a>>
for ::middle::privacy::AccessLevels {
for crate::middle::privacy::AccessLevels {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
let ::middle::privacy::AccessLevels {
let crate::middle::privacy::AccessLevels {
ref map
} = *self;
@ -908,14 +910,14 @@ impl_stable_hash_for!(struct ty::CrateInherentImpls {
inherent_impls
});
impl_stable_hash_for!(enum ::session::CompileIncomplete {
impl_stable_hash_for!(enum crate::session::CompileIncomplete {
Stopped,
Errored(error_reported)
});
impl_stable_hash_for!(struct ::util::common::ErrorReported {});
impl_stable_hash_for!(struct crate::util::common::ErrorReported {});
impl_stable_hash_for!(tuple_struct ::middle::reachable::ReachableSet {
impl_stable_hash_for!(tuple_struct crate::middle::reachable::ReachableSet {
reachable_set
});
@ -924,7 +926,7 @@ for traits::Vtable<'gcx, N> where N: HashStable<StableHashingContext<'a>> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::Vtable::*;
use crate::traits::Vtable::*;
mem::discriminant(self).hash_stable(hcx, hasher);
@ -1105,7 +1107,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::WhereClause<'tcx
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::WhereClause::*;
use crate::traits::WhereClause::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
@ -1121,7 +1123,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::WellFormed<'tcx>
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::WellFormed::*;
use crate::traits::WellFormed::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
@ -1135,7 +1137,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::FromEnv<'tcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::FromEnv::*;
use crate::traits::FromEnv::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
@ -1149,7 +1151,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::DomainGoal<'tcx>
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::DomainGoal::*;
use crate::traits::DomainGoal::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
@ -1165,7 +1167,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::Goal<'tcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::GoalKind::*;
use crate::traits::GoalKind::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {
@ -1208,7 +1210,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for traits::Clause<'tcx> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>) {
use traits::Clause::*;
use crate::traits::Clause::*;
mem::discriminant(self).hash_stable(hcx, hasher);
match self {

View file

@ -27,7 +27,7 @@
use super::*;
use ty::relate::{Relate, TypeRelation};
use crate::ty::relate::{Relate, TypeRelation};
pub struct At<'a, 'gcx: 'tcx, 'tcx: 'a> {
pub infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,

View file

@ -5,15 +5,15 @@
//!
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html
use infer::canonical::{
use crate::infer::canonical::{
Canonical, CanonicalTyVarKind, CanonicalVarInfo, CanonicalVarKind, Canonicalized,
OriginalQueryValues,
};
use infer::InferCtxt;
use crate::infer::InferCtxt;
use std::sync::atomic::Ordering;
use ty::fold::{TypeFoldable, TypeFolder};
use ty::subst::Kind;
use ty::{self, BoundVar, Lift, List, Ty, TyCtxt, TypeFlags};
use crate::ty::fold::{TypeFoldable, TypeFolder};
use crate::ty::subst::Kind;
use crate::ty::{self, BoundVar, Lift, List, Ty, TyCtxt, TypeFlags};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::indexed_vec::Idx;

View file

@ -21,16 +21,16 @@
//!
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html
use infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin};
use crate::infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin};
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::sync::Lrc;
use serialize::UseSpecializedDecodable;
use smallvec::SmallVec;
use std::ops::Index;
use syntax::source_map::Span;
use ty::fold::TypeFoldable;
use ty::subst::Kind;
use ty::{self, BoundVar, Lift, List, Region, TyCtxt};
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::Kind;
use crate::ty::{self, BoundVar, Lift, List, Region, TyCtxt};
mod canonicalizer;
@ -393,14 +393,14 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
}
CloneTypeFoldableAndLiftImpls! {
::infer::canonical::Certainty,
::infer::canonical::CanonicalVarInfo,
::infer::canonical::CanonicalVarKind,
crate::infer::canonical::Certainty,
crate::infer::canonical::CanonicalVarInfo,
crate::infer::canonical::CanonicalVarKind,
}
CloneTypeFoldableImpls! {
for <'tcx> {
::infer::canonical::CanonicalVarInfos<'tcx>,
crate::infer::canonical::CanonicalVarInfos<'tcx>,
}
}
@ -431,7 +431,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
/// we'll return a substitution `subst` with:
/// `subst.var_values == [Type(^0), Lifetime(^1), Type(^2)]`.
pub fn make_identity<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Self {
use ty::subst::UnpackedKind;
use crate::ty::subst::UnpackedKind;
CanonicalVarValues {
var_values: self.var_values.iter()

View file

@ -7,26 +7,26 @@
//!
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html
use infer::canonical::substitute::substitute_value;
use infer::canonical::{
use crate::infer::canonical::substitute::substitute_value;
use crate::infer::canonical::{
Canonical, CanonicalVarValues, CanonicalizedQueryResponse, Certainty,
OriginalQueryValues, QueryRegionConstraint, QueryResponse,
};
use infer::region_constraints::{Constraint, RegionConstraintData};
use infer::InferCtxtBuilder;
use infer::{InferCtxt, InferOk, InferResult};
use crate::infer::region_constraints::{Constraint, RegionConstraintData};
use crate::infer::InferCtxtBuilder;
use crate::infer::{InferCtxt, InferOk, InferResult};
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::sync::Lrc;
use std::fmt::Debug;
use syntax_pos::DUMMY_SP;
use traits::query::{Fallible, NoSolution};
use traits::TraitEngine;
use traits::{Obligation, ObligationCause, PredicateObligation};
use ty::fold::TypeFoldable;
use ty::subst::{Kind, UnpackedKind};
use ty::{self, BoundVar, Lift, Ty, TyCtxt};
use util::captures::Captures;
use crate::traits::query::{Fallible, NoSolution};
use crate::traits::TraitEngine;
use crate::traits::{Obligation, ObligationCause, PredicateObligation};
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::{Kind, UnpackedKind};
use crate::ty::{self, BoundVar, Lift, Ty, TyCtxt};
use crate::util::captures::Captures;
impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> {
/// The "main method" for a canonicalized trait query. Given the

View file

@ -6,10 +6,10 @@
//!
//! [c]: https://rust-lang.github.io/rustc-guide/traits/canonicalization.html
use infer::canonical::{Canonical, CanonicalVarValues};
use ty::fold::TypeFoldable;
use ty::subst::UnpackedKind;
use ty::{self, TyCtxt};
use crate::infer::canonical::{Canonical, CanonicalVarValues};
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::UnpackedKind;
use crate::ty::{self, TyCtxt};
impl<'tcx, V> Canonical<'tcx, V> {
/// Instantiate the wrapped value, replacing each canonical value

View file

@ -29,13 +29,13 @@ use super::lub::Lub;
use super::sub::Sub;
use super::type_variable::TypeVariableValue;
use hir::def_id::DefId;
use ty::{IntType, UintType};
use ty::{self, Ty, TyCtxt};
use ty::error::TypeError;
use ty::relate::{self, Relate, RelateResult, TypeRelation};
use ty::subst::Substs;
use traits::{Obligation, PredicateObligations};
use crate::hir::def_id::DefId;
use crate::ty::{IntType, UintType};
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::error::TypeError;
use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
use crate::ty::subst::Substs;
use crate::traits::{Obligation, PredicateObligations};
use syntax::ast;
use syntax_pos::Span;

View file

@ -1,12 +1,12 @@
use super::combine::{CombineFields, RelationDir};
use super::{Subtype};
use hir::def_id::DefId;
use crate::hir::def_id::DefId;
use ty::{self, Ty, TyCtxt};
use ty::TyVar;
use ty::subst::Substs;
use ty::relate::{self, Relate, RelateResult, TypeRelation};
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::TyVar;
use crate::ty::subst::Substs;
use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
/// Ensures `a` is made equal to `b`. Returns `a` on success.
pub struct Equate<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {

View file

@ -48,19 +48,19 @@
use super::lexical_region_resolve::RegionResolutionError;
use super::region_constraints::GenericKind;
use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs};
use infer::{self, SuppressRegionErrors};
use crate::infer::{self, SuppressRegionErrors};
use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use hir;
use hir::def_id::DefId;
use hir::Node;
use middle::region;
use crate::errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use crate::hir;
use crate::hir::def_id::DefId;
use crate::hir::Node;
use crate::middle::region;
use std::{cmp, fmt};
use syntax::ast::DUMMY_NODE_ID;
use syntax_pos::{Pos, Span};
use traits::{ObligationCause, ObligationCauseCode};
use ty::error::TypeError;
use ty::{self, subst::Subst, Region, Ty, TyCtxt, TyKind, TypeFoldable};
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty::error::TypeError;
use crate::ty::{self, subst::Subst, Region, Ty, TyCtxt, TyKind, TypeFoldable};
mod note;
@ -1479,7 +1479,7 @@ enum FailureCode {
impl<'tcx> ObligationCause<'tcx> {
fn as_failure_code(&self, terr: &TypeError<'tcx>) -> FailureCode {
use self::FailureCode::*;
use traits::ObligationCauseCode::*;
use crate::traits::ObligationCauseCode::*;
match self.code {
CompareImplMethodObligation { .. } => Error0308("method not compatible with trait"),
MatchExpressionArm { source, .. } => Error0308(match source {
@ -1509,7 +1509,7 @@ impl<'tcx> ObligationCause<'tcx> {
}
fn as_requirement_str(&self) -> &'static str {
use traits::ObligationCauseCode::*;
use crate::traits::ObligationCauseCode::*;
match self.code {
CompareImplMethodObligation { .. } => "method type is compatible with trait",
ExprAssignable => "expression is assignable",

View file

@ -1,11 +1,11 @@
use hir::{self, Local, Pat, Body, HirId};
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use infer::InferCtxt;
use infer::type_variable::TypeVariableOrigin;
use ty::{self, Ty, Infer, TyVar};
use crate::hir::{self, Local, Pat, Body, HirId};
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::infer::InferCtxt;
use crate::infer::type_variable::TypeVariableOrigin;
use crate::ty::{self, Ty, Infer, TyVar};
use syntax::source_map::CompilerDesugaringKind;
use syntax_pos::Span;
use errors::DiagnosticBuilder;
use crate::errors::DiagnosticBuilder;
struct FindLocalByTypeVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,

View file

@ -1,9 +1,9 @@
//! Error Reporting for Anonymous Region Lifetime Errors
//! where both the regions are anonymous.
use infer::error_reporting::nice_region_error::NiceRegionError;
use infer::error_reporting::nice_region_error::util::AnonymousArgInfo;
use util::common::ErrorReported;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::error_reporting::nice_region_error::util::AnonymousArgInfo;
use crate::util::common::ErrorReported;
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// Print the error message for lifetime errors when both the concerned regions are anonymous.

View file

@ -1,9 +1,9 @@
use hir;
use ty::{self, Region, TyCtxt};
use hir::Node;
use middle::resolve_lifetime as rl;
use hir::intravisit::{self, NestedVisitorMap, Visitor};
use infer::error_reporting::nice_region_error::NiceRegionError;
use crate::hir;
use crate::ty::{self, Region, TyCtxt};
use crate::hir::Node;
use crate::middle::resolve_lifetime as rl;
use crate::hir::intravisit::{self, NestedVisitorMap, Visitor};
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// This function calls the `visit_ty` method for the parameters

View file

@ -1,9 +1,9 @@
use infer::InferCtxt;
use infer::lexical_region_resolve::RegionResolutionError;
use infer::lexical_region_resolve::RegionResolutionError::*;
use crate::infer::InferCtxt;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::lexical_region_resolve::RegionResolutionError::*;
use syntax::source_map::Span;
use ty::{self, TyCtxt};
use util::common::ErrorReported;
use crate::ty::{self, TyCtxt};
use crate::util::common::ErrorReported;
mod different_lifetimes;
mod find_anon_type;

View file

@ -1,9 +1,9 @@
//! Error Reporting for Anonymous Region Lifetime Errors
//! where one region is named and the other is anonymous.
use infer::error_reporting::nice_region_error::NiceRegionError;
use ty;
use util::common::ErrorReported;
use errors::Applicability;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty;
use crate::util::common::ErrorReported;
use crate::errors::Applicability;
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// When given a `ConcreteFailure` for a function with arguments containing a named region and

View file

@ -1,13 +1,13 @@
//! Error Reporting for Anonymous Region Lifetime Errors
//! where both the regions are anonymous.
use infer::error_reporting::nice_region_error::NiceRegionError;
use infer::SubregionOrigin;
use ty::RegionKind;
use hir::{Expr, ExprKind::Closure};
use hir::Node;
use util::common::ErrorReported;
use infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::SubregionOrigin;
use crate::ty::RegionKind;
use crate::hir::{Expr, ExprKind::Closure};
use crate::hir::Node;
use crate::util::common::ErrorReported;
use crate::infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// Print the error message for lifetime errors when binding escapes a closure.

View file

@ -1,15 +1,15 @@
use errors::DiagnosticBuilder;
use hir::def_id::DefId;
use infer::error_reporting::nice_region_error::NiceRegionError;
use infer::lexical_region_resolve::RegionResolutionError;
use infer::ValuePairs;
use infer::{SubregionOrigin, TypeTrace};
use traits::{ObligationCause, ObligationCauseCode};
use ty;
use ty::error::ExpectedFound;
use ty::subst::Substs;
use util::common::ErrorReported;
use util::ppaux::RegionHighlightMode;
use crate::errors::DiagnosticBuilder;
use crate::hir::def_id::DefId;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::infer::ValuePairs;
use crate::infer::{SubregionOrigin, TypeTrace};
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty;
use crate::ty::error::ExpectedFound;
use crate::ty::subst::Substs;
use crate::util::common::ErrorReported;
use crate::util::ppaux::RegionHighlightMode;
impl NiceRegionError<'me, 'gcx, 'tcx> {
/// When given a `ConcreteFailure` for a function with arguments containing a named region and

View file

@ -1,10 +1,10 @@
//! Error Reporting for static impl Traits.
use infer::error_reporting::nice_region_error::NiceRegionError;
use infer::lexical_region_resolve::RegionResolutionError;
use ty::{BoundRegion, FreeRegion, RegionKind};
use util::common::ErrorReported;
use errors::Applicability;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::ty::{BoundRegion, FreeRegion, RegionKind};
use crate::util::common::ErrorReported;
use crate::errors::Applicability;
impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// Print the error message for lifetime errors when the return type is a static impl Trait.

View file

@ -1,10 +1,10 @@
//! Helper functions corresponding to lifetime errors due to
//! anonymous regions.
use hir;
use infer::error_reporting::nice_region_error::NiceRegionError;
use ty::{self, Region, Ty};
use hir::def_id::DefId;
use crate::hir;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty::{self, Region, Ty};
use crate::hir::def_id::DefId;
use syntax_pos::Span;
// The struct contains the information about the anonymous region

View file

@ -1,8 +1,8 @@
use infer::{self, InferCtxt, SubregionOrigin};
use middle::region;
use ty::{self, Region};
use ty::error::TypeError;
use errors::DiagnosticBuilder;
use crate::infer::{self, InferCtxt, SubregionOrigin};
use crate::middle::region;
use crate::ty::{self, Region};
use crate::ty::error::TypeError;
use crate::errors::DiagnosticBuilder;
impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
pub(super) fn note_region_origin(&self,

View file

@ -31,9 +31,9 @@
//! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type
//! inferencer knows "so far".
use ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::fold::TypeFolder;
use util::nodemap::FxHashMap;
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
use crate::ty::fold::TypeFolder;
use crate::util::nodemap::FxHashMap;
use std::collections::hash_map::Entry;

View file

@ -1,6 +1,6 @@
use infer::type_variable::TypeVariableMap;
use ty::{self, Ty, TyCtxt};
use ty::fold::{TypeFoldable, TypeFolder};
use crate::infer::type_variable::TypeVariableMap;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::fold::{TypeFoldable, TypeFolder};
use super::InferCtxt;
use super::RegionVariableOrigin;

View file

@ -3,9 +3,9 @@ use super::InferCtxt;
use super::lattice::{self, LatticeDir};
use super::Subtype;
use traits::ObligationCause;
use ty::{self, Ty, TyCtxt};
use ty::relate::{Relate, RelateResult, TypeRelation};
use crate::traits::ObligationCause;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
/// "Greatest lower bound" (common subtype)
pub struct Glb<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {

View file

@ -4,8 +4,8 @@
use super::combine::CombineFields;
use super::{HigherRankedType, InferCtxt, PlaceholderMap};
use ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, Binder, TypeFoldable};
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
use crate::ty::{self, Binder, TypeFoldable};
impl<'a, 'gcx, 'tcx> CombineFields<'a, 'gcx, 'tcx> {
pub fn higher_ranked_sub<T>(

View file

@ -22,10 +22,10 @@
use super::InferCtxt;
use super::type_variable::TypeVariableOrigin;
use traits::ObligationCause;
use ty::TyVar;
use ty::{self, Ty};
use ty::relate::{RelateResult, TypeRelation};
use crate::traits::ObligationCause;
use crate::ty::TyVar;
use crate::ty::{self, Ty};
use crate::ty::relate::{RelateResult, TypeRelation};
pub trait LatticeDir<'f, 'gcx: 'f+'tcx, 'tcx: 'f> : TypeRelation<'f, 'gcx, 'tcx> {
fn infcx(&self) -> &'f InferCtxt<'f, 'gcx, 'tcx>;

View file

@ -8,14 +8,14 @@
/// For clarity, rename the graphviz crate locally to dot.
use graphviz as dot;
use hir::def_id::DefIndex;
use ty;
use middle::free_region::RegionRelations;
use middle::region;
use crate::hir::def_id::DefIndex;
use crate::ty;
use crate::middle::free_region::RegionRelations;
use crate::middle::region;
use super::Constraint;
use infer::SubregionOrigin;
use infer::region_constraints::RegionConstraintData;
use util::nodemap::{FxHashMap, FxHashSet};
use crate::infer::SubregionOrigin;
use crate::infer::region_constraints::RegionConstraintData;
use crate::util::nodemap::{FxHashMap, FxHashSet};
use std::borrow::Cow;
use std::collections::hash_map::Entry::Vacant;

View file

@ -1,13 +1,13 @@
//! The code to do lexical region resolution.
use infer::region_constraints::Constraint;
use infer::region_constraints::GenericKind;
use infer::region_constraints::RegionConstraintData;
use infer::region_constraints::VarInfos;
use infer::region_constraints::VerifyBound;
use infer::RegionVariableOrigin;
use infer::SubregionOrigin;
use middle::free_region::RegionRelations;
use crate::infer::region_constraints::Constraint;
use crate::infer::region_constraints::GenericKind;
use crate::infer::region_constraints::RegionConstraintData;
use crate::infer::region_constraints::VarInfos;
use crate::infer::region_constraints::VerifyBound;
use crate::infer::RegionVariableOrigin;
use crate::infer::SubregionOrigin;
use crate::middle::free_region::RegionRelations;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::implementation::{
Direction, Graph, NodeIndex, INCOMING, OUTGOING,
@ -16,11 +16,11 @@ use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use smallvec::SmallVec;
use std::fmt;
use std::u32;
use ty::fold::TypeFoldable;
use ty::{self, Ty, TyCtxt};
use ty::{ReEarlyBound, ReEmpty, ReErased, ReFree, ReStatic};
use ty::{ReLateBound, ReScope, RePlaceholder, ReVar};
use ty::{Region, RegionVid};
use crate::ty::fold::TypeFoldable;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::{ReEarlyBound, ReEmpty, ReErased, ReFree, ReStatic};
use crate::ty::{ReLateBound, ReScope, RePlaceholder, ReVar};
use crate::ty::{Region, RegionVid};
mod graphviz;

View file

@ -3,9 +3,9 @@ use super::InferCtxt;
use super::lattice::{self, LatticeDir};
use super::Subtype;
use traits::ObligationCause;
use ty::{self, Ty, TyCtxt};
use ty::relate::{Relate, RelateResult, TypeRelation};
use crate::traits::ObligationCause;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::relate::{Relate, RelateResult, TypeRelation};
/// "Least upper bound" (common supertype)
pub struct Lub<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {

View file

@ -5,31 +5,31 @@ pub use self::LateBoundRegionConversionTime::*;
pub use self::RegionVariableOrigin::*;
pub use self::SubregionOrigin::*;
pub use self::ValuePairs::*;
pub use ty::IntVarValue;
pub use crate::ty::IntVarValue;
use arena::SyncDroplessArena;
use errors::DiagnosticBuilder;
use hir::def_id::DefId;
use infer::canonical::{Canonical, CanonicalVarValues};
use middle::free_region::RegionRelations;
use middle::lang_items;
use middle::region;
use crate::errors::DiagnosticBuilder;
use crate::hir::def_id::DefId;
use crate::infer::canonical::{Canonical, CanonicalVarValues};
use crate::middle::free_region::RegionRelations;
use crate::middle::lang_items;
use crate::middle::region;
use rustc_data_structures::unify as ut;
use session::config::BorrowckMode;
use crate::session::config::BorrowckMode;
use std::cell::{Cell, Ref, RefCell, RefMut};
use std::collections::BTreeMap;
use std::fmt;
use syntax::ast;
use syntax_pos::symbol::InternedString;
use syntax_pos::{self, Span};
use traits::{self, ObligationCause, PredicateObligations, TraitEngine};
use ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
use ty::fold::TypeFoldable;
use ty::relate::RelateResult;
use ty::subst::{Kind, Substs};
use ty::{self, GenericParamDefKind, Ty, TyCtxt, CtxtInterners};
use ty::{FloatVid, IntVid, TyVid};
use util::nodemap::FxHashMap;
use crate::traits::{self, ObligationCause, PredicateObligations, TraitEngine};
use crate::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
use crate::ty::fold::TypeFoldable;
use crate::ty::relate::RelateResult;
use crate::ty::subst::{Kind, Substs};
use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt, CtxtInterners};
use crate::ty::{FloatVid, IntVid, TyVid};
use crate::util::nodemap::FxHashMap;
use self::combine::CombineFields;
use self::lexical_region_resolve::LexicalRegionResolutions;
@ -617,8 +617,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}
pub fn type_is_unconstrained_numeric(&'a self, ty: Ty<'_>) -> UnconstrainedNumeric {
use ty::error::UnconstrainedNumeric::Neither;
use ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
use crate::ty::error::UnconstrainedNumeric::Neither;
use crate::ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
match ty.sty {
ty::Infer(ty::IntVar(vid)) => {
if self.int_unification_table

View file

@ -1,16 +1,16 @@
use hir::def_id::DefId;
use hir;
use hir::Node;
use infer::{self, InferCtxt, InferOk, TypeVariableOrigin};
use infer::outlives::free_region_map::FreeRegionRelations;
use crate::hir::def_id::DefId;
use crate::hir;
use crate::hir::Node;
use crate::infer::{self, InferCtxt, InferOk, TypeVariableOrigin};
use crate::infer::outlives::free_region_map::FreeRegionRelations;
use rustc_data_structures::fx::FxHashMap;
use syntax::ast;
use traits::{self, PredicateObligation};
use ty::{self, Ty, TyCtxt, GenericParamDefKind};
use ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder};
use ty::outlives::Component;
use ty::subst::{Kind, Substs, UnpackedKind};
use util::nodemap::DefIdMap;
use crate::traits::{self, PredicateObligation};
use crate::ty::{self, Ty, TyCtxt, GenericParamDefKind};
use crate::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder};
use crate::ty::outlives::Component;
use crate::ty::subst::{Kind, Substs, UnpackedKind};
use crate::util::nodemap::DefIdMap;
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;

View file

@ -1,10 +1,10 @@
use infer::outlives::free_region_map::FreeRegionMap;
use infer::{GenericKind, InferCtxt};
use crate::infer::outlives::free_region_map::FreeRegionMap;
use crate::infer::{GenericKind, InferCtxt};
use rustc_data_structures::fx::FxHashMap;
use syntax::ast;
use syntax_pos::Span;
use traits::query::outlives_bounds::{self, OutlivesBound};
use ty::{self, Ty};
use crate::traits::query::outlives_bounds::{self, OutlivesBound};
use crate::ty::{self, Ty};
/// The `OutlivesEnvironment` collects information about what outlives
/// what in a given type-checking setting. For example, if we have a

View file

@ -1,4 +1,4 @@
use ty::{self, Lift, TyCtxt, Region};
use crate::ty::{self, Lift, TyCtxt, Region};
use rustc_data_structures::transitive_relation::TransitiveRelation;
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Default)]

View file

@ -59,14 +59,14 @@
//! might later infer `?U` to something like `&'b u32`, which would
//! imply that `'b: 'a`.
use infer::outlives::env::RegionBoundPairs;
use infer::outlives::verify::VerifyBoundCx;
use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
use crate::infer::outlives::env::RegionBoundPairs;
use crate::infer::outlives::verify::VerifyBoundCx;
use crate::infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
use rustc_data_structures::fx::FxHashMap;
use syntax::ast;
use traits::ObligationCause;
use ty::outlives::Component;
use ty::{self, Region, Ty, TyCtxt, TypeFoldable};
use crate::traits::ObligationCause;
use crate::ty::outlives::Component;
use crate::ty::{self, Region, Ty, TyCtxt, TypeFoldable};
impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
/// Registers that the given region obligation must be resolved

View file

@ -1,10 +1,10 @@
use hir::def_id::DefId;
use infer::outlives::env::RegionBoundPairs;
use infer::{GenericKind, VerifyBound};
use traits;
use ty::subst::{Subst, Substs};
use ty::{self, Ty, TyCtxt};
use util::captures::Captures;
use crate::hir::def_id::DefId;
use crate::infer::outlives::env::RegionBoundPairs;
use crate::infer::{GenericKind, VerifyBound};
use crate::traits;
use crate::ty::subst::{Subst, Substs};
use crate::ty::{self, Ty, TyCtxt};
use crate::util::captures::Captures;
/// The `TypeOutlives` struct has the job of "lowering" a `T: 'a`
/// obligation into a series of `'a: 'b` constraints and "verifys", as

View file

@ -9,10 +9,10 @@ use super::{MiscVariable, RegionVariableOrigin, SubregionOrigin};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::unify as ut;
use ty::ReStatic;
use ty::{self, Ty, TyCtxt};
use ty::{BrFresh, ReLateBound, ReVar};
use ty::{Region, RegionVid};
use crate::ty::ReStatic;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::{BrFresh, ReLateBound, ReVar};
use crate::ty::{Region, RegionVid};
use std::collections::BTreeMap;
use std::{cmp, fmt, mem, u32};

View file

@ -1,6 +1,6 @@
use super::{InferCtxt, FixupError, FixupResult};
use ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::fold::{TypeFolder, TypeVisitor};
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
use crate::ty::fold::{TypeFolder, TypeVisitor};
///////////////////////////////////////////////////////////////////////////
// OPPORTUNISTIC TYPE RESOLVER

View file

@ -1,11 +1,11 @@
use super::SubregionOrigin;
use super::combine::{CombineFields, RelationDir};
use traits::Obligation;
use ty::{self, Ty, TyCtxt};
use ty::TyVar;
use ty::fold::TypeFoldable;
use ty::relate::{Cause, Relate, RelateResult, TypeRelation};
use crate::traits::Obligation;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::TyVar;
use crate::ty::fold::TypeFoldable;
use crate::ty::relate::{Cause, Relate, RelateResult, TypeRelation};
use std::mem;
/// Ensures `a` is made a subtype of `b`. Returns `a` on success.

View file

@ -1,6 +1,6 @@
use syntax::symbol::InternedString;
use syntax_pos::Span;
use ty::{self, Ty};
use crate::ty::{self, Ty};
use std::cmp;
use std::marker::PhantomData;

View file

@ -1,4 +1,4 @@
use ty::{self, FloatVarValue, IntVarValue, Ty, TyCtxt};
use crate::ty::{self, FloatVarValue, IntVarValue, Ty, TyCtxt};
use rustc_data_structures::unify::{NoError, EqUnifyValue, UnifyKey, UnifyValue};
pub trait ToType {

View file

@ -30,6 +30,9 @@
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![deny(rust_2018_idioms)]
#![allow(explicit_outlives_requirements)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
@ -64,41 +67,24 @@
#![warn(elided_lifetimes_in_paths)]
extern crate arena;
#[macro_use] extern crate bitflags;
extern crate core;
extern crate fmt_macros;
extern crate getopts;
extern crate graphviz;
extern crate num_cpus;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate scoped_tls;
#[cfg(windows)]
extern crate libc;
extern crate polonius_engine;
extern crate rustc_target;
#[macro_use] extern crate rustc_data_structures;
extern crate serialize;
extern crate parking_lot;
extern crate rustc_errors as errors;
extern crate rustc_rayon as rayon;
extern crate rustc_rayon_core as rayon_core;
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
extern crate syntax_pos;
extern crate jobserver;
extern crate proc_macro;
extern crate chalk_engine;
extern crate rustc_fs_util;
extern crate serialize as rustc_serialize; // used by deriving
// FIXME: This import is used by deriving `RustcDecodable` and `RustcEncodable`. Removing this
// results in a bunch of "failed to resolve" errors. Hopefully, the compiler moves to serde or
// something, and we can get rid of this.
#[allow(rust_2018_idioms)]
extern crate serialize as rustc_serialize;
extern crate rustc_apfloat;
extern crate byteorder;
extern crate backtrace;
#[macro_use]
extern crate smallvec;
#[macro_use] extern crate smallvec;
// Note that librustc doesn't actually depend on these crates, see the note in
// `Cargo.toml` for this crate about why these are here.
@ -166,9 +152,11 @@ pub mod util {
// `libstd` uses the same trick.
#[doc(hidden)]
mod rustc {
pub use lint;
pub use crate::lint;
}
use rustc_errors as errors;
// FIXME(#27438): right now the unit tests of librustc don't refer to any actual
// functions generated in librustc_data_structures (all
// references are through generic functions), but statics are

View file

@ -4,9 +4,9 @@
//! compiler code, rather than using their own custom pass. Those
//! lints are all available in `rustc_lint::builtin`.
use errors::{Applicability, DiagnosticBuilder};
use lint::{LintPass, LateLintPass, LintArray};
use session::Session;
use crate::errors::{Applicability, DiagnosticBuilder};
use crate::lint::{LintPass, LateLintPass, LintArray};
use crate::session::Session;
use syntax::ast;
use syntax::source_map::Span;

View file

@ -18,26 +18,26 @@ use self::TargetLint::*;
use std::slice;
use rustc_data_structures::sync::ReadGuard;
use lint::{EarlyLintPass, EarlyLintPassObject, LateLintPassObject};
use lint::{LintArray, Level, Lint, LintId, LintPass, LintBuffer};
use lint::builtin::BuiltinLintDiagnostics;
use lint::levels::{LintLevelSets, LintLevelsBuilder};
use middle::privacy::AccessLevels;
use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
use session::{config, early_error, Session};
use ty::{self, TyCtxt, Ty};
use ty::layout::{LayoutError, LayoutOf, TyLayout};
use util::nodemap::FxHashMap;
use util::common::time;
use crate::lint::{EarlyLintPass, EarlyLintPassObject, LateLintPassObject};
use crate::lint::{LintArray, Level, Lint, LintId, LintPass, LintBuffer};
use crate::lint::builtin::BuiltinLintDiagnostics;
use crate::lint::levels::{LintLevelSets, LintLevelsBuilder};
use crate::middle::privacy::AccessLevels;
use crate::rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
use crate::session::{config, early_error, Session};
use crate::ty::{self, TyCtxt, Ty};
use crate::ty::layout::{LayoutError, LayoutOf, TyLayout};
use crate::util::nodemap::FxHashMap;
use crate::util::common::time;
use std::default::Default as StdDefault;
use syntax::ast;
use syntax::edition;
use syntax_pos::{MultiSpan, Span, symbol::{LocalInternedString, Symbol}};
use errors::DiagnosticBuilder;
use hir;
use hir::def_id::LOCAL_CRATE;
use hir::intravisit as hir_visit;
use crate::errors::DiagnosticBuilder;
use crate::hir;
use crate::hir::def_id::LOCAL_CRATE;
use crate::hir::intravisit as hir_visit;
use syntax::util::lev_distance::find_best_match_for_name;
use syntax::visit as ast_visit;

View file

@ -1,20 +1,20 @@
use std::cmp;
use errors::{Applicability, DiagnosticBuilder};
use hir::HirId;
use ich::StableHashingContext;
use lint::builtin;
use lint::context::CheckLintNameResult;
use lint::{self, Lint, LintId, Level, LintSource};
use crate::errors::{Applicability, DiagnosticBuilder};
use crate::hir::HirId;
use crate::ich::StableHashingContext;
use crate::lint::builtin;
use crate::lint::context::CheckLintNameResult;
use crate::lint::{self, Lint, LintId, Level, LintSource};
use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,
StableHasher, StableHasherResult};
use session::Session;
use crate::session::Session;
use syntax::ast;
use syntax::attr;
use syntax::feature_gate;
use syntax::source_map::MultiSpan;
use syntax::symbol::Symbol;
use util::nodemap::FxHashMap;
use crate::util::nodemap::FxHashMap;
pub struct LintLevelSets {
list: Vec<LintSet>,

View file

@ -23,13 +23,13 @@ pub use self::LintSource::*;
use rustc_data_structures::sync::{self, Lrc};
use errors::{DiagnosticBuilder, DiagnosticId};
use hir::def_id::{CrateNum, LOCAL_CRATE};
use hir::intravisit;
use hir;
use lint::builtin::BuiltinLintDiagnostics;
use lint::builtin::parser::{QUESTION_MARK_MACRO_SEP, ILL_FORMED_ATTRIBUTE_INPUT};
use session::{Session, DiagnosticMessageId};
use crate::errors::{DiagnosticBuilder, DiagnosticId};
use crate::hir::def_id::{CrateNum, LOCAL_CRATE};
use crate::hir::intravisit;
use crate::hir;
use crate::lint::builtin::BuiltinLintDiagnostics;
use crate::lint::builtin::parser::{QUESTION_MARK_MACRO_SEP, ILL_FORMED_ATTRIBUTE_INPUT};
use crate::session::{Session, DiagnosticMessageId};
use std::{hash, ptr};
use syntax::ast;
use syntax::source_map::{MultiSpan, ExpnFormat};
@ -37,11 +37,11 @@ use syntax::early_buffered_lints::BufferedEarlyLintId;
use syntax::edition::Edition;
use syntax::symbol::Symbol;
use syntax_pos::Span;
use ty::TyCtxt;
use ty::query::Providers;
use util::nodemap::NodeMap;
use crate::ty::TyCtxt;
use crate::ty::query::Providers;
use crate::util::nodemap::NodeMap;
pub use lint::context::{LateContext, EarlyContext, LintContext, LintStore,
pub use crate::lint::context::{LateContext, EarlyContext, LintContext, LintStore,
check_crate, check_ast_crate, CheckLintNameResult,
FutureIncompatibleInfo, BufferedEarlyLint};
@ -678,7 +678,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
"this was previously accepted by the compiler but is being phased out; \
it will become a hard error";
let explanation = if lint_id == LintId::of(::lint::builtin::UNSTABLE_NAME_COLLISIONS) {
let explanation = if lint_id == LintId::of(crate::lint::builtin::UNSTABLE_NAME_COLLISIONS) {
"once this method is added to the standard library, \
the ambiguity may cause an error or change in behavior!"
.to_owned()

View file

@ -1,6 +1,6 @@
use ich::StableHashingContext;
use hir::HirId;
use util::nodemap::FxHashSet;
use crate::ich::StableHashingContext;
use crate::hir::HirId;
use crate::util::nodemap::FxHashSet;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
StableHasherResult};

View file

@ -2,13 +2,13 @@
//! are *mostly* used as a part of that interface, but these should
//! probably get a better home if someone can find one.
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use hir::map as hir_map;
use hir::map::definitions::{DefKey, DefPathTable};
use crate::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use crate::hir::map as hir_map;
use crate::hir::map::definitions::{DefKey, DefPathTable};
use rustc_data_structures::svh::Svh;
use ty::{self, TyCtxt};
use session::{Session, CrateDisambiguator};
use session::search_paths::PathKind;
use crate::ty::{self, TyCtxt};
use crate::session::{Session, CrateDisambiguator};
use crate::session::search_paths::PathKind;
use std::any::Any;
use std::path::{Path, PathBuf};

View file

@ -2,18 +2,18 @@
// closely. The idea is that all reachable symbols are live, codes called
// from live codes are live, and everything else is dead.
use hir::Node;
use hir::{self, PatKind};
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use hir::itemlikevisit::ItemLikeVisitor;
use crate::hir::Node;
use crate::hir::{self, PatKind};
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::hir::itemlikevisit::ItemLikeVisitor;
use hir::def::Def;
use hir::CodegenFnAttrFlags;
use hir::def_id::{DefId, LOCAL_CRATE};
use lint;
use middle::privacy;
use ty::{self, TyCtxt};
use util::nodemap::FxHashSet;
use crate::hir::def::Def;
use crate::hir::CodegenFnAttrFlags;
use crate::hir::def_id::{DefId, LOCAL_CRATE};
use crate::lint;
use crate::middle::privacy;
use crate::ty::{self, TyCtxt};
use crate::util::nodemap::FxHashSet;
use rustc_data_structures::fx::FxHashMap;

View file

@ -51,13 +51,13 @@
//! Additionally, the algorithm is geared towards finding *any* solution rather
//! than finding a number of solutions (there are normally quite a few).
use hir::def_id::CrateNum;
use crate::hir::def_id::CrateNum;
use session::config;
use ty::TyCtxt;
use middle::cstore::{self, DepKind};
use middle::cstore::LinkagePreference::{self, RequireStatic, RequireDynamic};
use util::nodemap::FxHashMap;
use crate::session::config;
use crate::ty::TyCtxt;
use crate::middle::cstore::{self, DepKind};
use crate::middle::cstore::LinkagePreference::{self, RequireStatic, RequireDynamic};
use crate::util::nodemap::FxHashMap;
use rustc_target::spec::PanicStrategy;
/// A list of dependencies for a certain crate type.

View file

@ -1,15 +1,15 @@
use hir::map as hir_map;
use hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
use session::{config, Session};
use session::config::EntryFnType;
use crate::hir::map as hir_map;
use crate::hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
use crate::session::{config, Session};
use crate::session::config::EntryFnType;
use syntax::ast::NodeId;
use syntax::attr;
use syntax::entry::EntryPointType;
use syntax_pos::Span;
use hir::{Item, ItemKind, ImplItem, TraitItem};
use hir::itemlikevisit::ItemLikeVisitor;
use ty::TyCtxt;
use ty::query::Providers;
use crate::hir::{Item, ItemKind, ImplItem, TraitItem};
use crate::hir::itemlikevisit::ItemLikeVisitor;
use crate::ty::TyCtxt;
use crate::ty::query::Providers;
struct EntryContext<'a, 'tcx: 'a> {
session: &'a Session,

View file

@ -1,11 +1,11 @@
use hir::def_id::{DefId, LOCAL_CRATE};
use ich::StableHashingContext;
use crate::hir::def_id::{DefId, LOCAL_CRATE};
use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{StableHasher, HashStable,
StableHasherResult};
use std::cmp;
use std::mem;
use ty;
use ty::subst::Substs;
use crate::ty;
use crate::ty::subst::Substs;
/// The SymbolExportLevel of a symbols specifies from which kinds of crates
/// the symbol will be exported. `C` symbols will be exported from any

View file

@ -9,20 +9,20 @@ pub use self::MatchMode::*;
use self::TrackMatchMode::*;
use self::OverloadedCallType::*;
use hir::def::Def;
use hir::def_id::DefId;
use infer::InferCtxt;
use middle::mem_categorization as mc;
use middle::region;
use ty::{self, TyCtxt, adjustment};
use crate::hir::def::Def;
use crate::hir::def_id::DefId;
use crate::infer::InferCtxt;
use crate::middle::mem_categorization as mc;
use crate::middle::region;
use crate::ty::{self, TyCtxt, adjustment};
use hir::{self, PatKind};
use crate::hir::{self, PatKind};
use rustc_data_structures::sync::Lrc;
use std::rc::Rc;
use syntax::ast;
use syntax::ptr::P;
use syntax_pos::Span;
use util::nodemap::ItemLocalSet;
use crate::util::nodemap::ItemLocalSet;
///////////////////////////////////////////////////////////////////////////
// The Delegate trait

View file

@ -5,10 +5,10 @@
//! `TransitiveRelation` type and use that to decide when one free
//! region outlives another and so forth.
use infer::outlives::free_region_map::{FreeRegionMap, FreeRegionRelations};
use hir::def_id::DefId;
use middle::region;
use ty::{self, TyCtxt, Region};
use crate::infer::outlives::free_region_map::{FreeRegionMap, FreeRegionRelations};
use crate::hir::def_id::DefId;
use crate::middle::region;
use crate::ty::{self, TyCtxt, Region};
/// Combines a `region::ScopeTree` (which governs relationships between
/// scopes) and a `FreeRegionMap` (which governs relationships between

View file

@ -1,14 +1,14 @@
use hir::def::Def;
use hir::def_id::DefId;
use ty::{self, Ty, TyCtxt};
use ty::layout::{LayoutError, Pointer, SizeSkeleton, VariantIdx};
use ty::query::Providers;
use crate::hir::def::Def;
use crate::hir::def_id::DefId;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::layout::{LayoutError, Pointer, SizeSkeleton, VariantIdx};
use crate::ty::query::Providers;
use rustc_target::spec::abi::Abi::RustIntrinsic;
use rustc_data_structures::indexed_vec::Idx;
use syntax_pos::Span;
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use hir;
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::hir;
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
for &module in tcx.hir().krate().modules.keys() {

View file

@ -11,17 +11,17 @@
pub use self::LangItem::*;
use hir::def_id::DefId;
use hir::check_attr::Target;
use ty::{self, TyCtxt};
use middle::weak_lang_items;
use util::nodemap::FxHashMap;
use crate::hir::def_id::DefId;
use crate::hir::check_attr::Target;
use crate::ty::{self, TyCtxt};
use crate::middle::weak_lang_items;
use crate::util::nodemap::FxHashMap;
use syntax::ast;
use syntax::symbol::Symbol;
use syntax_pos::Span;
use hir::itemlikevisit::ItemLikeVisitor;
use hir;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use crate::hir;
// The actual lang items defined come at the end of this file in one handy table.
// So you probably just want to nip down to the end.

View file

@ -4,13 +4,13 @@
// and `#[unstable (..)]`), but are not declared in one single location
// (unlike lang features), which means we need to collect them instead.
use ty::TyCtxt;
use crate::ty::TyCtxt;
use syntax::symbol::Symbol;
use syntax::ast::{Attribute, MetaItem, MetaItemKind};
use syntax_pos::Span;
use hir::intravisit::{self, NestedVisitorMap, Visitor};
use crate::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
use errors::DiagnosticId;
use crate::errors::DiagnosticId;
pub struct LibFeatures {
// A map from feature to stabilisation version.

View file

@ -97,13 +97,13 @@ use self::LoopKind::*;
use self::LiveNodeKind::*;
use self::VarKind::*;
use hir::def::*;
use hir::Node;
use ty::{self, TyCtxt};
use ty::query::Providers;
use lint;
use errors::Applicability;
use util::nodemap::{NodeMap, HirIdMap, HirIdSet};
use crate::hir::def::*;
use crate::hir::Node;
use crate::ty::{self, TyCtxt};
use crate::ty::query::Providers;
use crate::lint;
use crate::errors::Applicability;
use crate::util::nodemap::{NodeMap, HirIdMap, HirIdSet};
use std::collections::{BTreeMap, VecDeque};
use std::{fmt, u32};
@ -115,10 +115,10 @@ use syntax::ptr::P;
use syntax::symbol::keywords;
use syntax_pos::Span;
use hir;
use hir::{Expr, HirId};
use hir::def_id::DefId;
use hir::intravisit::{self, Visitor, FnKind, NestedVisitorMap};
use crate::hir;
use crate::hir::{Expr, HirId};
use crate::hir::def_id::DefId;
use crate::hir::intravisit::{self, Visitor, FnKind, NestedVisitorMap};
/// For use with `propagate_through_loop`.
enum LoopKind<'a> {
@ -406,7 +406,7 @@ fn add_from_pat<'a, 'tcx>(ir: &mut IrMaps<'a, 'tcx>, pat: &P<hir::Pat>) {
let mut pats = VecDeque::new();
pats.push_back(pat);
while let Some(pat) = pats.pop_front() {
use hir::PatKind::*;
use crate::hir::PatKind::*;
match pat.node {
Binding(_, _, _, _, ref inner_pat) => {
pats.extend(inner_pat.iter());

View file

@ -58,19 +58,19 @@ pub use self::Note::*;
use self::Aliasability::*;
use middle::region;
use hir::def_id::{DefId, LocalDefId};
use hir::Node;
use infer::InferCtxt;
use hir::def::{Def, CtorKind};
use ty::adjustment;
use ty::{self, Ty, TyCtxt};
use ty::fold::TypeFoldable;
use ty::layout::VariantIdx;
use crate::middle::region;
use crate::hir::def_id::{DefId, LocalDefId};
use crate::hir::Node;
use crate::infer::InferCtxt;
use crate::hir::def::{Def, CtorKind};
use crate::ty::adjustment;
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::fold::TypeFoldable;
use crate::ty::layout::VariantIdx;
use hir::{MutImmutable, MutMutable, PatKind};
use hir::pat_util::EnumerateAndAdjustIterator;
use hir;
use crate::hir::{MutImmutable, MutMutable, PatKind};
use crate::hir::pat_util::EnumerateAndAdjustIterator;
use crate::hir;
use syntax::ast::{self, Name};
use syntax_pos::Span;
@ -80,7 +80,7 @@ use std::hash::{Hash, Hasher};
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::indexed_vec::Idx;
use std::rc::Rc;
use util::nodemap::ItemLocalSet;
use crate::util::nodemap::ItemLocalSet;
#[derive(Clone, Debug, PartialEq)]
pub enum Categorization<'tcx> {

View file

@ -2,7 +2,7 @@
//! outside their scopes. This pass will also generate a set of exported items
//! which are available for use externally when compiled as a library.
use util::nodemap::{DefIdSet, FxHashMap};
use crate::util::nodemap::{DefIdSet, FxHashMap};
use std::hash::Hash;
use std::fmt;

View file

@ -5,24 +5,24 @@
// makes all other generics or inline functions that it references
// reachable as well.
use hir::{CodegenFnAttrs, CodegenFnAttrFlags};
use hir::Node;
use hir::def::Def;
use hir::def_id::{DefId, CrateNum};
use crate::hir::{CodegenFnAttrs, CodegenFnAttrFlags};
use crate::hir::Node;
use crate::hir::def::Def;
use crate::hir::def_id::{DefId, CrateNum};
use rustc_data_structures::sync::Lrc;
use ty::{self, TyCtxt};
use ty::query::Providers;
use middle::privacy;
use session::config;
use util::nodemap::{NodeSet, FxHashSet};
use crate::ty::{self, TyCtxt};
use crate::ty::query::Providers;
use crate::middle::privacy;
use crate::session::config;
use crate::util::nodemap::{NodeSet, FxHashSet};
use rustc_target::spec::abi::Abi;
use syntax::ast;
use hir;
use hir::def_id::LOCAL_CRATE;
use hir::intravisit::{Visitor, NestedVisitorMap};
use hir::itemlikevisit::ItemLikeVisitor;
use hir::intravisit;
use crate::hir;
use crate::hir::def_id::LOCAL_CRATE;
use crate::hir::intravisit::{Visitor, NestedVisitorMap};
use crate::hir::itemlikevisit::ItemLikeVisitor;
use crate::hir::intravisit;
// Returns true if the given item must be inlined because it may be
// monomorphized or it was marked with `#[inline]`. This will only return

View file

@ -5,7 +5,7 @@
// this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
// just peeks and looks for that attribute.
use session::Session;
use crate::session::Session;
use syntax::ast;
use rustc_data_structures::sync::Once;

View file

@ -6,9 +6,9 @@
//!
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/mir/borrowck.html
use ich::{StableHashingContext, NodeIdHashingMode};
use util::nodemap::{FxHashMap, FxHashSet};
use ty;
use crate::ich::{StableHashingContext, NodeIdHashingMode};
use crate::util::nodemap::{FxHashMap, FxHashSet};
use crate::ty;
use std::mem;
use std::fmt;
@ -16,14 +16,14 @@ use rustc_data_structures::sync::Lrc;
use syntax::source_map;
use syntax::ast;
use syntax_pos::{Span, DUMMY_SP};
use ty::TyCtxt;
use ty::query::Providers;
use crate::ty::TyCtxt;
use crate::ty::query::Providers;
use hir;
use hir::Node;
use hir::def_id::DefId;
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use hir::{Block, Arm, Pat, PatKind, Stmt, Expr, Local};
use crate::hir;
use crate::hir::Node;
use crate::hir::def_id::DefId;
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::hir::{Block, Arm, Pat, PatKind, Stmt, Expr, Local};
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
StableHasherResult};
@ -154,7 +154,7 @@ newtype_index! {
pub struct FirstStatementIndex { .. }
}
impl_stable_hash_for!(struct ::middle::region::FirstStatementIndex { private });
impl_stable_hash_for!(struct crate::middle::region::FirstStatementIndex { private });
// compilation error if size of `ScopeData` is not the same as a `u32`
static_assert!(ASSERT_SCOPE_DATA: mem::size_of::<ScopeData>() == 4);

View file

@ -5,16 +5,16 @@
//! used between functions, and they operate in a purely top-down
//! way. Therefore we break lifetime name resolution into a separate pass.
use hir::def::Def;
use hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use hir::map::Map;
use hir::{GenericArg, GenericParam, ItemLocalId, LifetimeName, Node, ParamName};
use ty::{self, DefIdTree, GenericParamDefKind, TyCtxt};
use crate::hir::def::Def;
use crate::hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use crate::hir::map::Map;
use crate::hir::{GenericArg, GenericParam, ItemLocalId, LifetimeName, Node, ParamName};
use crate::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt};
use errors::{Applicability, DiagnosticBuilder};
use rustc::lint;
use crate::errors::{Applicability, DiagnosticBuilder};
use crate::rustc::lint;
use rustc_data_structures::sync::Lrc;
use session::Session;
use crate::session::Session;
use std::borrow::Cow;
use std::cell::Cell;
use std::mem::replace;
@ -23,10 +23,10 @@ use syntax::attr;
use syntax::ptr::P;
use syntax::symbol::keywords;
use syntax_pos::Span;
use util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet};
use crate::util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet};
use hir::intravisit::{self, NestedVisitorMap, Visitor};
use hir::{self, GenericParamKind, LifetimeParamKind};
use crate::hir::intravisit::{self, NestedVisitorMap, Visitor};
use crate::hir::{self, GenericParamKind, LifetimeParamKind};
/// The origin of a named lifetime definition.
///
@ -216,7 +216,7 @@ pub struct ResolveLifetimes {
FxHashMap<LocalDefId, Lrc<FxHashMap<ItemLocalId, Lrc<Vec<ObjectLifetimeDefault>>>>>,
}
impl_stable_hash_for!(struct ::middle::resolve_lifetime::ResolveLifetimes {
impl_stable_hash_for!(struct crate::middle::resolve_lifetime::ResolveLifetimes {
defs,
late_bound,
object_lifetime_defaults

View file

@ -3,14 +3,14 @@
pub use self::StabilityLevel::*;
use lint::{self, Lint};
use hir::{self, Item, Generics, StructField, Variant, HirId};
use hir::def::Def;
use hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
use hir::intravisit::{self, Visitor, NestedVisitorMap};
use ty::query::Providers;
use middle::privacy::AccessLevels;
use session::{DiagnosticMessageId, Session};
use crate::lint::{self, Lint};
use crate::hir::{self, Item, Generics, StructField, Variant, HirId};
use crate::hir::def::Def;
use crate::hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::ty::query::Providers;
use crate::middle::privacy::AccessLevels;
use crate::session::{DiagnosticMessageId, Session};
use syntax::symbol::Symbol;
use syntax_pos::{Span, MultiSpan};
use syntax::ast;
@ -18,8 +18,8 @@ use syntax::ast::{NodeId, Attribute};
use syntax::errors::Applicability;
use syntax::feature_gate::{GateIssue, emit_feature_err};
use syntax::attr::{self, Stability, Deprecation};
use ty::{self, TyCtxt};
use util::nodemap::{FxHashSet, FxHashMap};
use crate::ty::{self, TyCtxt};
use crate::util::nodemap::{FxHashSet, FxHashMap};
use std::mem::replace;
use std::cmp::Ordering;

View file

@ -1,18 +1,18 @@
//! Validity checking for weak lang items
use session::config;
use middle::lang_items;
use crate::session::config;
use crate::middle::lang_items;
use rustc_data_structures::fx::FxHashSet;
use rustc_target::spec::PanicStrategy;
use syntax::ast;
use syntax::symbol::Symbol;
use syntax_pos::Span;
use hir::def_id::DefId;
use hir::intravisit::{Visitor, NestedVisitorMap};
use hir::intravisit;
use hir;
use ty::TyCtxt;
use crate::hir::def_id::DefId;
use crate::hir::intravisit::{Visitor, NestedVisitorMap};
use crate::hir::intravisit;
use crate::hir;
use crate::ty::TyCtxt;
macro_rules! weak_lang_items {
($($name:ident, $item:ident, $sym:ident;)*) => (

View file

@ -2,10 +2,10 @@ use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::sync::{RwLock, MappedReadGuard, ReadGuard};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
StableHasherResult};
use ich::StableHashingContext;
use mir::{Mir, BasicBlock};
use crate::ich::StableHashingContext;
use crate::mir::{Mir, BasicBlock};
use rustc_serialize as serialize;
use crate::rustc_serialize as serialize;
#[derive(Clone, Debug)]
pub struct Cache {

View file

@ -5,10 +5,10 @@ use super::{
truncate,
};
use ty::layout::{Size, Align};
use crate::ty::layout::{Size, Align};
use syntax::ast::Mutability;
use std::iter;
use mir;
use crate::mir;
use std::ops::{Deref, DerefMut};
use rustc_data_structures::sorted_map::SortedMap;
use rustc_target::abi::HasDataLayout;

View file

@ -1,17 +1,17 @@
use std::{fmt, env};
use hir::map::definitions::DefPathData;
use mir;
use ty::{self, Ty, layout};
use ty::layout::{Size, Align, LayoutError};
use crate::hir::map::definitions::DefPathData;
use crate::mir;
use crate::ty::{self, Ty, layout};
use crate::ty::layout::{Size, Align, LayoutError};
use rustc_target::spec::abi::Abi;
use super::{RawConst, Pointer, InboundsCheck, ScalarMaybeUndef};
use backtrace::Backtrace;
use ty::query::TyCtxtAt;
use errors::DiagnosticBuilder;
use crate::ty::query::TyCtxtAt;
use crate::errors::DiagnosticBuilder;
use syntax_pos::{Pos, Span};
use syntax::ast;
@ -42,7 +42,7 @@ pub type ConstEvalResult<'tcx> = Result<ty::Const<'tcx>, ErrorHandled>;
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
pub struct ConstEvalErr<'tcx> {
pub span: Span,
pub error: ::mir::interpret::EvalErrorKind<'tcx, u64>,
pub error: crate::mir::interpret::EvalErrorKind<'tcx, u64>,
pub stacktrace: Vec<FrameInfo<'tcx>>,
}
@ -136,7 +136,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
.next()
.unwrap_or(lint_root);
tcx.struct_span_lint_node(
::rustc::lint::builtin::CONST_ERR,
crate::rustc::lint::builtin::CONST_ERR,
node_id,
tcx.span,
message,

View file

@ -25,17 +25,17 @@ pub use self::allocation::{
pub use self::pointer::{Pointer, PointerArithmetic};
use std::fmt;
use mir;
use hir::def_id::DefId;
use ty::{self, TyCtxt, Instance};
use ty::layout::{self, Size};
use crate::mir;
use crate::hir::def_id::DefId;
use crate::ty::{self, TyCtxt, Instance};
use crate::ty::layout::{self, Size};
use std::io;
use rustc_serialize::{Encoder, Decodable, Encodable};
use crate::rustc_serialize::{Encoder, Decodable, Encodable};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{Lock as Mutex, HashMapExt};
use rustc_data_structures::tiny_list::TinyList;
use byteorder::{WriteBytesExt, ReadBytesExt, LittleEndian, BigEndian};
use ty::codec::TyDecoder;
use crate::ty::codec::TyDecoder;
use std::sync::atomic::{AtomicU32, Ordering};
use std::num::NonZeroU32;
@ -53,8 +53,8 @@ pub struct GlobalId<'tcx> {
#[derive(Copy, Clone, Eq, Hash, Ord, PartialEq, PartialOrd, Debug)]
pub struct AllocId(pub u64);
impl ::rustc_serialize::UseSpecializedEncodable for AllocId {}
impl ::rustc_serialize::UseSpecializedDecodable for AllocId {}
impl crate::rustc_serialize::UseSpecializedEncodable for AllocId {}
impl crate::rustc_serialize::UseSpecializedDecodable for AllocId {}
#[derive(RustcDecodable, RustcEncodable)]
enum AllocDiscriminant {

View file

@ -1,5 +1,5 @@
use mir;
use ty::layout::{self, HasDataLayout, Size};
use crate::mir;
use crate::ty::layout::{self, HasDataLayout, Size};
use super::{
AllocId, EvalResult, InboundsCheck,

View file

@ -515,7 +515,7 @@ impl<'tcx, Tag> ScalarMaybeUndef<Tag> {
}
}
impl_stable_hash_for!(enum ::mir::interpret::ScalarMaybeUndef {
impl_stable_hash_for!(enum crate::mir::interpret::ScalarMaybeUndef {
Scalar(v),
Undef
});

Some files were not shown because too many files have changed in this diff Show more