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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 11 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

0 commit comments

Comments
 (0)