diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2024-12-31 18:42:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-31 18:42:26 -0500 |
| commit | 9472d32842940615a8c2a9390eccbad6f677a86e (patch) | |
| tree | d2f4ffa68791a66539c4672e4fc3deeb84c00ba4 | |
| parent | fee79a29009e9e41e879394871e14a42b3b34c26 (diff) | |
| parent | 7a46c7b1123fa3643e9bda0c9ffbfc5dee7e4dfb (diff) | |
| download | rust-9472d32842940615a8c2a9390eccbad6f677a86e.tar.gz rust-9472d32842940615a8c2a9390eccbad6f677a86e.zip | |
Rollup merge of #134975 - ehuss:revert-style-guide-rhs-break, r=compiler-errors
Revert style guide rhs break This reverts https://github.com/rust-lang/rust/pull/132369 and https://github.com/rust-lang/rust/pull/119838. The style-guide change for indentation of rhs was not implemented in time for the 2024 style edition. See tracking issue https://github.com/rust-lang/rust/issues/132380. cc #134974 for the other style guide change in 2024. r? ``@compiler-errors``
| -rw-r--r-- | src/doc/style-guide/src/editions.md | 3 | ||||
| -rw-r--r-- | src/doc/style-guide/src/expressions.md | 25 |
2 files changed, 0 insertions, 28 deletions
diff --git a/src/doc/style-guide/src/editions.md b/src/doc/style-guide/src/editions.md index 17e8a48fd73..b9a89c20cee 100644 --- a/src/doc/style-guide/src/editions.md +++ b/src/doc/style-guide/src/editions.md @@ -40,9 +40,6 @@ 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. - 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..171a24cd89d 100644 --- a/src/doc/style-guide/src/expressions.md +++ b/src/doc/style-guide/src/expressions.md @@ -328,31 +328,6 @@ 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: - -```rust -impl SomeType { - fn method(&mut self) { - 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, - children: children.into_boxed_slice(), - }); - } -} -``` - ### Casts (`as`) Format `as` casts like a binary operator. In particular, always include spaces |
