Skip to content

Commit

Permalink
Unrolled build for rust-lang#134975
Browse files Browse the repository at this point in the history
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``
  • Loading branch information
rust-timer authored Jan 1, 2025
2 parents 4e59b1d + 7a46c7b commit 49e97f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
3 changes: 0 additions & 3 deletions src/doc/style-guide/src/editions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
25 changes: 0 additions & 25 deletions src/doc/style-guide/src/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49e97f2

Please sign in to comment.