Skip to content

Commit 50df4d1

Browse files
authored
Rollup merge of rust-lang#58247 - taiki-e:librustc_passes-2018, r=Centril
librustc_passes => 2018 Transitions `librustc_passes` to Rust 2018; cc rust-lang#58099 r? @Centril
2 parents 543f457 + bf531bd commit 50df4d1

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
@@ -17,10 +17,11 @@ use syntax::source_map::Spanned;
1717
use syntax::symbol::keywords;
1818
use syntax::ptr::P;
1919
use syntax::visit::{self, Visitor};
20+
use syntax::{span_err, struct_span_err, walk_list};
2021
use syntax_ext::proc_macro_decls::is_proc_macro_attr;
2122
use syntax_pos::Span;
22-
use errors;
2323
use errors::Applicability;
24+
use log::debug;
2425

2526
struct AstValidator<'a> {
2627
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
@@ -11,18 +11,10 @@
1111

1212
#![recursion_limit="256"]
1313

14-
#[macro_use]
15-
extern crate rustc;
16-
extern crate rustc_mir;
17-
extern crate rustc_data_structures;
14+
#![deny(rust_2018_idioms)]
1815

1916
#[macro_use]
20-
extern crate log;
21-
#[macro_use]
22-
extern crate syntax;
23-
extern crate syntax_ext;
24-
extern crate syntax_pos;
25-
extern crate rustc_errors as errors;
17+
extern crate rustc;
2618

2719
use rustc::ty::query::Providers;
2820

@@ -36,7 +28,7 @@ pub mod loops;
3628

3729
__build_diagnostic_array! { librustc_passes, DIAGNOSTICS }
3830

39-
pub fn provide(providers: &mut Providers) {
31+
pub fn provide(providers: &mut Providers<'_>) {
4032
rvalue_promotion::provide(providers);
4133
loops::provide(providers);
4234
}

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,
@@ -621,7 +622,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
621622
fn consume(&mut self,
622623
_consume_id: ast::NodeId,
623624
_consume_span: Span,
624-
_cmt: &mc::cmt_,
625+
_cmt: &mc::cmt_<'_>,
625626
_mode: euv::ConsumeMode) {}
626627

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

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

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

0 commit comments

Comments
 (0)