use crate::consts::{constant, Constant};
use crate::utils::{is_expn_of, match_def_path, match_type, paths, span_help_and_lint, span_lint};
use if_chain::if_chain;
-use regex_syntax;
use rustc::hir::*;
+use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_data_structures::fx::FxHashSet;
+use rustc_session::declare_tool_lint;
use std::convert::TryFrom;
use syntax::ast::{LitKind, StrStyle};
use syntax::source_map::{BytePos, Span};
impl_lint_pass!(Regex => [INVALID_REGEX, REGEX_MACRO, TRIVIAL_REGEX]);
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Regex {
- fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
+ fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate<'_>) {
self.spans.clear();
}
fn check_set<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, utf8: bool) {
if_chain! {
- if let ExprKind::AddrOf(_, ref expr) = expr.kind;
+ if let ExprKind::AddrOf(BorrowKind::Ref, _, ref expr) = expr.kind;
if let ExprKind::Array(ref exprs) = expr.kind;
then {
for expr in exprs {