Update tests
This commit is contained in:
parent
7118f71ea1
commit
8b8041efc0
2 changed files with 4 additions and 4 deletions
|
@ -29,10 +29,10 @@ macro_rules! fake_lint_pass {
|
|||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for $struct {
|
||||
fn check_crate(&mut self, cx: &LateContext, krate: &rustc_hir::Crate) {
|
||||
$(
|
||||
if !attr::contains_name(&krate.attrs, $attr) {
|
||||
if !attr::contains_name(&krate.item.attrs, $attr) {
|
||||
cx.lint(CRATE_NOT_OKAY, |lint| {
|
||||
let msg = format!("crate is not marked with #![{}]", $attr);
|
||||
lint.build(&msg).set_span(krate.span).emit()
|
||||
lint.build(&msg).set_span(krate.item.span).emit()
|
||||
});
|
||||
}
|
||||
)*
|
||||
|
|
|
@ -27,10 +27,10 @@ declare_lint_pass!(Pass => [CRATE_NOT_OKAY]);
|
|||
|
||||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
||||
fn check_crate(&mut self, cx: &LateContext, krate: &rustc_hir::Crate) {
|
||||
if !attr::contains_name(&krate.attrs, Symbol::intern("crate_okay")) {
|
||||
if !attr::contains_name(&krate.item.attrs, Symbol::intern("crate_okay")) {
|
||||
cx.lint(CRATE_NOT_OKAY, |lint| {
|
||||
lint.build("crate is not marked with #![crate_okay]")
|
||||
.set_span(krate.span)
|
||||
.set_span(krate.item.span)
|
||||
.emit()
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue