File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 11use super :: CHUNKS_EXACT_WITH_CONST_SIZE ;
2- use clippy_utils:: consts:: { ConstEvalCtxt , Constant } ;
32use clippy_utils:: diagnostics:: span_lint_and_then;
43use clippy_utils:: msrvs:: { self , Msrv } ;
54use clippy_utils:: source:: snippet_with_applicability;
65use clippy_utils:: sym;
6+ use clippy_utils:: visitors:: is_const_evaluatable;
77use rustc_errors:: Applicability ;
88use rustc_hir:: { Expr , Node , PatKind } ;
99use rustc_lint:: LateContext ;
1010use rustc_middle:: ty;
1111use rustc_span:: { Span , Symbol } ;
1212
13- pub ( super ) fn check (
14- cx : & LateContext < ' _ > ,
15- recv : & Expr < ' _ > ,
16- arg : & Expr < ' _ > ,
17- expr : & Expr < ' _ > ,
13+ pub ( super ) fn check < ' tcx > (
14+ cx : & LateContext < ' tcx > ,
15+ recv : & ' tcx Expr < ' tcx > ,
16+ arg : & ' tcx Expr < ' tcx > ,
17+ expr : & ' tcx Expr < ' tcx > ,
1818 call_span : Span ,
1919 method_name : Symbol ,
2020 msrv : Msrv ,
@@ -24,8 +24,7 @@ pub(super) fn check(
2424 return ;
2525 }
2626
27- let constant_eval = ConstEvalCtxt :: new ( cx) ;
28- if let Some ( Constant :: Int ( _) ) = constant_eval. eval ( arg) {
27+ if is_const_evaluatable ( cx, arg) {
2928 if !msrv. meets ( cx, msrvs:: AS_CHUNKS ) {
3029 return ;
3130 }
You can’t perform that action at this time.
0 commit comments