Skip to content

Commit c1084a3

Browse files
committed
Changes to tests
1 parent d21bfff commit c1084a3

22 files changed

+20
-34
lines changed

src/librustc/lint/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ pub trait LintContext: Sized {
505505
impl<'a> EarlyContext<'a> {
506506
fn new(sess: &'a Session,
507507
krate: &'a ast::Crate) -> EarlyContext<'a> {
508-
// We want to own the lint store, so move it out of the session.
508+
// We want to own the lint store, so move it out of the session. Remember
509+
// to put it back later...
509510
let lint_store = mem::replace(&mut *sess.lint_store.borrow_mut(),
510511
LintStore::new());
511-
512512
EarlyContext {
513513
sess: sess,
514514
krate: krate,

src/librustc_driver/driver.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ pub fn compile_input(sess: Session,
129129
&ast_map.krate(),
130130
&id[..]));
131131

132+
time(sess.time_passes(), "early lint checks", || {
133+
lint::check_ast_crate(&sess, &expanded_crate)
134+
});
132135

133136
phase_3_run_analysis_passes(sess,
134137
ast_map,
@@ -597,10 +600,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
597600
sess.abort_if_errors();
598601
});
599602

600-
time(time_passes, "early lint checks", || {
601-
lint::check_ast_crate(sess, &krate)
602-
});
603-
604603
Some(krate)
605604
}
606605

src/test/auxiliary/lint_for_crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
extern crate rustc_front;
1818
extern crate syntax;
1919

20-
use rustc::lint::{Context, LintPass, LintPassObject, LintArray};
20+
use rustc::lint::{Context, LintContext, LintPass, LintPassObject, LintArray};
2121
use rustc::plugin::Registry;
2222
use rustc_front::hir;
2323
use syntax::attr;

src/test/auxiliary/lint_group_plugin_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern crate rustc_front;
2020
extern crate rustc;
2121

2222
use rustc_front::hir;
23-
use rustc::lint::{Context, LintPass, LintPassObject, LintArray};
23+
use rustc::lint::{Context, LintContext, LintPass, LintPassObject, LintArray};
2424
use rustc::plugin::Registry;
2525

2626
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");

src/test/auxiliary/lint_plugin_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
#![feature(plugin_registrar)]
1414
#![feature(box_syntax, rustc_private)]
1515

16-
extern crate rustc_front;
16+
extern crate syntax;
1717

1818
// Load rustc as a plugin to get macros
1919
#[macro_use]
2020
extern crate rustc;
2121

22-
use rustc::lint::{Context, LintPass, LintPassObject, LintArray};
22+
use rustc::lint::{EarlyContext, LintContext, LintPass, LintPassObject, LintArray};
2323
use rustc::plugin::Registry;
24-
use rustc_front::hir;
24+
use syntax::ast;
2525
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
2626

2727
struct Pass;
@@ -31,7 +31,7 @@ impl LintPass for Pass {
3131
lint_array!(TEST_LINT)
3232
}
3333

34-
fn check_item(&mut self, cx: &Context, it: &hir::Item) {
34+
fn check_ast_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
3535
if it.ident.name == "lintme" {
3636
cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'");
3737
}

src/test/compile-fail/autoderef-full-lval.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unknown_features)]
1211
#![feature(box_syntax)]
1312

1413
struct clam {

src/test/compile-fail/borrow-tuple-fields.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unknown_features)]
1211
#![feature(box_syntax)]
1312

1413
struct Foo(Box<isize>, isize);

src/test/compile-fail/cast-as-bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let u = (5 as bool);
12+
let u = 5 as bool;
1313
//~^ ERROR cannot cast as `bool`
1414
//~^^ HELP compare with zero instead
1515
}

src/test/compile-fail/dropck_arr_cycle_checked.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use std::cell::Cell;
1919
use id::Id;
2020

2121
mod s {
22-
#![allow(unstable)]
2322
use std::sync::atomic::{AtomicUsize, Ordering};
2423

2524
static S_COUNT: AtomicUsize = AtomicUsize::new(0);

src/test/compile-fail/dropck_tarena_cycle_checked.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// which is a reduction of this code to more directly show the reason
1717
// for the error message we see here.)
1818

19-
#![allow(unstable)]
2019
#![feature(const_fn)]
2120

2221
extern crate arena;
@@ -26,7 +25,6 @@ use std::cell::Cell;
2625
use id::Id;
2726

2827
mod s {
29-
#![allow(unstable)]
3028
use std::sync::atomic::{AtomicUsize, Ordering};
3129

3230
static S_COUNT: AtomicUsize = AtomicUsize::new(0);

0 commit comments

Comments
 (0)