Switch to declare_tool_lint macro

This commit is contained in:
flip1995 2018-07-29 11:04:40 +02:00 committed by Manish Goregaokar
parent 392235d6e1
commit 8c07772dbb
117 changed files with 128 additions and 128 deletions

View file

@ -4,7 +4,7 @@
#![allow(print_stdout, use_debug)]
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir;
use rustc::hir::{Expr, ExprKind, QPath, TyKind, Pat, PatKind, BindingAnnotation, StmtKind, DeclKind, Stmt};
use rustc::hir::intravisit::{NestedVisitorMap, Visitor};

View file

@ -3,7 +3,7 @@
//! checks for attributes
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir;
use rustc::hir::print;
use syntax::ast::Attribute;

View file

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, EarlyContext, EarlyLintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::hir;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
@ -149,13 +149,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
for (lint_name, &lint_span) in &self.declared_lints {
// When using the `declare_lint!` macro, the original `lint_span`'s
// When using the `declare_tool_lint!` macro, the original `lint_span`'s
// file points to "<rustc macros>".
// `compiletest-rs` thinks that's an error in a different file and
// just ignores it. This causes the test in compile-fail/lint_pass
// not able to capture the error.
// Therefore, we need to climb the macro expansion tree and find the
// actual span that invoked `declare_lint!`:
// actual span that invoked `declare_tool_lint!`:
let lint_span = lint_span
.ctxt()
.outer()