This commit is contained in:
Yuki Okushi
2020-01-07 01:39:50 +09:00
parent 732825dcff
commit 2f2eaf8b7e
140 changed files with 231 additions and 218 deletions

View File

@@ -2,10 +2,10 @@ use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::intravisit::FnKind;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_span::source_map::{ExpnKind, Span};
use syntax::ast::LitKind;
@@ -482,7 +482,7 @@ fn is_allowed<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) -> boo
// Return true if `expr` is the result of `signum()` invoked on a float value.
fn is_signum(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
// The negation of a signum is still a signum
if let ExprKind::Unary(UnNeg, ref child_expr) = expr.kind {
if let ExprKind::Unary(UnOp::UnNeg, ref child_expr) = expr.kind {
return is_signum(cx, &child_expr);
}
@@ -544,7 +544,7 @@ fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr<'_>, other: &Expr<'_>) {
}
let other_gets_derefed = match other.kind {
ExprKind::Unary(UnDeref, _) => true,
ExprKind::Unary(UnOp::UnDeref, _) => true,
_ => false,
};