Skip to content

Commit

Permalink
move librustc to 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Feb 5, 2019
1 parent b2c6b8c commit e957ed9
Show file tree
Hide file tree
Showing 179 changed files with 1,234 additions and 1,243 deletions.
1 change: 1 addition & 0 deletions src/librustc/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc"
version = "0.0.0"
edition = "2018"

[lib]
name = "rustc"
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/cfg/construct.rs
@@ -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>,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/cfg/graphviz.rs
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/cfg/mod.rs
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/cgu_reuse_tracker.rs
Expand Up @@ -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;
Expand Down
22 changes: 11 additions & 11 deletions src/librustc/dep_graph/dep_node.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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))?;
Expand Down Expand Up @@ -825,6 +825,6 @@ impl WorkProductId {
}
}

impl_stable_hash_for!(struct ::dep_graph::WorkProductId {
impl_stable_hash_for!(struct crate::dep_graph::WorkProductId {
hash
});
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/dep_tracking_map.rs
Expand Up @@ -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};

Expand Down
10 changes: 5 additions & 5 deletions src/librustc/dep_graph/graph.rs
@@ -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};
Expand All @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/prev.rs
@@ -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};
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/dep_graph/safe.rs
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/dep_graph/serialized.rs
@@ -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! {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/hir/check_attr.rs
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions src/librustc/hir/def.rs
@@ -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::*;

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/def_id.rs
@@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/intravisit.rs
Expand Up @@ -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)]
Expand Down
28 changes: 14 additions & 14 deletions src/librustc/hir/lowering.rs
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/hir/map/blocks.rs
Expand Up @@ -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;

Expand Down
20 changes: 10 additions & 10 deletions src/librustc/hir/map/collector.rs
@@ -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
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/hir/map/def_collector.rs
@@ -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;
Expand All @@ -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> {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/hir/map/definitions.rs
Expand Up @@ -4,23 +4,23 @@
//! 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;
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
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/map/hir_id_validator.rs
@@ -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};

Expand Down

0 comments on commit e957ed9

Please sign in to comment.