Skip to content

Commit

Permalink
Rollup merge of #112944 - joshtriplett:style-guide-defaults-vs-config…
Browse files Browse the repository at this point in the history
…urability, r=compiler-errors

style-guide: Add language disclaiming any effects on non-default Rust styles

Make it clear that the style guide saying "must" doesn't forbid
developers from doing differently (as though any power on this Earth
could do that) and doesn't forbid tools from allowing any particular
configuration options.

Otherwise, people might wonder (for instance) if there's a semantic difference
between "must" and "should" in the style guide, and whether tools are "allowed"
to offer configurability of something that says "must".
  • Loading branch information
matthiaskrgr authored Jun 23, 2023
2 parents 441e59a + 2748efa commit 8d6b02f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/doc/style-guide/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ Thus, there are productivity benefits to using a formatting tool (such as
`rustfmt`), and even larger benefits by using a community-consistent
formatting, typically by using a formatting tool's default settings.

## The default Rust style

The Rust Style Guide defines the default Rust style, and *recommends* that
developers and tools follow the default Rust style. Tools such as `rustfmt` use
the style guide as a reference for the default style. Everything in this style
guide, whether or not it uses language such as "must" or the imperative mood
such as "insert a space ..." or "break the line after ...", refers to the
default style.

This should not be interpreted as forbidding developers from following a
non-default style, or forbidding tools from adding any particular configuration
options.

## Formatting conventions

Expand Down

0 comments on commit 8d6b02f

Please sign in to comment.