Skip to content

Commit 1cee809

Browse files
committed
Update tests and lint logic so that they compile.
1 parent 1329e9a commit 1cee809

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

clippy_lints/src/utils/internal_lints.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use crate::utils::{
44
};
55
use if_chain::if_chain;
66
use rustc::hir::map::Map;
7-
use rustc_ast::ast::{Crate as AstCrate, ItemKind, LitKind, Name, NodeId};
7+
use rustc_ast::ast;
8+
use rustc_ast::ast::{Crate as AstCrate, Expr as AstExpr, ItemKind, LitKind, Name, NodeId};
89
use rustc_ast::visit::FnKind;
10+
use rustc_ast::ptr::P;
911
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1012
use rustc_errors::Applicability;
1113
use rustc_hir as hir;
@@ -16,10 +18,8 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass};
1618
use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass};
1719
use rustc_span::source_map::{Span, Spanned};
1820
use rustc_span::symbol::SymbolStr;
19-
use syntax::ast;
20-
use syntax::ast::{Crate as AstCrate, ItemKind, LitKind, Name, Expr as AstExpr};
21-
use syntax::ptr::P;
22-
use syntax::visit::FnKind;
21+
22+
2323
use std::borrow::Cow;
2424

2525
declare_clippy_lint! {

tests/ui/collapsible_span_lint_calls.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
extern crate rustc_session;
66
extern crate rustc_errors;
77
extern crate rustc_lint;
8-
extern crate syntax;
8+
extern crate rustc_ast;
99
extern crate rustc_span;
1010

1111
use rustc_session::{declare_tool_lint, declare_lint_pass};
1212
use rustc_errors::{DiagnosticBuilder, Applicability};
1313
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext, Lint};
14-
use syntax::ast::Expr;
14+
use rustc_ast::ast::Expr;
1515
use rustc_span::source_map::Span;
1616

1717
#[allow(unused_variables)]
@@ -41,11 +41,17 @@ impl EarlyLintPass for Pass {
4141
db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable);
4242
});
4343
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
44-
db.span_help(expr.span, help_msg)
44+
db.span_help(expr.span, help_msg);
4545
});
46-
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db|
47-
db.span_note(expr.span, note_msg)
48-
);
46+
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
47+
db.span_note(expr.span, note_msg);
48+
});
49+
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
50+
db.note(note_msg);
51+
});
52+
span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
53+
db.help(help_msg);
54+
})
4955
}
5056
}
5157

0 commit comments

Comments
 (0)