@@ -114,7 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck {
114
114
&& !matches ! ( cx. typeck_results( ) . expr_ty( arg) . peel_refs( ) . kind( ) , ty:: Param ( _) )
115
115
{
116
116
let arg = peel_ref_operators ( cx, arg) ;
117
- let ty_sugg = get_ty_sugg ( cx, arg, start ) ;
117
+ let ty_sugg = get_ty_sugg ( cx, arg) ;
118
118
let range = check_range ( start, end) ;
119
119
check_is_ascii ( cx, expr. span , arg, & range, ty_sugg) ;
120
120
}
@@ -123,10 +123,9 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck {
123
123
extract_msrv_attr ! ( LateContext ) ;
124
124
}
125
125
126
- fn get_ty_sugg ( cx : & LateContext < ' _ > , arg : & Expr < ' _ > , bound_expr : & Expr < ' _ > ) -> Option < ( Span , String ) > {
127
- if let ExprKind :: Lit ( _) = bound_expr. kind
128
- && let local_hid = path_to_local ( arg) ?
129
- && let Node :: Param ( Param { ty_span, span, .. } ) = cx. tcx . parent_hir_node ( local_hid)
126
+ fn get_ty_sugg ( cx : & LateContext < ' _ > , arg : & Expr < ' _ > ) -> Option < ( Span , String ) > {
127
+ let local_hid = path_to_local ( arg) ?;
128
+ if let Node :: Param ( Param { ty_span, span, .. } ) = cx. tcx . parent_hir_node ( local_hid)
130
129
// `ty_span` and `span` are the same for inferred type, thus a type suggestion must be given
131
130
&& ty_span == span
132
131
{
0 commit comments