about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/doc/style-guide/src/editions.md5
-rw-r--r--src/doc/style-guide/src/expressions.md12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/doc/style-guide/src/editions.md b/src/doc/style-guide/src/editions.md
index d9dba641495..74e873e35ff 100644
--- a/src/doc/style-guide/src/editions.md
+++ b/src/doc/style-guide/src/editions.md
@@ -40,9 +40,8 @@ include:
   of a delimited expression, delimited expressions are generally combinable,
   regardless of the number of members. Previously only applied with exactly
   one member (except for closures with explicit blocks).
-- When line-breaking an assignment operator, if the left-hand side spans
-  multiple lines, use the base indentation of the last line of the left-hand
-  side to indent the right-hand side.
+- When line-breaking a binary operator, if the first operand spans multiple
+  lines, use the base indentation of the last line.
 - Miscellaneous `rustfmt` bugfixes.
 - Use version-sort (sort `x8`, `x16`, `x32`, `x64`, `x128` in that order).
 - Change "ASCIIbetical" sort to Unicode-aware "non-lowercase before lowercase".
diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md
index 4f63a632030..3bb0ee6d5ff 100644
--- a/src/doc/style-guide/src/expressions.md
+++ b/src/doc/style-guide/src/expressions.md
@@ -328,9 +328,9 @@ foo_bar
 Prefer line-breaking at an assignment operator (either `=` or `+=`, etc.) rather
 than at other binary operators.
 
-If line-breaking an assignment operator where the left-hand side spans multiple
-lines, use the base indentation of the *last* line of the left-hand side, and
-indent the right-hand side relative to that:
+If line-breaking at a binary operator (including assignment operators) where the
+first operand spans multiple lines, use the base indentation of the *last*
+line of the first operand, and indent relative to that:
 
 ```rust
 impl SomeType {
@@ -344,6 +344,12 @@ impl SomeType {
         self.array[array_index as usize]
             .as_mut()
             .expect("thing must exist")
+            .extra_info
+                + long_long_long_long_long_long_long_long_long_long_long_long_long_long_long;
+
+        self.array[array_index as usize]
+            .as_mut()
+            .expect("thing must exist")
             .extra_info = Some(ExtraInfo {
                 parent,
                 count: count as u16,