Skip to content

Commit 9380e25

Browse files
docs: improve multiple versions to match session
1 parent 2b58939 commit 9380e25

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

Configurations.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,10 +2405,16 @@ required_version="1.0.*" # matches any version with the same major and minor ver
24052405

24062406
#### Multiple versions to match:
24072407

2408-
Except by `*`, can be used by any of the semver operators can be combined, being split with commas. The comparison is done using `&&` operator.
2408+
Except by `*`, any of the semver operators can be combined, being split with commas. The comparison is done using `&&` operator.
2409+
2410+
`*` can't be used with other comparators.
2411+
2412+
Since `*` has range restrictions, any comparator will override the wildcard operator. When `*` is used alone, the comparison always fails, as that's an invalid config. `*, <1.0.0` for example is invalid.
2413+
2414+
Versions can't contradict themselves, otherwise they'll always fail. Some examples are `"1.*, <2.0.0"` and `1.0.*, <2.0.0`, since both versions can't be true at the same time.
2415+
2416+
By now, `&&` (using comma `,`) is the only way to declare `required_version`. `||` Operator is not valid. Valid examples are `1.0.0, 1.1.0` and `1.0.0, 1.1.0, 1.1.*` but not `1.0.0 || 1.1.0` or `1.0.0, 2.0.0`.
24092417

2410-
`*` has range restrictions as any comparator will override the wildcard operator. When `*` is used within a range, the comparison always fails.
2411-
24122418
```toml
24132419
required_version=">=1.0.0, <2.0.0"
24142420
```
@@ -2740,17 +2746,6 @@ By default this option is set as a percentage of [`max_width`](#max_width) provi
27402746

27412747
See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)
27422748

2743-
## `style_edition`
2744-
2745-
Controls the edition of the [Rust Style Guide] to use for formatting ([RFC 3338])
2746-
2747-
- **Default value**: `"2015"`
2748-
- **Possible values**: `"2015"`, `"2018"`, `"2021"`, `"2024"` (unstable variant)
2749-
- **Stable**: No
2750-
2751-
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
2752-
[RFC 3338]: https://rust-lang.github.io/rfcs/3338-style-evolution.html
2753-
27542749
## `tab_spaces`
27552750

27562751
Number of spaces per tab
@@ -3110,7 +3105,9 @@ fn main() {
31103105

31113106
## `version`
31123107

3113-
This option is deprecated and has been replaced by [`style_edition`](#style_edition)
3108+
Which version of the formatting rules to use. `Version::One` is backwards-compatible
3109+
with Rustfmt 1.0. Other versions are only backwards compatible within a major
3110+
version number.
31143111

31153112
- **Default value**: `One`
31163113
- **Possible values**: `One`, `Two`

0 commit comments

Comments
 (0)