mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Address comments
This commit is contained in:
parent
cd0009eb30
commit
d6390625dc
1 changed files with 2 additions and 6 deletions
|
@ -19,10 +19,6 @@ impl Context {
|
|||
self.expr_id.is_some() || self.const_span.map_or(false, |span| span.contains(e.span))
|
||||
}
|
||||
|
||||
fn skip_expr_involving_integers<'tcx>(cx: &LateContext<'tcx>, e: &hir::Expr<'tcx>) -> bool {
|
||||
is_from_proc_macro(cx, e)
|
||||
}
|
||||
|
||||
pub fn check_binary<'tcx>(
|
||||
&mut self,
|
||||
cx: &LateContext<'tcx>,
|
||||
|
@ -51,7 +47,7 @@ impl Context {
|
|||
|
||||
let (l_ty, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
|
||||
if l_ty.peel_refs().is_integral() && r_ty.peel_refs().is_integral() {
|
||||
if Self::skip_expr_involving_integers(cx, expr) {
|
||||
if is_from_proc_macro(cx, expr) {
|
||||
return;
|
||||
}
|
||||
match op {
|
||||
|
@ -86,7 +82,7 @@ impl Context {
|
|||
let ty = cx.typeck_results().expr_ty(arg);
|
||||
if constant_simple(cx, cx.typeck_results(), expr).is_none() {
|
||||
if ty.is_integral() {
|
||||
if Self::skip_expr_involving_integers(cx, expr) {
|
||||
if is_from_proc_macro(cx, expr) {
|
||||
return;
|
||||
}
|
||||
span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");
|
||||
|
|
Loading…
Reference in a new issue