提交 24a0caec 编写于 作者: T Taiki Endo

librustc_driver => 2018

上级 07d35089
......@@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc_driver"
version = "0.0.0"
edition = "2018"
[lib]
name = "rustc_driver"
......@@ -13,14 +14,14 @@ arena = { path = "../libarena" }
graphviz = { path = "../libgraphviz" }
log = "0.4"
env_logger = { version = "0.5", default-features = false }
rustc-rayon = "0.1.2"
rayon = { version = "0.1.2", package = "rustc-rayon" }
scoped-tls = "1.0"
rustc = { path = "../librustc" }
rustc_allocator = { path = "../librustc_allocator" }
rustc_target = { path = "../librustc_target" }
rustc_borrowck = { path = "../librustc_borrowck" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_incremental = { path = "../librustc_incremental" }
rustc_lint = { path = "../librustc_lint" }
rustc_metadata = { path = "../librustc_metadata" }
......
......@@ -16,40 +16,13 @@
#![recursion_limit="256"]
extern crate arena;
#![deny(rust_2018_idioms)]
pub extern crate getopts;
extern crate graphviz;
extern crate env_logger;
#[cfg(unix)]
extern crate libc;
extern crate rustc_rayon as rayon;
extern crate rustc;
extern crate rustc_allocator;
extern crate rustc_target;
extern crate rustc_borrowck;
extern crate rustc_data_structures;
extern crate rustc_errors as errors;
extern crate rustc_passes;
extern crate rustc_lint;
extern crate rustc_plugin;
extern crate rustc_privacy;
extern crate rustc_incremental;
extern crate rustc_metadata;
extern crate rustc_mir;
extern crate rustc_resolve;
extern crate rustc_save_analysis;
extern crate rustc_traits;
extern crate rustc_codegen_utils;
extern crate rustc_typeck;
extern crate rustc_interface;
extern crate scoped_tls;
extern crate serialize;
extern crate smallvec;
#[macro_use]
extern crate log;
extern crate syntax;
extern crate syntax_ext;
extern crate syntax_pos;
use pretty::{PpMode, UserIdentifiedItem};
......
......@@ -35,9 +35,9 @@
pub use self::PpSourceMode::*;
pub use self::PpMode::*;
use self::NodesMatchingUII::*;
use abort_on_err;
use crate::abort_on_err;
use source_name;
use crate::source_name;
#[derive(Copy, Clone, PartialEq, Debug)]
pub enum PpSourceMode {
......@@ -191,7 +191,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
f: F
) -> A
where F: FnOnce(&dyn HirPrinterSupport, &hir::Crate) -> A
where F: FnOnce(&dyn HirPrinterSupport<'_>, &hir::Crate) -> A
{
match *self {
PpmNormal => {
......@@ -296,7 +296,7 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust_hir::PpAnn {
impl<'hir> pprust::PpAnn for NoAnn<'hir> {}
impl<'hir> pprust_hir::PpAnn for NoAnn<'hir> {
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
-> io::Result<()> {
if let Some(tcx) = self.tcx {
pprust_hir::PpAnn::nested(tcx.hir(), state, nested)
......@@ -322,13 +322,13 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust::PpAnn {
}
impl<'hir> pprust::PpAnn for IdentifiedAnnotation<'hir> {
fn pre(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
fn pre(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
match node {
pprust::AnnNode::Expr(_) => s.popen(),
_ => Ok(()),
}
}
fn post(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
fn post(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
match node {
pprust::AnnNode::Ident(_) |
pprust::AnnNode::Name(_) => Ok(()),
......@@ -373,7 +373,7 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust_hir::PpAnn {
}
impl<'hir> pprust_hir::PpAnn for IdentifiedAnnotation<'hir> {
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
-> io::Result<()> {
if let Some(ref tcx) = self.tcx {
pprust_hir::PpAnn::nested(tcx.hir(), state, nested)
......@@ -381,13 +381,13 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
Ok(())
}
}
fn pre(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
match node {
pprust_hir::AnnNode::Expr(_) => s.popen(),
_ => Ok(()),
}
}
fn post(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
fn post(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
match node {
pprust_hir::AnnNode::Name(_) => Ok(()),
pprust_hir::AnnNode::Item(item) => {
......@@ -434,7 +434,7 @@ fn pp_ann(&self) -> &dyn pprust::PpAnn {
}
impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
fn post(&self, s: &mut pprust::State, node: pprust::AnnNode) -> io::Result<()> {
fn post(&self, s: &mut pprust::State<'_>, node: pprust::AnnNode<'_>) -> io::Result<()> {
match node {
pprust::AnnNode::Ident(&ast::Ident { name, span }) => {
s.s.space()?;
......@@ -476,7 +476,7 @@ fn node_path(&self, id: ast::NodeId) -> Option<String> {
}
impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested)
-> io::Result<()> {
let old_tables = self.tables.get();
if let pprust_hir::Nested::Body(id) = nested {
......@@ -486,13 +486,13 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
self.tables.set(old_tables);
Ok(())
}
fn pre(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
match node {
pprust_hir::AnnNode::Expr(_) => s.popen(),
_ => Ok(()),
}
}
fn post(&self, s: &mut pprust_hir::State, node: pprust_hir::AnnNode) -> io::Result<()> {
fn post(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) -> io::Result<()> {
match node {
pprust_hir::AnnNode::Expr(expr) => {
s.s.space()?;
......@@ -580,7 +580,11 @@ fn all_matching_node_ids<'a, 'hir>(&'a self,
}
}
fn to_one_node_id(self, user_option: &str, sess: &Session, map: &hir_map::Map) -> ast::NodeId {
fn to_one_node_id(self,
user_option: &str,
sess: &Session,
map: &hir_map::Map<'_>)
-> ast::NodeId {
let fail_because = |is_wrong_because| -> ast::NodeId {
let message = format!("{} needs NodeId (int) or unique path suffix (b::c::d); got \
{}, which {}",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册