Skip to content

Commit 24a0cae

Browse files
committed
librustc_driver => 2018
1 parent 07d3508 commit 24a0cae

File tree

3 files changed

+23
-45
lines changed

3 files changed

+23
-45
lines changed

src/librustc_driver/Cargo.toml

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

67
[lib]
78
name = "rustc_driver"
@@ -13,14 +14,14 @@ arena = { path = "../libarena" }
1314
graphviz = { path = "../libgraphviz" }
1415
log = "0.4"
1516
env_logger = { version = "0.5", default-features = false }
16-
rustc-rayon = "0.1.2"
17+
rayon = { version = "0.1.2", package = "rustc-rayon" }
1718
scoped-tls = "1.0"
1819
rustc = { path = "../librustc" }
1920
rustc_allocator = { path = "../librustc_allocator" }
2021
rustc_target = { path = "../librustc_target" }
2122
rustc_borrowck = { path = "../librustc_borrowck" }
2223
rustc_data_structures = { path = "../librustc_data_structures" }
23-
rustc_errors = { path = "../librustc_errors" }
24+
errors = { path = "../librustc_errors", package = "rustc_errors" }
2425
rustc_incremental = { path = "../librustc_incremental" }
2526
rustc_lint = { path = "../librustc_lint" }
2627
rustc_metadata = { path = "../librustc_metadata" }

src/librustc_driver/lib.rs

+2-29
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,13 @@
1616

1717
#![recursion_limit="256"]
1818

19-
extern crate arena;
19+
#![deny(rust_2018_idioms)]
20+
2021
pub extern crate getopts;
21-
extern crate graphviz;
22-
extern crate env_logger;
2322
#[cfg(unix)]
2423
extern crate libc;
25-
extern crate rustc_rayon as rayon;
26-
extern crate rustc;
27-
extern crate rustc_allocator;
28-
extern crate rustc_target;
29-
extern crate rustc_borrowck;
30-
extern crate rustc_data_structures;
31-
extern crate rustc_errors as errors;
32-
extern crate rustc_passes;
33-
extern crate rustc_lint;
34-
extern crate rustc_plugin;
35-
extern crate rustc_privacy;
36-
extern crate rustc_incremental;
37-
extern crate rustc_metadata;
38-
extern crate rustc_mir;
39-
extern crate rustc_resolve;
40-
extern crate rustc_save_analysis;
41-
extern crate rustc_traits;
42-
extern crate rustc_codegen_utils;
43-
extern crate rustc_typeck;
44-
extern crate rustc_interface;
45-
extern crate scoped_tls;
46-
extern crate serialize;
47-
extern crate smallvec;
4824
#[macro_use]
4925
extern crate log;
50-
extern crate syntax;
51-
extern crate syntax_ext;
52-
extern crate syntax_pos;
5326

5427
use pretty::{PpMode, UserIdentifiedItem};
5528

src/librustc_driver/pretty.rs

+18-14
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ pub use self::UserIdentifiedItem::*;
3535
pub use self::PpSourceMode::*;
3636
pub use self::PpMode::*;
3737
use self::NodesMatchingUII::*;
38-
use abort_on_err;
38+
use crate::abort_on_err;
3939

40-
use source_name;
40+
use crate::source_name;
4141

4242
#[derive(Copy, Clone, PartialEq, Debug)]
4343
pub enum PpSourceMode {
@@ -191,7 +191,7 @@ impl PpSourceMode {
191191
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
192192
f: F
193193
) -> A
194-
where F: FnOnce(&dyn HirPrinterSupport, &hir::Crate) -> A
194+
where F: FnOnce(&dyn HirPrinterSupport<'_>, &hir::Crate) -> A
195195
{
196196
match *self {
197197
PpmNormal => {
@@ -296,7 +296,7 @@ impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
296296

297297
impl<'hir> pprust::PpAnn for NoAnn<'hir> {}
298298
impl<'hir> pprust_hir::PpAnn for NoAnn<'hir> {
299-
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
299+
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
300300
-> io::Result<()> {
301301
if let Some(tcx) = self.tcx {
302302
pprust_hir::PpAnn::nested(tcx.hir(), state, nested)
@@ -322,13 +322,13 @@ impl<'hir> PrinterSupport for IdentifiedAnnotation<'hir> {
322322
}
323323

324324
impl<'hir> pprust::PpAnn for IdentifiedAnnotation<'hir> {
325-
fn pre(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
325+
fn pre(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
326326
match node {
327327
pprust::AnnNode::Expr(_) => s.popen(),
328328
_ => Ok(()),
329329
}
330330
}
331-
fn post(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
331+
fn post(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
332332
match node {
333333
pprust::AnnNode::Ident(_) |
334334
pprust::AnnNode::Name(_) => Ok(()),
@@ -373,21 +373,21 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
373373
}
374374

375375
impl<'hir> pprust_hir::PpAnn for IdentifiedAnnotation<'hir> {
376-
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
376+
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
377377
-> io::Result<()> {
378378
if let Some(ref tcx) = self.tcx {
379379
pprust_hir::PpAnn::nested(tcx.hir(), state, nested)
380380
} else {
381381
Ok(())
382382
}
383383
}
384-
fn pre(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
384+
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
385385
match node {
386386
pprust_hir::AnnNode::Expr(_) => s.popen(),
387387
_ => Ok(()),
388388
}
389389
}
390-
fn post(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
390+
fn post(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
391391
match node {
392392
pprust_hir::AnnNode::Name(_) => Ok(()),
393393
pprust_hir::AnnNode::Item(item) => {
@@ -434,7 +434,7 @@ impl<'a> PrinterSupport for HygieneAnnotation<'a> {
434434
}
435435

436436
impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
437-
fn post(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
437+
fn post(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
438438
match node {
439439
pprust::AnnNode::Ident(&ast::Ident { name, span }) => {
440440
s.s.space()?;
@@ -476,7 +476,7 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
476476
}
477477

478478
impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
479-
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
479+
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
480480
-> io::Result<()> {
481481
let old_tables = self.tables.get();
482482
if let pprust_hir::Nested::Body(id) = nested {
@@ -486,13 +486,13 @@ impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
486486
self.tables.set(old_tables);
487487
Ok(())
488488
}
489-
fn pre(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
489+
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
490490
match node {
491491
pprust_hir::AnnNode::Expr(_) => s.popen(),
492492
_ => Ok(()),
493493
}
494494
}
495-
fn post(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
495+
fn post(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
496496
match node {
497497
pprust_hir::AnnNode::Expr(expr) => {
498498
s.s.space()?;
@@ -580,7 +580,11 @@ impl UserIdentifiedItem {
580580
}
581581
}
582582

583-
fn to_one_node_id(self, user_option: &str, sess: &Session, map: &hir_map::Map) -> ast::NodeId {
583+
fn to_one_node_id(self,
584+
user_option: &str,
585+
sess: &Session,
586+
map: &hir_map::Map<'_>)
587+
-> ast::NodeId {
584588
let fail_because = |is_wrong_because| -> ast::NodeId {
585589
let message = format!("{} needs NodeId (int) or unique path suffix (b::c::d); got \
586590
{}, which {}",

0 commit comments

Comments
 (0)