Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump MSRV to 1.54.0 #2640

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [1.46.0, stable, beta]
rust: [1.54.0, stable, beta]
os: [windows-latest, macos-latest, ubuntu-latest]
target:
- i686-pc-windows-msvc
Expand Down Expand Up @@ -103,7 +103,8 @@ jobs:
if: matrix.features == 'all'
with:
command: test
args: --target ${{ matrix.target }} --features "wrap_help yaml regex"
# Test `doc` to run doctests on the README
args: --target ${{ matrix.target }} --features "wrap_help yaml regex doc"
- name: Check debug
uses: actions-rs/cargo@v1
if: matrix.features == 'all'
Expand Down Expand Up @@ -169,7 +170,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.46.0
toolchain: 1.54.0
target: ${{ matrix.target }}
override: true
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ The following is a list of the minimum required version of Rust to compile `clap

| clap | MSRV |
| :----: | :----: |
| >=3.0 | 1.46.0 |
| >=3.0 | 1.54.0 |
| >=2.21 | 1.24.0 |
| >=2.2 | 1.12.0 |
| >=2.1 | 1.6.0 |
Expand Down Expand Up @@ -585,4 +585,4 @@ There are several excellent crates which can be used with `clap`, I recommend ch
* [`assert_cmd`](https://github.com/assert-rs/assert_cmd) - This crate allows you test your CLIs in a very intuitive and functional way!

[docs]: https://docs.rs/clap
[examples]: examples
[examples]: https://github.com/clap-rs/clap/tree/master/examples
4 changes: 2 additions & 2 deletions clap_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ proc-macro = true
bench = false

[dependencies]
syn = { version = "1.0.69", features = ["full"] }
syn = { version = "1.0.74", features = ["full"] }
quote = "1.0.9"
proc-macro2 = "1.0.26"
proc-macro2 = "1.0.28"
heck = "0.3.0"
proc-macro-error = "1"

Expand Down
6 changes: 6 additions & 0 deletions clap_derive/src/dummies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub fn subcommand(name: &Ident) {
fn augment_subcommands_for_update(_app: clap::App<'_>) -> clap::App<'_> {
unimplemented!()
}
fn has_subcommand(name: &str) -> bool {
unimplemented!()
}
}
});
}
Expand All @@ -77,6 +80,9 @@ pub fn arg_enum(name: &Ident) {
fn from_str(_input: &str, _case_insensitive: bool) -> Result<Self, String> {
unimplemented!()
}
fn as_arg(&self) -> Option<&'static str> {
unimplemented!()
}
}
})
}
2 changes: 1 addition & 1 deletion clap_derive/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed

#[rustversion::attr(any(not(stable), before(1.45), since(1.46)), ignore)]
#[rustversion::attr(any(not(stable), before(1.54), since(1.55)), ignore)]
#[test]
fn ui() {
let t = trybuild::TestCases::new();
Expand Down
2 changes: 1 addition & 1 deletion clap_derive/tests/ui/arg_enum_on_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ error: `#[derive(ArgEnum)]` only supports enums
3 | #[derive(ArgEnum, Debug)]
| ^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `ArgEnum` (in Nightly builds, run with -Z macro-backtrace for more info)
8 changes: 8 additions & 0 deletions clap_derive/tests/ui/enum_variant_not_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args`

error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args_for_update`
4 changes: 2 additions & 2 deletions clap_derive/tests/ui/non_existent_attr.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no method named `non_existing_attribute` found for struct `clap::Arg<'_>` in the current scope
error[E0599]: no method named `non_existing_attribute` found for struct `Arg` in the current scope
--> $DIR/non_existent_attr.rs:14:19
|
14 | #[clap(short, non_existing_attribute = 1)]
| ^^^^^^^^^^^^^^^^^^^^^^ method not found in `clap::Arg<'_>`
| ^^^^^^^^^^^^^^^^^^^^^^ method not found in `Arg<'_>`
6 changes: 2 additions & 4 deletions clap_derive/tests/ui/skip_without_default.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
error[E0277]: the trait bound `Kind: std::default::Default` is not satisfied
error[E0277]: the trait bound `Kind: Default` is not satisfied
--> $DIR/skip_without_default.rs:22:12
|
22 | #[clap(skip)]
| ^^^^ the trait `std::default::Default` is not implemented for `Kind`
| ^^^^ the trait `Default` is not implemented for `Kind`
|
= note: required by `std::default::Default::default`

For more information about this error, try `rustc --explain E0277`.
2 changes: 1 addition & 1 deletion clap_derive/tests/ui/subcommand_on_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ error: `#[derive(Subcommand)]` only supports enums
3 | #[derive(Subcommand, Debug)]
| ^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `Subcommand` (in Nightly builds, run with -Z macro-backtrace for more info)
4 changes: 2 additions & 2 deletions clap_derive/tests/ui/tuple_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: `#[derive(Clap)]` only supports non-tuple structs and enums
11 | #[derive(Clap, Debug)]
| ^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `Clap` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no function or associated item named `parse` found for struct `Opt` in the current scope
--> $DIR/tuple_struct.rs:16:20
Expand All @@ -17,4 +17,4 @@ error[E0599]: no function or associated item named `parse` found for struct `Opt
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `parse`, perhaps you need to implement it:
candidate #1: `clap::Clap`
candidate #1: `Clap`
1 change: 1 addition & 0 deletions src/build/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,7 @@ impl<'help> App<'help> {
where
'help: 'a,
{
#![allow(clippy::needless_collect)]
let a: Vec<_> = self
.get_subcommands()
.flat_map(|sc| {
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
// notice may not be copied, modified, or distributed except according to those terms.

#![cfg_attr(feature = "doc", feature(external_doc))]
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap/3.0.0-beta.2")]
#![cfg_attr(feature = "doc", doc(include = "../README.md"))]
#![cfg_attr(feature = "doc", doc = include_str!("../README.md"))]
//! <https://github.com/clap-rs/clap>
#![crate_type = "lib"]
#![deny(
Expand Down