Skip to content

Commit afdef69

Browse files
docs: improve multiple versions to match explanation
1 parent e201040 commit afdef69

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Configurations.md

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

24062406
#### Multiple versions to match:
24072407

2408-
Except by `*`, any of the semver operators can be combined, being split with commas. The comparison is done using `&&` operator.
2408+
A comma separated list of version requirements.
2409+
The match succeeds when the current rustfmt version matches all version requirements.
24092410

2410-
`*` can't be used with other comparators.
2411+
The one notable exception is that a wildcard matching any version cannot be used in the list.
2412+
For example, `*, <1.0.0` will always fail.
24112413

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-
Version requirements can't contradict themselves, otherwise they'll always fail. Some examples are `"1.*, >2.0.0"`, `1.0.*, >2.0.0` and `<1.5.0, >1.10.*`, because both requirements can't be true at the same time.
2414+
Additionally, the version match will always fail if any of the version requirements contradict themselves.
2415+
Some examples of contradictory requirements are `1.*, >2.0.0`, `1.0.*, >2.0.0` and `<1.5.0, >1.10.*`.
24152416

24162417
```toml
24172418
required_version=">=1.0.0, <2.0.0"

0 commit comments

Comments
 (0)