Skip to content

Commit c2b8882

Browse files
committed
Cleanup of rustup changes
1 parent d8f453d commit c2b8882

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

clippy_lints/src/regex.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use if_chain::if_chain;
55
use rustc_ast::ast::{LitKind, StrStyle};
66
use rustc_hir::{BorrowKind, Expr, ExprKind};
77
use rustc_lint::{LateContext, LateLintPass};
8-
use rustc_session::{declare_tool_lint, impl_lint_pass};
8+
use rustc_session::{declare_lint_pass, declare_tool_lint};
99
use rustc_span::source_map::{BytePos, Span};
1010
use std::convert::TryFrom;
1111

@@ -51,10 +51,7 @@ declare_clippy_lint! {
5151
"trivial regular expressions"
5252
}
5353

54-
#[derive(Clone, Default)]
55-
pub struct Regex {}
56-
57-
impl_lint_pass!(Regex => [INVALID_REGEX, TRIVIAL_REGEX]);
54+
declare_lint_pass!(Regex => [INVALID_REGEX, TRIVIAL_REGEX]);
5855

5956
impl<'tcx> LateLintPass<'tcx> for Regex {
6057
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {

clippy_lints/src/utils/internal_lints.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1222,5 +1222,10 @@ fn if_chain_local_span(cx: &LateContext<'_>, local: &Local<'_>, if_chain_span: S
12221222
let sm = cx.sess().source_map();
12231223
let span = sm.span_extend_to_prev_str(span, "let", false);
12241224
let span = sm.span_extend_to_next_char(span, ';', false);
1225-
Span::new(span.lo() - BytePos(3), span.hi() + BytePos(1), span.ctxt(), None)
1225+
Span::new(
1226+
span.lo() - BytePos(3),
1227+
span.hi() + BytePos(1),
1228+
span.ctxt(),
1229+
span.parent(),
1230+
)
12261231
}

0 commit comments

Comments
 (0)