Skip to content

Commit bf531bd

Browse files
committed
librustc_passes => 2018
1 parent b139669 commit bf531bd

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

src/librustc_passes/Cargo.toml

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

67
[lib]
78
name = "rustc_passes"
@@ -16,4 +17,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
1617
syntax = { path = "../libsyntax" }
1718
syntax_ext = { path = "../libsyntax_ext" }
1819
syntax_pos = { path = "../libsyntax_pos" }
19-
rustc_errors = { path = "../librustc_errors" }
20+
errors = { path = "../librustc_errors", package = "rustc_errors" }

src/librustc_passes/ast_validation.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ use syntax::source_map::Spanned;
1515
use syntax::symbol::keywords;
1616
use syntax::ptr::P;
1717
use syntax::visit::{self, Visitor};
18+
use syntax::{span_err, struct_span_err, walk_list};
1819
use syntax_ext::proc_macro_decls::is_proc_macro_attr;
1920
use syntax_pos::Span;
20-
use errors;
2121
use errors::Applicability;
22+
use log::debug;
2223

2324
struct AstValidator<'a> {
2425
session: &'a Session,

src/librustc_passes/diagnostics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![allow(non_snake_case)]
22

3+
use syntax::{register_diagnostic, register_diagnostics, register_long_diagnostics};
4+
35
register_long_diagnostics! {
46
/*
57
E0014: r##"

src/librustc_passes/hir_stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'k> StatCollector<'k> {
6161
});
6262

6363
entry.count += 1;
64-
entry.size = ::std::mem::size_of_val(node);
64+
entry.size = std::mem::size_of_val(node);
6565
}
6666

6767
fn print(&self, title: &str) {

src/librustc_passes/lib.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,10 @@
1313

1414
#![recursion_limit="256"]
1515

16-
#[macro_use]
17-
extern crate rustc;
18-
extern crate rustc_mir;
19-
extern crate rustc_data_structures;
16+
#![deny(rust_2018_idioms)]
2017

2118
#[macro_use]
22-
extern crate log;
23-
#[macro_use]
24-
extern crate syntax;
25-
extern crate syntax_ext;
26-
extern crate syntax_pos;
27-
extern crate rustc_errors as errors;
19+
extern crate rustc;
2820

2921
use rustc::ty::query::Providers;
3022

@@ -38,7 +30,7 @@ pub mod loops;
3830

3931
__build_diagnostic_array! { librustc_passes, DIAGNOSTICS }
4032

41-
pub fn provide(providers: &mut Providers) {
33+
pub fn provide(providers: &mut Providers<'_>) {
4234
rvalue_promotion::provide(providers);
4335
loops::provide(providers);
4436
}

src/librustc_passes/loops.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use self::Context::*;
1+
use Context::*;
22

33
use rustc::session::Session;
44

@@ -9,6 +9,7 @@ use rustc::hir::map::Map;
99
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
1010
use rustc::hir::{self, Node, Destination};
1111
use syntax::ast;
12+
use syntax::struct_span_err;
1213
use syntax_pos::Span;
1314
use errors::Applicability;
1415

@@ -59,7 +60,7 @@ fn check_mod_loops<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
5960
}.as_deep_visitor());
6061
}
6162

62-
pub(crate) fn provide(providers: &mut Providers) {
63+
pub(crate) fn provide(providers: &mut Providers<'_>) {
6364
*providers = Providers {
6465
check_mod_loops,
6566
..*providers

src/librustc_passes/rvalue_promotion.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ use rustc::hir;
2828
use rustc_data_structures::sync::Lrc;
2929
use syntax::ast;
3030
use syntax_pos::{Span, DUMMY_SP};
31-
use self::Promotability::*;
31+
use log::debug;
32+
use Promotability::*;
3233
use std::ops::{BitAnd, BitAndAssign, BitOr};
3334

34-
pub fn provide(providers: &mut Providers) {
35+
pub fn provide(providers: &mut Providers<'_>) {
3536
*providers = Providers {
3637
rvalue_promotable_map,
3738
const_is_rvalue_promotable_to_static,
@@ -622,7 +623,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
622623
fn consume(&mut self,
623624
_consume_id: ast::NodeId,
624625
_consume_span: Span,
625-
_cmt: &mc::cmt_,
626+
_cmt: &mc::cmt_<'_>,
626627
_mode: euv::ConsumeMode) {}
627628

628629
fn borrow(&mut self,
@@ -681,11 +682,14 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
681682
fn mutate(&mut self,
682683
_assignment_id: ast::NodeId,
683684
_assignment_span: Span,
684-
_assignee_cmt: &mc::cmt_,
685+
_assignee_cmt: &mc::cmt_<'_>,
685686
_mode: euv::MutateMode) {
686687
}
687688

688-
fn matched_pat(&mut self, _: &hir::Pat, _: &mc::cmt_, _: euv::MatchMode) {}
689+
fn matched_pat(&mut self, _: &hir::Pat, _: &mc::cmt_<'_>, _: euv::MatchMode) {}
689690

690-
fn consume_pat(&mut self, _consume_pat: &hir::Pat, _cmt: &mc::cmt_, _mode: euv::ConsumeMode) {}
691+
fn consume_pat(&mut self,
692+
_consume_pat: &hir::Pat,
693+
_cmt: &mc::cmt_<'_>,
694+
_mode: euv::ConsumeMode) {}
691695
}

0 commit comments

Comments
 (0)