@@ -383,12 +383,16 @@ fn is_call_max_min_pattern<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>)
383383 && let Some ( inner_seg) = segment ( cx, inner_fn)
384384 && let Some ( outer_seg) = segment ( cx, outer_fn)
385385 {
386- let ( input, inner_arg) = match ( is_const_evaluatable ( cx, first) , is_const_evaluatable ( cx, second) ) {
386+ let typeck = cx. typeck_results ( ) ;
387+ let ( input, inner_arg) = match (
388+ is_const_evaluatable ( cx. tcx , typeck, first) ,
389+ is_const_evaluatable ( cx. tcx , typeck, second) ,
390+ ) {
387391 ( true , false ) => ( second, first) ,
388392 ( false , true ) => ( first, second) ,
389393 _ => return None ,
390394 } ;
391- let is_float = cx . typeck_results ( ) . expr_ty_adjusted ( input) . is_floating_point ( ) ;
395+ let is_float = typeck . expr_ty_adjusted ( input) . is_floating_point ( ) ;
392396 let ( min, max) = match ( inner_seg, outer_seg) {
393397 ( FunctionType :: CmpMin , FunctionType :: CmpMax ) => ( outer_arg, inner_arg) ,
394398 ( FunctionType :: CmpMax , FunctionType :: CmpMin ) => ( inner_arg, outer_arg) ,
0 commit comments