Skip to content

Commit e957ed9

Browse files
committed
move librustc to 2018
1 parent b2c6b8c commit e957ed9

File tree

179 files changed

+1234
-1243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+1234
-1243
lines changed

src/librustc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "rustc"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "rustc"

src/librustc/cfg/construct.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use cfg::*;
2-
use middle::region;
1+
use crate::cfg::*;
2+
use crate::middle::region;
33
use rustc_data_structures::graph::implementation as graph;
44
use syntax::ptr::P;
5-
use ty::{self, TyCtxt};
5+
use crate::ty::{self, TyCtxt};
66

7-
use hir::{self, PatKind};
8-
use hir::def_id::DefId;
7+
use crate::hir::{self, PatKind};
8+
use crate::hir::def_id::DefId;
99

1010
struct CFGBuilder<'a, 'tcx: 'a> {
1111
tcx: TyCtxt<'a, 'tcx, 'tcx>,

src/librustc/cfg/graphviz.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// For clarity, rename the graphviz crate locally to dot.
55
use graphviz as dot;
66

7-
use cfg;
8-
use hir;
9-
use ty::TyCtxt;
7+
use crate::cfg;
8+
use crate::hir;
9+
use crate::ty::TyCtxt;
1010

1111
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
1212
pub type Edge<'a> = &'a cfg::CFGEdge;

src/librustc/cfg/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Uses `Graph` as the underlying representation.
33
44
use rustc_data_structures::graph::implementation as graph;
5-
use ty::TyCtxt;
6-
use hir;
7-
use hir::def_id::DefId;
5+
use crate::ty::TyCtxt;
6+
use crate::hir;
7+
use crate::hir::def_id::DefId;
88

99
mod construct;
1010
pub mod graphviz;

src/librustc/dep_graph/cgu_reuse_tracker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! compilation. This is used for incremental compilation tests and debug
33
//! output.
44
5-
use session::Session;
5+
use crate::session::Session;
66
use rustc_data_structures::fx::FxHashMap;
77
use std::sync::{Arc, Mutex};
88
use syntax_pos::Span;

src/librustc/dep_graph/dep_node.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@
4949
//! user of the `DepNode` API of having to know how to compute the expected
5050
//! fingerprint for a given set of node parameters.
5151
52-
use mir::interpret::GlobalId;
53-
use hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
54-
use hir::map::DefPathHash;
55-
use hir::HirId;
52+
use crate::mir::interpret::GlobalId;
53+
use crate::hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
54+
use crate::hir::map::DefPathHash;
55+
use crate::hir::HirId;
5656

