Skip to content

Commit 2da8ddb

Browse files
committed
Respond to feedback on compiler flag section
1 parent 12a2df7 commit 2da8ddb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

text/0000-version-typed-cfgs.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ The `version` type integrates with existing compiler flags.
175175
--check-cfg 'cfg(my_app_version, version())'
176176
```
177177

178-
This will accept any version value, but lint when the option is used as something other than a version. This is a more sensible default for versions, which don't have the equivalent of `values(none())`.
178+
This will accept any version value, but lint when the option is used in a non-version comparison (note that this is an error if the option actually has a version-typed value). This is a more sensible default for versions, which don't have the equivalent of `values(none())`.
179179
180180
* **`--print cfg`**: User-defined version cfgs are printed in the `name=version("...")` format. Whether to print the built-in `rust_version` and `rust_edition` cfgs is left as an unresolved question to be determined based on tool compatibility. In future editions, the builtin cfgs should always be printed.
181+
* Note: Using editions being careful about passing `--edition` to `rustc --print cfg` invocations, which `cargo` for example does not currently do. This could introduce unexpected inconsistencies.
181182
182-
* **`--print check-cfg`**: The built-in `rust_version` and `rust_edition` cfgs are implicitly included, so `rustc --print=check-cfg` will always list them.
183+
* **`--print check-cfg`**: The built-in `rust_version` and `rust_edition` cfgs are implicitly included, so `rustc --print=check-cfg` will always list them. We can add these immediately because `--print check-cfg` is unstable.
184+
185+
* **Clippy**: Clippy's `incompatible_msrv` lint should be updated to respect `rust_version` checks, avoiding false positives when code is guarded by a sufficient `rust_version`.
183186

184187
### Stabilization
185188

0 commit comments

Comments
 (0)