Skip to content

Commit b761367

Browse files
Fix test fallout
1 parent dab3bd6 commit b761367

File tree

6 files changed

+31
-28
lines changed

6 files changed

+31
-28
lines changed

src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ use syntax::symbol::Symbol;
1515

1616
use rustc::hir;
1717
use rustc::hir::intravisit;
18-
use rustc::hir::map as hir_map;
1918
use hir::Node;
2019
use rustc::lint::{LateContext, LintPass, LintArray, LateLintPass, LintContext};
21-
use rustc::ty;
22-
use syntax::{ast, source_map};
20+
use syntax::source_map;
2321

2422
#[plugin_registrar]
2523
pub fn plugin_registrar(reg: &mut Registry) {
26-
reg.register_late_lint_pass(box MissingWhitelistedAttrPass);
24+
reg.lint_store.register_lints(&[&MISSING_WHITELISTED_ATTR]);
25+
reg.lint_store.register_late_pass(|| box MissingWhitelistedAttrPass);
2726
reg.register_attribute(Symbol::intern("whitelisted_attr"), Whitelisted);
2827
}
2928

src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,20 @@
77
extern crate rustc_driver;
88
extern crate syntax;
99

10-
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray};
10+
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass};
1111
use rustc_driver::plugin::Registry;
1212
use rustc::hir;
1313
use syntax::attr;
1414
use syntax::symbol::Symbol;
1515

1616
macro_rules! fake_lint_pass {
17-
($struct:ident, $lints:expr, $($attr:expr),*) => {
17+
($struct:ident, $($attr:expr),*) => {
1818
struct $struct;
1919

2020
impl LintPass for $struct {
2121
fn name(&self) -> &'static str {
2222
stringify!($struct)
2323
}
24-
25-
fn get_lints(&self) -> LintArray {
26-
$lints
27-
}
2824
}
2925

3026
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for $struct {
@@ -49,25 +45,29 @@ declare_lint!(CRATE_NOT_GREEN, Warn, "crate not marked with #![crate_green]");
4945

5046
fake_lint_pass! {
5147
PassOkay,
52-
lint_array!(CRATE_NOT_OKAY), // Single lint
5348
Symbol::intern("rustc_crate_okay")
5449
}
5550

5651
fake_lint_pass! {
5752
PassRedBlue,
58-
lint_array!(CRATE_NOT_RED, CRATE_NOT_BLUE), // Multiple lints
5953
Symbol::intern("rustc_crate_red"), Symbol::intern("rustc_crate_blue")
6054
}
6155

6256
fake_lint_pass! {
6357
PassGreyGreen,
64-
lint_array!(CRATE_NOT_GREY, CRATE_NOT_GREEN, ), // Trailing comma
6558
Symbol::intern("rustc_crate_grey"), Symbol::intern("rustc_crate_green")
6659
}
6760

6861
#[plugin_registrar]
6962
pub fn plugin_registrar(reg: &mut Registry) {
70-
reg.register_late_lint_pass(box PassOkay);
71-
reg.register_late_lint_pass(box PassRedBlue);
72-
reg.register_late_lint_pass(box PassGreyGreen);
63+
reg.lint_store.register_lints(&[
64+
&CRATE_NOT_OKAY,
65+
&CRATE_NOT_RED,
66+
&CRATE_NOT_BLUE,
67+
&CRATE_NOT_GREY,
68+
&CRATE_NOT_GREEN,
69+
]);
70+
reg.lint_store.register_late_pass(|| box PassOkay);
71+
reg.lint_store.register_late_pass(|| box PassRedBlue);
72+
reg.lint_store.register_late_pass(|| box PassGreyGreen);
7373
}

src/test/ui-fulldeps/auxiliary/lint-for-crate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern crate rustc_driver;
88
extern crate syntax;
99

10-
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray};
10+
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LintArray};
1111
use rustc_driver::plugin::Registry;
1212
use rustc::hir;
1313
use syntax::attr;
@@ -32,6 +32,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
3232

3333
#[plugin_registrar]
3434
pub fn plugin_registrar(reg: &mut Registry) {
35-
reg.register_lint(&[&CRATE_NOT_OKAY]);
36-
reg.register_late_lint_pass(|| box Pass);
35+
reg.lint_store.register_lints(&[&CRATE_NOT_OKAY]);
36+
reg.lint_store.register_late_pass(|| box Pass);
3737
}

src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern crate rustc;
99
extern crate rustc_driver;
1010

1111
use rustc::hir;
12-
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray};
12+
use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LintArray, LintId};
1313
use rustc_driver::plugin::Registry;
1414

1515
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
@@ -30,6 +30,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
3030

3131
#[plugin_registrar]
3232
pub fn plugin_registrar(reg: &mut Registry) {
33-
reg.register_late_lint_pass(box Pass);
34-
reg.register_lint_group("lint_me", None, vec![TEST_LINT, PLEASE_LINT]);
33+
reg.lint_store.register_lints(&[&TEST_LINT, &PLEASE_LINT]);
34+
reg.lint_store.register_late_pass(|| box Pass);
35+
reg.lint_store.register_group(true, "lint_me", None,
36+
vec![LintId::of(&TEST_LINT), LintId::of(&PLEASE_LINT)]);
3537
}

src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ extern crate syntax;
1010
extern crate rustc;
1111
extern crate rustc_driver;
1212

13-
use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass,
14-
EarlyLintPassObject, LintArray};
13+
use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass, LintArray};
1514
use rustc_driver::plugin::Registry;
1615
use syntax::ast;
1716
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
@@ -28,5 +27,6 @@ impl EarlyLintPass for Pass {
2827

2928
#[plugin_registrar]
3029
pub fn plugin_registrar(reg: &mut Registry) {
31-
reg.register_early_lint_pass(box Pass as EarlyLintPassObject);
30+
reg.lint_store.register_lints(&[&TEST_LINT]);
31+
reg.lint_store.register_early_pass(|| box Pass);
3232
}

src/test/ui-fulldeps/auxiliary/lint-tool-test.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate syntax;
88
extern crate rustc;
99
extern crate rustc_driver;
1010

11-
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
11+
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass, LintId};
1212
use rustc_driver::plugin::Registry;
1313
use syntax::ast;
1414
declare_tool_lint!(pub clippy::TEST_LINT, Warn, "Warn about stuff");
@@ -40,6 +40,8 @@ impl EarlyLintPass for Pass {
4040

4141
#[plugin_registrar]
4242
pub fn plugin_registrar(reg: &mut Registry) {
43-
reg.register_early_lint_pass(box Pass);
44-
reg.register_lint_group("clippy::group", Some("clippy_group"), vec![TEST_LINT, TEST_GROUP]);
43+
reg.lint_store.register_lints(&[&TEST_RUSTC_TOOL_LINT, &TEST_LINT, &TEST_GROUP]);
44+
reg.lint_store.register_early_pass(|| box Pass);
45+
reg.lint_store.register_group(true, "clippy::group", Some("clippy_group"),
46+
vec![LintId::of(&TEST_LINT), LintId::of(&TEST_GROUP)]);
4547
}

0 commit comments

Comments
 (0)