Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/edition-guide
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ef8e6af2cbd81d6a226407ff4f1603c93640174
Choose a base ref
..
head repository: rust-lang/edition-guide
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c7f855b371221f9a1ff33be0469e9f899a02be39
Choose a head ref
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/rust-2024/rustfmt-single-line-where-clauses.md
4 changes: 2 additions & 2 deletions src/rust-2024/rustfmt-single-line-where-clauses.md
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ When an associated type or method declaration has a single bound in the `where`

In general, the [Rust Style Guide](../../style-guide/) states to wrap `where` clauses onto subsequent lines, with the keyword `where` on a line of its own and then the individual clauses indented on subsequent lines.

However, in the 2024 style edition, when writing an associated type declaration or a method declaration (with no body), a short `where` clause can appear on the same line.
However, in the 2024 Style Edition, when writing an associated type declaration or a method declaration (with no body), a short `where` clause can appear on the same line.

This is particularly useful for Generic Associated Types (GATs), which often need `Self: Sized` bounds.
This is particularly useful for generic associated types (GATs), which often need `Self: Sized` bounds.

In Rust 2021 and before, this would look like: