Skip to content

Commit 4f2e97e

Browse files
committed
librustc_incremental => 2018
1 parent 1efdda1 commit 4f2e97e

File tree

8 files changed

+29
-32
lines changed

8 files changed

+29
-32
lines changed

src/librustc_incremental/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_incremental"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "rustc_incremental"

src/librustc_incremental/assert_dep_graph.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
217217
}
218218
}
219219

220-
fn dump_graph(tcx: TyCtxt) {
220+
fn dump_graph(tcx: TyCtxt<'_, '_, '_>) {
221221
let path: String = env::var("RUST_DEP_GRAPH").unwrap_or_else(|_| "dep_graph".to_string());
222222
let query = tcx.dep_graph.query();
223223

@@ -261,11 +261,11 @@ pub struct GraphvizDepGraph<'q>(FxHashSet<&'q DepNode>,
261261
impl<'a, 'tcx, 'q> dot::GraphWalk<'a> for GraphvizDepGraph<'q> {
262262
type Node = &'q DepNode;
263263
type Edge = (&'q DepNode, &'q DepNode);
264-
fn nodes(&self) -> dot::Nodes<&'q DepNode> {
264+
fn nodes(&self) -> dot::Nodes<'_, &'q DepNode> {
265265
let nodes: Vec<_> = self.0.iter().cloned().collect();
266266
nodes.into()
267267
}
268-
fn edges(&self) -> dot::Edges<(&'q DepNode, &'q DepNode)> {
268+
fn edges(&self) -> dot::Edges<'_, (&'q DepNode, &'q DepNode)> {
269269
self.1[..].into()
270270
}
271271
fn source(&self, edge: &(&'q DepNode, &'q DepNode)) -> &'q DepNode {
@@ -279,18 +279,18 @@ impl<'a, 'tcx, 'q> dot::GraphWalk<'a> for GraphvizDepGraph<'q> {
279279
impl<'a, 'tcx, 'q> dot::Labeller<'a> for GraphvizDepGraph<'q> {
280280
type Node = &'q DepNode;
281281
type Edge = (&'q DepNode, &'q DepNode);
282-
fn graph_id(&self) -> dot::Id {
282+
fn graph_id(&self) -> dot::Id<'_> {
283283
dot::Id::new("DependencyGraph").unwrap()
284284
}
285-
fn node_id(&self, n: &&'q DepNode) -> dot::Id {
285+
fn node_id(&self, n: &&'q DepNode) -> dot::Id<'_> {
286286
let s: String =
287287
format!("{:?}", n).chars()
288288
.map(|c| if c == '_' || c.is_alphanumeric() { c } else { '_' })
289289
.collect();
290290
debug!("n={:?} s={:?}", n, s);
291291
dot::Id::new(s).unwrap()
292292
}
293-
fn node_label(&self, n: &&'q DepNode) -> dot::LabelText {
293+
fn node_label(&self, n: &&'q DepNode) -> dot::LabelText<'_> {
294294
dot::LabelText::label(format!("{:?}", n))
295295
}
296296
}

src/librustc_incremental/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99

1010
#![recursion_limit="256"]
1111

12-
extern crate graphviz;
12+
#![deny(rust_2018_idioms)]
13+
1314
#[macro_use] extern crate rustc;
14-
extern crate rustc_data_structures;
15-
extern crate serialize as rustc_serialize;
16-
extern crate rand;
17-
extern crate rustc_fs_util;
15+
#[allow(unused_extern_crates)]
16+
extern crate serialize as rustc_serialize; // used by deriving
1817

1918
#[macro_use] extern crate log;
20-
extern crate syntax;
21-
extern crate syntax_pos;
2219

2320
mod assert_dep_graph;
2421
pub mod assert_module_sources;

src/librustc_incremental/persist/dirty_clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for DirtyCleanVisitor<'a, 'tcx> {
538538
///
539539
/// Also make sure that the `label` and `except` fields do not
540540
/// both exist.
541-
fn check_config(tcx: TyCtxt, attr: &Attribute) -> bool {
541+
fn check_config(tcx: TyCtxt<'_, '_, '_>, attr: &Attribute) -> bool {
542542
debug!("check_config(attr={:?})", attr);
543543
let config = &tcx.sess.parse_sess.config;
544544
debug!("check_config: config={:?}", config);
@@ -573,7 +573,7 @@ fn check_config(tcx: TyCtxt, attr: &Attribute) -> bool {
573573
}
574574
}
575575

576-
fn expect_associated_value(tcx: TyCtxt, item: &NestedMetaItem) -> ast::Name {
576+
fn expect_associated_value(tcx: TyCtxt<'_, '_, '_>, item: &NestedMetaItem) -> ast::Name {
577577
if let Some(value) = item.value_str() {
578578
value
579579
} else {

src/librustc_incremental/persist/load.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc::util::common::time_ext;
99
use rustc_serialize::Decodable as RustcDecodable;
1010
use rustc_serialize::opaque::Decoder;
1111
use std::path::Path;
12-
use std;
1312

1413
use super::data::*;
1514
use super::fs::*;

src/librustc_incremental/persist/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ mod save;
1010
mod work_product;
1111
mod file_format;
1212

13-
pub use self::fs::finalize_session_directory;
14-
pub use self::fs::garbage_collect_session_directories;
15-
pub use self::fs::in_incr_comp_dir;
16-
pub use self::fs::in_incr_comp_dir_sess;
17-
pub use self::fs::prepare_session_directory;
18-
pub use self::load::dep_graph_tcx_init;
19-
pub use self::load::load_dep_graph;
20-
pub use self::load::load_query_result_cache;
21-
pub use self::load::LoadResult;
22-
pub use self::save::save_dep_graph;
23-
pub use self::save::save_work_product_index;
24-
pub use self::work_product::copy_cgu_workproducts_to_incr_comp_cache_dir;
25-
pub use self::work_product::delete_workproduct_files;
13+
pub use fs::finalize_session_directory;
14+
pub use fs::garbage_collect_session_directories;
15+
pub use fs::in_incr_comp_dir;
16+
pub use fs::in_incr_comp_dir_sess;
17+
pub use fs::prepare_session_directory;
18+
pub use load::dep_graph_tcx_init;
19+
pub use load::load_dep_graph;
20+
pub use load::load_query_result_cache;
21+
pub use load::LoadResult;
22+
pub use save::save_dep_graph;
23+
pub use save::save_work_product_index;
24+
pub use work_product::copy_cgu_workproducts_to_incr_comp_cache_dir;
25+
pub use work_product::delete_workproduct_files;

src/librustc_incremental/persist/save.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn save_in<F>(sess: &Session, path_buf: PathBuf, encode: F)
129129
}
130130
}
131131

132-
fn encode_dep_graph(tcx: TyCtxt,
132+
fn encode_dep_graph(tcx: TyCtxt<'_, '_, '_>,
133133
encoder: &mut Encoder) {
134134
// First encode the commandline arguments hash
135135
tcx.sess.opts.dep_tracking_hash().encode(encoder).unwrap();
@@ -234,7 +234,7 @@ fn encode_work_product_index(work_products: &FxHashMap<WorkProductId, WorkProduc
234234
serialized_products.encode(encoder).unwrap();
235235
}
236236

237-
fn encode_query_cache(tcx: TyCtxt,
237+
fn encode_query_cache(tcx: TyCtxt<'_, '_, '_>,
238238
encoder: &mut Encoder) {
239239
time(tcx.sess, "serialize query result cache", || {
240240
tcx.serialize_query_result_cache(encoder).unwrap();

src/librustc_incremental/persist/work_product.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This module contains files for saving intermediate work-products.
22
3-
use persist::fs::*;
3+
use crate::persist::fs::*;
44
use rustc::dep_graph::{WorkProduct, WorkProductId, WorkProductFileKind};
55
use rustc::session::Session;
66
use rustc_fs_util::link_or_copy;

0 commit comments

Comments
 (0)