Skip to content

Commit 9472d32

Browse files
authored
Rollup merge of rust-lang#134975 - ehuss:revert-style-guide-rhs-break, r=compiler-errors
Revert style guide rhs break This reverts rust-lang#132369 and rust-lang#119838. The style-guide change for indentation of rhs was not implemented in time for the 2024 style edition. See tracking issue rust-lang#132380. cc rust-lang#134974 for the other style guide change in 2024. r? ``@compiler-errors``
2 parents fee79a2 + 7a46c7b commit 9472d32

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

src/doc/style-guide/src/editions.md

-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ include:
4040
of a delimited expression, delimited expressions are generally combinable,
4141
regardless of the number of members. Previously only applied with exactly
4242
one member (except for closures with explicit blocks).
43-
- When line-breaking an assignment operator, if the left-hand side spans
44-
multiple lines, use the base indentation of the last line of the left-hand
45-
side to indent the right-hand side.
4643
- Miscellaneous `rustfmt` bugfixes.
4744
- Use version-sort (sort `x8`, `x16`, `x32`, `x64`, `x128` in that order).
4845
- Change "ASCIIbetical" sort to Unicode-aware "non-lowercase before lowercase".

src/doc/style-guide/src/expressions.md

-25
Original file line numberDiff line numberDiff line change
@@ -328,31 +328,6 @@ foo_bar
328328
Prefer line-breaking at an assignment operator (either `=` or `+=`, etc.) rather
329329
than at other binary operators.
330330

331-
If line-breaking an assignment operator where the left-hand side spans multiple
332-
lines, use the base indentation of the *last* line of the left-hand side, and
333-
indent the right-hand side relative to that:
334-
335-
```rust
336-
impl SomeType {
337-
fn method(&mut self) {
338-
self.array[array_index as usize]
339-
.as_mut()
340-
.expect("thing must exist")
341-
.extra_info =
342-
long_long_long_long_long_long_long_long_long_long_long_long_long_long_long;
343-
344-
self.array[array_index as usize]
345-
.as_mut()
346-
.expect("thing must exist")
347-
.extra_info = Some(ExtraInfo {
348-
parent,
349-
count: count as u16,
350-
children: children.into_boxed_slice(),
351-
});
352-
}
353-
}
354-
```
355-
356331
### Casts (`as`)
357332

358333
Format `as` casts like a binary operator. In particular, always include spaces

0 commit comments

Comments
 (0)