diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 17:40:06 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 17:40:06 +0100 |
| commit | c2b8882cef03ed7813ac4e3162c3c3e22869f618 (patch) | |
| tree | 20a380f676ed31d28b637163920a1b4ef4a06dc3 | |
| parent | d8f453d0218a384fb34cb82c4cf8de6284a6221c (diff) | |
| download | rust-c2b8882cef03ed7813ac4e3162c3c3e22869f618.tar.gz rust-c2b8882cef03ed7813ac4e3162c3c3e22869f618.zip | |
Cleanup of rustup changes
| -rw-r--r-- | clippy_lints/src/regex.rs | 7 | ||||
| -rw-r--r-- | clippy_lints/src/utils/internal_lints.rs | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index 947c25ac880..5d08aee1e5f 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -5,7 +5,7 @@ use if_chain::if_chain; use rustc_ast::ast::{LitKind, StrStyle}; use rustc_hir::{BorrowKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::source_map::{BytePos, Span}; use std::convert::TryFrom; @@ -51,10 +51,7 @@ declare_clippy_lint! { "trivial regular expressions" } -#[derive(Clone, Default)] -pub struct Regex {} - -impl_lint_pass!(Regex => [INVALID_REGEX, TRIVIAL_REGEX]); +declare_lint_pass!(Regex => [INVALID_REGEX, TRIVIAL_REGEX]); impl<'tcx> LateLintPass<'tcx> for Regex { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index a626e4f2a33..3e2a4e9748d 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -1222,5 +1222,10 @@ fn if_chain_local_span(cx: &LateContext<'_>, local: &Local<'_>, if_chain_span: S let sm = cx.sess().source_map(); let span = sm.span_extend_to_prev_str(span, "let", false); let span = sm.span_extend_to_next_char(span, ';', false); - Span::new(span.lo() - BytePos(3), span.hi() + BytePos(1), span.ctxt(), None) + Span::new( + span.lo() - BytePos(3), + span.hi() + BytePos(1), + span.ctxt(), + span.parent(), + ) } |