57-
use ich::{Fingerprint, StableHashingContext};
57+
use crate::ich::{Fingerprint, StableHashingContext};
5858
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
5959
use std::fmt;
6060
use std::hash::Hash;
6161
use syntax_pos::symbol::InternedString;
62-
use traits;
63-
use traits::query::{
62+
use crate::traits;
63+
use crate::traits::query::{
6464
CanonicalProjectionGoal, CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal,
6565
CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, CanonicalPredicateGoal,
6666
CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal,
6767
};
68-
use ty::{TyCtxt, FnSig, Instance, InstanceDef,
68+
use crate::ty::{TyCtxt, FnSig, Instance, InstanceDef,
6969
ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty};
70-
use ty::subst::Substs;
70+
use crate::ty::subst::Substs;
7171

7272
// erase!() just makes tokens go away. It's used to specify which macro argument
7373
// 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 {
389389

390390
write!(f, "(")?;
391391

392-
::ty::tls::with_opt(|opt_tcx| {
392+
crate::ty::tls::with_opt(|opt_tcx| {
393393
if let Some(tcx) = opt_tcx {
394394
if let Some(def_id) = self.extract_def_id(tcx) {
395395
write!(f, "{}", tcx.def_path_debug_str(def_id))?;
@@ -825,6 +825,6 @@ impl WorkProductId {
825825
}
826826
}
827827

828-
impl_stable_hash_for!(struct ::dep_graph::WorkProductId {
828+
impl_stable_hash_for!(struct crate::dep_graph::WorkProductId {
829829
hash
830830
});

src/librustc/dep_graph/dep_tracking_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxHashMap;
22
use std::cell::RefCell;
33
use std::hash::Hash;
44
use std::marker::PhantomData;
5-
use util::common::MemoizationMap;
5+
use crate::util::common::MemoizationMap;
66

77
use super::{DepKind, DepNodeIndex, DepGraph};
88

src/librustc/dep_graph/graph.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use errors::{Diagnostic, DiagnosticBuilder};
1+
use crate::errors::{Diagnostic, DiagnosticBuilder};
22
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
33
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
44
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
@@ -7,11 +7,11 @@ use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, Ordering};
77
use std::env;
88
use std::hash::Hash;
99
use std::collections::hash_map::Entry;
10-
use ty::{self, TyCtxt};
11-
use util::common::{ProfileQueriesMsg, profq_msg};
10+
use crate::ty::{self, TyCtxt};
11+
use crate::util::common::{ProfileQueriesMsg, profq_msg};
1212
use parking_lot::{Mutex, Condvar};
1313

14-
use ich::{StableHashingContext, StableHashingContextProvider, Fingerprint};
14+
use crate::ich::{StableHashingContext, StableHashingContextProvider, Fingerprint};
1515

1616
use super::debug::EdgeFilter;
1717
use super::dep_node::{DepNode, DepKind, WorkProductId};
@@ -669,7 +669,7 @@ impl DepGraph {
669669
// We failed to mark it green, so we try to force the query.
670670
debug!("try_mark_previous_green({:?}) --- trying to force \
671671
dependency {:?}", dep_node, dep_dep_node);
672-
if ::ty::query::force_from_dep_node(tcx, dep_dep_node) {
672+
if crate::ty::query::force_from_dep_node(tcx, dep_dep_node) {
673673
let dep_dep_node_color = data.colors.get(dep_dep_node_index);
674674

675675
match dep_dep_node_color {

src/librustc/dep_graph/prev.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use ich::Fingerprint;
1+
use crate::ich::Fingerprint;
22
use rustc_data_structures::fx::FxHashMap;
33
use super::dep_node::DepNode;
44
use super::serialized::{SerializedDepGraph, SerializedDepNodeIndex};

src/librustc/dep_graph/safe.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! The `DepGraphSafe` trait
22
3-
use hir::BodyId;
4-
use hir::def_id::DefId;
3+
use crate::hir::BodyId;
4+
use crate::hir::def_id::DefId;
55
use syntax::ast::NodeId;
6-
use ty::TyCtxt;
6+
use crate::ty::TyCtxt;
77

88
/// The `DepGraphSafe` trait is used to specify what kinds of values
99
/// are safe to "leak" into a task. The idea is that this should be

src/librustc/dep_graph/serialized.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The data that we will serialize and deserialize.
22
3-
use dep_graph::DepNode;
4-
use ich::Fingerprint;
3+
use crate::dep_graph::DepNode;
4+
use crate::ich::Fingerprint;
55
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
66

77
newtype_index! {

src/librustc/hir/check_attr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
//! item.
66
77

8-
use ty::TyCtxt;
9-
use ty::query::Providers;
8+
use crate::ty::TyCtxt;
9+
use crate::ty::query::Providers;
1010

11-
use hir;
12-
use hir::def_id::DefId;
13-
use hir::intravisit::{self, Visitor, NestedVisitorMap};
11+
use crate::hir;
12+
use crate::hir::def_id::DefId;
13+
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
1414
use std::fmt::{self, Display};
1515
use syntax_pos::Span;
1616

src/librustc/hir/def.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use hir::def_id::DefId;
2-
use util::nodemap::{NodeMap, DefIdMap};
1+
use crate::hir::def_id::DefId;
2+
use crate::util::nodemap::{NodeMap, DefIdMap};
33
use syntax::ast;
44
use syntax::ext::base::MacroKind;
55
use syntax_pos::Span;
6-
use hir;
7-
use ty;
6+
use crate::hir;
7+
use crate::ty;
88

99
use self::Namespace::*;
1010

src/librustc/hir/def_id.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use ty;
2-
use ty::TyCtxt;
3-
use hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX;
1+
use crate::ty;
2+
use crate::ty::TyCtxt;
3+
use crate::hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX;
44
use rustc_data_structures::indexed_vec::Idx;
55
use serialize;
66
use std::fmt;

src/librustc/hir/intravisit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
3434
use syntax::ast::{NodeId, CRATE_NODE_ID, Ident, Name, Attribute};
3535
use syntax_pos::Span;
36-
use hir::*;
37-
use hir::def::Def;
38-
use hir::map::Map;
36+
use crate::hir::*;
37+
use crate::hir::def::Def;
38+
use crate::hir::map::Map;
3939
use super::itemlikevisit::DeepVisitor;
4040

4141
#[derive(Copy, Clone)]

src/librustc/hir/lowering.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@
3030
//! get confused if the spans from leaf AST nodes occur in multiple places
3131
//! in the HIR, especially for multiple identifiers.
3232
33-
use dep_graph::DepGraph;
34-
use errors::Applicability;
35-
use hir::{self, ParamName};
36-
use hir::HirVec;
37-
use hir::map::{DefKey, DefPathData, Definitions};
38-
use hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CRATE_DEF_INDEX};
39-
use hir::def::{Def, PathResolution, PerNS};
40-
use hir::GenericArg;
41-
use lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
33+
use crate::dep_graph::DepGraph;
34+
use crate::errors::Applicability;
35+
use crate::hir::{self, ParamName};
36+
use crate::hir::HirVec;
37+
use crate::hir::map::{DefKey, DefPathData, Definitions};
38+
use crate::hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CRATE_DEF_INDEX};
39+
use crate::hir::def::{Def, PathResolution, PerNS};
40+
use crate::hir::GenericArg;
41+
use crate::lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
4242
ELIDED_LIFETIMES_IN_PATHS};
43-
use middle::cstore::CrateStore;
43+
use crate::middle::cstore::CrateStore;
4444
use rustc_data_structures::fx::FxHashSet;
4545
use rustc_data_structures::indexed_vec::IndexVec;
4646
use rustc_data_structures::thin_vec::ThinVec;
47-
use session::Session;
48-
use session::config::nightly_options;
49-
use util::common::FN_OUTPUT_NAME;
50-
use util::nodemap::{DefIdMap, NodeMap};
47+
use crate::session::Session;
48+
use crate::session::config::nightly_options;
49+
use crate::util::common::FN_OUTPUT_NAME;
50+
use crate::util::nodemap::{DefIdMap, NodeMap};
5151

5252
use std::collections::{BTreeSet, BTreeMap};
5353
use std::fmt::Debug;

src/librustc/hir/map/blocks.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
//! nested within a uniquely determined `FnLike`), and users can ask
1212
//! for the `Code` associated with a particular NodeId.
1313
14-
use hir as ast;
15-
use hir::map;
16-
use hir::{Expr, FnDecl, Node};
17-
use hir::intravisit::FnKind;
14+
use crate::hir as ast;
15+
use crate::hir::map;
16+
use crate::hir::{Expr, FnDecl, Node};
17+
use crate::hir::intravisit::FnKind;
1818
use syntax::ast::{Attribute, Ident, NodeId};
1919
use syntax_pos::Span;
2020

src/librustc/hir/map/collector.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
use super::*;
2-
use dep_graph::{DepGraph, DepKind, DepNodeIndex};
3-
use hir;
4-
use hir::def_id::{LOCAL_CRATE, CrateNum};
5-
use hir::intravisit::{Visitor, NestedVisitorMap};
2+
use crate::dep_graph::{DepGraph, DepKind, DepNodeIndex};
3+
use crate::hir;
4+
use crate::hir::def_id::{LOCAL_CRATE, CrateNum};
5+
use crate::hir::intravisit::{Visitor, NestedVisitorMap};
66
use rustc_data_structures::svh::Svh;
7-
use ich::Fingerprint;
8-
use middle::cstore::CrateStore;
9-
use session::CrateDisambiguator;
10-
use session::Session;
7+
use crate::ich::Fingerprint;
8+
use crate::middle::cstore::CrateStore;
9+
use crate::session::CrateDisambiguator;
10+
use crate::session::Session;
1111
use std::iter::repeat;
1212
use syntax::ast::{NodeId, CRATE_NODE_ID};
1313
use syntax::source_map::SourceMap;
1414
use syntax_pos::Span;
1515

16-
use ich::StableHashingContext;
16+
use crate::ich::StableHashingContext;
1717
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult};
1818

1919
/// A Visitor that walks over the HIR and collects Nodes into a HIR map
@@ -253,7 +253,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
253253
None => format!("{:?}", node)
254254
};
255255

256-
let forgot_str = if hir_id == ::hir::DUMMY_HIR_ID {
256+
let forgot_str = if hir_id == crate::hir::DUMMY_HIR_ID {
257257
format!("\nMaybe you forgot to lower the node id {:?}?", id)
258258
} else {
259259
String::new()

src/librustc/hir/map/def_collector.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use hir::map::definitions::*;
2-
use hir::def_id::{CRATE_DEF_INDEX, DefIndex, DefIndexAddressSpace};
3-
use session::CrateDisambiguator;
1+
use crate::hir::map::definitions::*;
2+
use crate::hir::def_id::{CRATE_DEF_INDEX, DefIndex, DefIndexAddressSpace};
3+
use crate::session::CrateDisambiguator;
44

55
use syntax::ast::*;
66
use syntax::ext::hygiene::Mark;
@@ -10,7 +10,7 @@ use syntax::symbol::Symbol;
1010
use syntax::parse::token::{self, Token};
1111
use syntax_pos::Span;
1212

13-
use hir::map::{ITEM_LIKE_SPACE, REGULAR_SPACE};
13+
use crate::hir::map::{ITEM_LIKE_SPACE, REGULAR_SPACE};
1414

1515
/// Creates def ids for nodes in the AST.
1616
pub struct DefCollector<'a> {

src/librustc/hir/map/definitions.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
//! There are also some rather random cases (like const initializer
55
//! expressions) that are mostly just leftovers.
66
7-
use hir;
8-
use hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, DefIndexAddressSpace,
7+
use crate::hir;
8+
use crate::hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, DefIndexAddressSpace,
99
CRATE_DEF_INDEX};
10-
use ich::Fingerprint;
10+
use crate::ich::Fingerprint;
1111
use rustc_data_structures::fx::FxHashMap;
1212
use rustc_data_structures::indexed_vec::{IndexVec};
1313
use rustc_data_structures::stable_hasher::StableHasher;
1414
use serialize::{Encodable, Decodable, Encoder, Decoder};
15-
use session::CrateDisambiguator;
15+
use crate::session::CrateDisambiguator;
1616
use std::borrow::Borrow;
1717
use std::fmt::Write;
1818
use std::hash::Hash;
1919
use syntax::ast;
2020
use syntax::ext::hygiene::Mark;
2121
use syntax::symbol::{Symbol, InternedString};
2222
use syntax_pos::{Span, DUMMY_SP};
23-
use util::nodemap::NodeMap;
23+
use crate::util::nodemap::NodeMap;
2424

2525
/// The DefPathTable maps DefIndexes to DefKeys and vice versa.
2626
/// Internally the DefPathTable holds a tree of DefKeys, where each DefKey

src/librustc/hir/map/hir_id_validator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
2-
use hir::{self, intravisit, HirId, ItemLocalId};
1+
use crate::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
2+
use crate::hir::{self, intravisit, HirId, ItemLocalId};
33
use syntax::ast::NodeId;
4-
use hir::itemlikevisit::ItemLikeVisitor;
4+
use crate::hir::itemlikevisit::ItemLikeVisitor;
55
use rustc_data_structures::fx::FxHashMap;
66
use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter};
77

0 commit comments

Comments
 (0)