about summary refs log tree commit diff
path: root/compiler/rustc_hir_pretty/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-25 23:29:58 +0000
committerbors <bors@rust-lang.org>2024-06-25 23:29:58 +0000
commit31f8b70d2e18a0339c034e44c52aa3791c29f53c (patch)
treebea0cd4144368aab7e965e7558a74f2e9e5ffc94 /compiler/rustc_hir_pretty/src
parentfda509e817abeeecb5b76bc1de844f355675c81e (diff)
parent812b8b42a1aa49957f9b339d2590d8ae175804ba (diff)
downloadrust-31f8b70d2e18a0339c034e44c52aa3791c29f53c.tar.gz
rust-31f8b70d2e18a0339c034e44c52aa3791c29f53c.zip
Auto merge of #126951 - matthiaskrgr:rollup-xg0o4mc, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #126618 (Mark assoc tys live only if the corresponding trait is live)
 - #126746 (Deny `use<>` for RPITITs)
 - #126868 (not use offset when there is not ends with brace)
 - #126884 (Do not ICE when suggesting dereferencing closure arg)
 - #126893 (Eliminate the distinction between PREC_POSTFIX and PREC_PAREN precedence level)
 - #126915 (Don't suggest awaiting in closure patterns)
 - #126943 (De-duplicate all consecutive native libs regardless of their options)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir_pretty/src')
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index b21f1eadfb7..25b0cbdc026 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -1120,7 +1120,7 @@ impl<'a> State<'a> {
     fn print_expr_call(&mut self, func: &hir::Expr<'_>, args: &[hir::Expr<'_>]) {
         let prec = match func.kind {
             hir::ExprKind::Field(..) => parser::PREC_FORCE_PAREN,
-            _ => parser::PREC_POSTFIX,
+            _ => parser::PREC_UNAMBIGUOUS,
         };
 
         self.print_expr_maybe_paren(func, prec);
@@ -1134,7 +1134,7 @@ impl<'a> State<'a> {
         args: &[hir::Expr<'_>],
     ) {
         let base_args = args;
-        self.print_expr_maybe_paren(receiver, parser::PREC_POSTFIX);
+        self.print_expr_maybe_paren(receiver, parser::PREC_UNAMBIGUOUS);
         self.word(".");
         self.print_ident(segment.ident);
 
@@ -1478,12 +1478,12 @@ impl<'a> State<'a> {
                 self.print_expr_maybe_paren(rhs, prec);
             }
             hir::ExprKind::Field(expr, ident) => {
-                self.print_expr_maybe_paren(expr, parser::PREC_POSTFIX);
+                self.print_expr_maybe_paren(expr, parser::PREC_UNAMBIGUOUS);
                 self.word(".");
                 self.print_ident(ident);
             }
             hir::ExprKind::Index(expr, index, _) => {
-                self.print_expr_maybe_paren(expr, parser::PREC_POSTFIX);
+                self.print_expr_maybe_paren(expr, parser::PREC_UNAMBIGUOUS);
                 self.word("[");
                 self.print_expr(index);
                 self.word("]");