Skip to content

Commit b604b5e

Browse files
committed
Fix fulldeps tests.
1 parent a0b4ad1 commit b604b5e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ macro_rules! fake_lint_pass {
3131
$(
3232
if !cx.sess().contains_name(&krate.item.attrs, $attr) {
3333
cx.lint(CRATE_NOT_OKAY, |lint| {
34+
let span = cx.tcx.hir().span(rustc_hir::CRATE_HIR_ID);
3435
let msg = format!("crate is not marked with #![{}]", $attr);
35-
lint.build(&msg).set_span(krate.item.span).emit()
36+
lint.build(&msg).set_span(span).emit()
3637
});
3738
}
3839
)*

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
2929
fn check_crate(&mut self, cx: &LateContext, krate: &rustc_hir::Crate) {
3030
if !cx.sess().contains_name(&krate.item.attrs, Symbol::intern("crate_okay")) {
3131
cx.lint(CRATE_NOT_OKAY, |lint| {
32+
let span = cx.tcx.hir().span(rustc_hir::CRATE_HIR_ID);
3233
lint.build("crate is not marked with #![crate_okay]")
33-
.set_span(krate.item.span)
34+
.set_span(span)
3435
.emit()
3536
});
3637
}

0 commit comments

Comments
 (0)