@@ -6,7 +6,7 @@ use clippy_utils::{
66 expr_use_ctxt, get_parent_expr, is_block_like, is_lint_allowed, path_to_local, DefinedTy , ExprUseNode ,
77} ;
88use core:: mem;
9- use rustc_ast:: util:: parser:: { PREC_POSTFIX , PREC_PREFIX } ;
9+ use rustc_ast:: util:: parser:: { PREC_UNAMBIGUOUS , PREC_PREFIX } ;
1010use rustc_data_structures:: fx:: FxIndexMap ;
1111use rustc_errors:: Applicability ;
1212use rustc_hir:: intravisit:: { walk_ty, Visitor } ;
@@ -1013,7 +1013,7 @@ fn report<'tcx>(
10131013 let ( precedence, calls_field) = match cx. tcx . parent_hir_node ( data. first_expr . hir_id ) {
10141014 Node :: Expr ( e) => match e. kind {
10151015 ExprKind :: Call ( callee, _) if callee. hir_id != data. first_expr . hir_id => ( 0 , false ) ,
1016- ExprKind :: Call ( ..) => ( PREC_POSTFIX , matches ! ( expr. kind, ExprKind :: Field ( ..) ) ) ,
1016+ ExprKind :: Call ( ..) => ( PREC_UNAMBIGUOUS , matches ! ( expr. kind, ExprKind :: Field ( ..) ) ) ,
10171017 _ => ( e. precedence ( ) . order ( ) , false ) ,
10181018 } ,
10191019 _ => ( 0 , false ) ,
@@ -1160,7 +1160,7 @@ impl<'tcx> Dereferencing<'tcx> {
11601160 } ,
11611161 Some ( parent) if !parent. span . from_expansion ( ) => {
11621162 // Double reference might be needed at this point.
1163- if parent. precedence ( ) . order ( ) == PREC_POSTFIX {
1163+ if parent. precedence ( ) . order ( ) == PREC_UNAMBIGUOUS {
11641164 // Parentheses would be needed here, don't lint.
11651165 * outer_pat = None ;
11661166 } else {
0 commit comments