about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJules Bertholet <julesbertholet@quoi.xyz>2024-04-17 09:28:17 -0400
committerJules Bertholet <julesbertholet@quoi.xyz>2024-04-17 09:34:40 -0400
commitce0e27dfa7194f517d4259342a760604d7d206da (patch)
tree3449569c143ad28a5661eab89b4513f3514abb30
parent2a4624ddd1d4084f385bbd704e0f90c85e16c42f (diff)
downloadrust-ce0e27dfa7194f517d4259342a760604d7d206da.tar.gz
rust-ce0e27dfa7194f517d4259342a760604d7d206da.zip
Improve `BindingMode` doc comment
-rw-r--r--compiler/rustc_ast/src/ast.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 0d44fbdd43d..2c3272dccb4 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -717,8 +717,10 @@ impl ByRef {
 }
 
 /// The mode of a binding (`mut`, `ref mut`, etc).
-/// Used for both the wxplicit binding annotations given in the HIR for a binding
-/// and the final binding *mode* that we infer after type inference.
+/// Used for both the explicit binding annotations given in the HIR for a binding
+/// and the final binding mode that we infer after type inference/match ergonomics.
+/// `.0` is the by-reference mode (`ref`, `ref mut`, or by value),
+/// `.1` is the mutability of the binding.
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[derive(Encodable, Decodable, HashStable_Generic)]
 pub struct BindingMode(pub ByRef, pub Mutability);