Skip to content

Commit 21d9134

Browse files
committed
Add more to lint semver mitigations.
1 parent 7e6c96a commit 21d9134

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/doc/src/reference/semver.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,13 @@ Mitigating strategies:
12101210
* Understand you may need to deal with resolving new warnings whenever you update your dependencies.
12111211
* Place `deny(warnings)` behind a [feature][Cargo features], for example `#![cfg_attr(feature = "deny-warnings", deny(warnings))]`.
12121212
Set up your automated CI to check your crate with the feature enabled, possibly as an allowed failure with a notification.
1213+
Beware that features are exposed to users, so you may want to clearly document it as something that is not to be used.
1214+
* If using RUSTFLAGS to pass `-Dwarnings`, also add the `-A` flag to allow lints that are likely to cause issues, such as `-Adeprecated`.
12131215
* Introduce deprecations behind a [feature][Cargo features].
12141216
For example `#[cfg_attr(feature = "deprecated", deprecated="use bar instead")]`.
12151217
Then, when you plan to remove an item in a future SemVer breaking change, you can communicate with your users that they should enable the `deprecated` feature *before* updating to remove the use of the deprecated items.
1216-
1218+
This allows users to choose when to respond to deprecations without needing to immediately respond to them.
1219+
A downside is that it can be difficult to communicate to users that they need to take these manual steps to prepare for a major update.
12171220

12181221
[`unused_must_use`]: ../../rustc/lints/listing/warn-by-default.html#unused-must-use
12191222
[deprecated-lint]: ../../rustc/lints/listing/warn-by-default.html#deprecated

0 commit comments

Comments
 (0)