about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2022-08-30 17:39:36 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2022-09-02 12:55:05 -0500
commite40972ebf86040de884d5b5b54e3345af504c140 (patch)
treedaeb26396da31b03a4694cef67c6c446753e0b53
parentddda7bbe5dfc3884857a90efe9dfd4dfc3eb85e1 (diff)
downloadrust-e40972ebf86040de884d5b5b54e3345af504c140.tar.gz
rust-e40972ebf86040de884d5b5b54e3345af504c140.zip
rustfmt: BindingAnnotation change
-rw-r--r--src/patterns.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/patterns.rs b/src/patterns.rs
index 9b74b35f314..e2fe92b28f2 100644
--- a/src/patterns.rs
+++ b/src/patterns.rs
@@ -1,4 +1,6 @@
-use rustc_ast::ast::{self, BindingMode, Pat, PatField, PatKind, RangeEnd, RangeSyntax};
+use rustc_ast::ast::{
+    self, BindingAnnotation, ByRef, Pat, PatField, PatKind, RangeEnd, RangeSyntax,
+};
 use rustc_ast::ptr;
 use rustc_span::{BytePos, Span};
 
@@ -99,10 +101,10 @@ impl Rewrite for Pat {
                 write_list(&items, &fmt)
             }
             PatKind::Box(ref pat) => rewrite_unary_prefix(context, "box ", &**pat, shape),
-            PatKind::Ident(binding_mode, ident, ref sub_pat) => {
-                let (prefix, mutability) = match binding_mode {
-                    BindingMode::ByRef(mutability) => ("ref", mutability),
-                    BindingMode::ByValue(mutability) => ("", mutability),
+            PatKind::Ident(BindingAnnotation(by_ref, mutability), ident, ref sub_pat) => {
+                let prefix = match by_ref {
+                    ByRef::Yes => "ref",
+                    ByRef::No => "",
                 };
                 let mut_infix = format_mutability(mutability).trim();
                 let id_str = rewrite_ident(context, ident);