Skip to content

Commit 659b0a2

Browse files
committed
Bless tests.
1 parent faa7d42 commit 659b0a2

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

src/test/run-make-fulldeps/obtain-borrowck/driver.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ fn main() {
4848
pub struct CompilerCalls;
4949

5050
impl rustc_driver::Callbacks for CompilerCalls {
51-
5251
// In this callback we override the mir_borrowck query.
5352
fn config(&mut self, config: &mut Config) {
5453
assert!(config.override_queries.is_none());
@@ -64,12 +63,10 @@ impl rustc_driver::Callbacks for CompilerCalls {
6463
) -> Compilation {
6564
compiler.session().abort_if_errors();
6665
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
67-
6866
// Collect definition ids of MIR bodies.
6967
let hir = tcx.hir();
70-
let krate = hir.krate();
7168
let mut visitor = HirVisitor { bodies: Vec::new() };
72-
krate.visit_all_item_likes(&mut visitor);
69+
hir.visit_all_item_likes(&mut visitor);
7370

7471
// Trigger borrow checking of all bodies.
7572
for def_id in visitor.bodies {

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern crate rustc_ast;
1313
use rustc_ast::attr;
1414
use rustc_driver::plugin::Registry;
1515
use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass};
16+
use rustc_span::def_id::CRATE_DEF_ID;
1617
use rustc_span::symbol::Symbol;
1718

1819
macro_rules! fake_lint_pass {
@@ -26,13 +27,14 @@ macro_rules! fake_lint_pass {
2627
}
2728

2829
impl LateLintPass<'_> for $struct {
29-
fn check_crate(&mut self, cx: &LateContext, krate: &rustc_hir::Crate) {
30+
fn check_crate(&mut self, cx: &LateContext) {
3031
let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
32+
let span = cx.tcx.def_span(CRATE_DEF_ID);
3133
$(
3234
if !cx.sess().contains_name(attrs, $attr) {
3335
cx.lint(CRATE_NOT_OKAY, |lint| {
3436
let msg = format!("crate is not marked with #![{}]", $attr);
35-
lint.build(&msg).set_span(krate.module().inner).emit()
37+
lint.build(&msg).set_span(span).emit()
3638
});
3739
}
3840
)*

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ extern crate rustc_hir;
88
extern crate rustc_lint;
99
#[macro_use]
1010
extern crate rustc_session;
11-
extern crate rustc_span;
1211
extern crate rustc_ast;
12+
extern crate rustc_span;
1313

1414
use rustc_driver::plugin::Registry;
15-
use rustc_lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
15+
use rustc_lint::{LateContext, LateLintPass, LintContext};
16+
use rustc_span::def_id::CRATE_DEF_ID;
1617
use rustc_span::symbol::Symbol;
17-
use rustc_ast::attr;
1818

1919
declare_lint! {
2020
CRATE_NOT_OKAY,
@@ -25,13 +25,12 @@ declare_lint! {
2525
declare_lint_pass!(Pass => [CRATE_NOT_OKAY]);
2626

2727
impl<'tcx> LateLintPass<'tcx> for Pass {
28-
fn check_crate(&mut self, cx: &LateContext, krate: &rustc_hir::Crate) {
28+
fn check_crate(&mut self, cx: &LateContext) {
2929
let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
30+
let span = cx.tcx.def_span(CRATE_DEF_ID);
3031
if !cx.sess().contains_name(attrs, Symbol::intern("crate_okay")) {
3132
cx.lint(CRATE_NOT_OKAY, |lint| {
32-
lint.build("crate is not marked with #![crate_okay]")
33-
.set_span(krate.module().inner)
34-
.emit()
33+
lint.build("crate is not marked with #![crate_okay]").set_span(span).emit()
3534
});
3635
}
3736
}

src/test/ui/privacy/privacy2.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ LL | pub fn foo() {}
2323

2424
error: requires `sized` lang_item
2525

26-
error: aborting due to 3 previous errors
26+
error: requires `sized` lang_item
27+
28+
error: requires `sized` lang_item
29+
30+
error: requires `sized` lang_item
31+
32+
error: aborting due to 6 previous errors
2733

2834
Some errors have detailed explanations: E0432, E0603.
2935
For more information about an error, try `rustc --explain E0432`.

src/test/ui/privacy/privacy3.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ LL | use bar::gpriv;
66

77
error: requires `sized` lang_item
88

9-
error: aborting due to 2 previous errors
9+
error: requires `sized` lang_item
10+
11+
error: requires `sized` lang_item
12+
13+
error: requires `sized` lang_item
14+
15+
error: aborting due to 5 previous errors
1016

1117
For more information about this error, try `rustc --explain E0432`.

0 commit comments

Comments
 (0)