mirror of
https://github.com/clap-rs/clap
synced 2025-01-05 17:28:42 +00:00
7515bfeb51
This adds a new `Cargo.toml` feature named `deprecated` that opts controls whether deprecation warnings show up. This is starting off as non-default though that may change (see below). Benefits - Allows a staged rollout so a smaller subset of users see new deprecations and can report their experience with them before everyone sees them. For example, this reduces the number of people who have to deal with #3822. - This allows people to defer responding to each new batch of deprecations and instead do it at once. This means we should reconsider #3616. The one risk is people who don't follow blog posts and guides having a harder time upgrading to the next breaking release without the warnings on by default. For these users, we reserve the right to make the `deprecated` feature `default`. This is most likely to happen in a minor release that is released in conjunction with the next major release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables deprecations by default). By using a feature, users can still disable this if they want. Thanks @joshtriplett for the idea
53 lines
1.8 KiB
Text
53 lines
1.8 KiB
Text
error[E0277]: the trait bound `bool: ValueEnum` is not satisfied
|
|
--> tests/derive_ui/stable/bool_value_enum.rs:7:11
|
|
|
|
|
7 | opts: bool,
|
|
| ^^^^ the trait `ValueEnum` is not implemented for `bool`
|
|
|
|
|
note: required by `clap::ValueEnum::from_str`
|
|
--> src/derive.rs
|
|
|
|
|
| fn from_str(input: &str, ignore_case: bool) -> Result<Self, String> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error[E0618]: expected function, found enum variant `bool`
|
|
--> tests/derive_ui/stable/bool_value_enum.rs:7:11
|
|
|
|
|
7 | opts: bool,
|
|
| ^^^^ call expression requires function
|
|
|
|
|
help: `bool` is a unit variant, you need to write it without the parenthesis
|
|
|
|
|
7 | opts: bool,
|
|
| ~~~~
|
|
|
|
error[E0277]: the trait bound `bool: ValueEnum` is not satisfied
|
|
--> tests/derive_ui/stable/bool_value_enum.rs:7:11
|
|
|
|
|
7 | opts: bool,
|
|
| ^^^^ the trait `ValueEnum` is not implemented for `bool`
|
|
|
|
|
note: required by `value_variants`
|
|
--> src/derive.rs
|
|
|
|
|
| fn value_variants<'a>() -> &'a [Self];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error[E0277]: the trait bound `bool: ValueEnum` is not satisfied
|
|
--> tests/derive_ui/stable/bool_value_enum.rs:6:5
|
|
|
|
|
6 | / #[clap(short, value_enum)]
|
|
7 | | opts: bool,
|
|
| |______________^ the trait `ValueEnum` is not implemented for `bool`
|
|
|
|
|
note: required by a bound in `ValueEnum`
|
|
--> src/derive.rs
|
|
|
|
|
| / pub trait ValueEnum: Sized + Clone {
|
|
| | /// All possible argument values, in display order.
|
|
| | fn value_variants<'a>() -> &'a [Self];
|
|
| |
|
|
... |
|
|
| | fn to_possible_value<'a>(&self) -> Option<PossibleValue<'a>>;
|
|
| | }
|
|
| |_^ required by this bound in `ValueEnum`
|