diff --git a/0001-Update-proc-macro-error-to-v0.4.patch b/0001-Update-proc-macro-error-to-v0.4.patch new file mode 100644 index 0000000..a50dedf --- /dev/null +++ b/0001-Update-proc-macro-error-to-v0.4.patch @@ -0,0 +1,49 @@ +From 3f2fea5caf6986078a1e9e33106d63c982b67663 Mon Sep 17 00:00:00 2001 +From: CreepySkeleton +Date: Tue, 3 Dec 2019 16:06:26 +0300 +Subject: [PATCH] Update proc-macro-error to v0.4 + +(cherry picked from commit 39535cac8c40dd79c53f6603525e2af00594747d) +--- + tests/ui/parse_empty_try_from_os.stderr | 2 +- + tests/ui/raw.stderr | 5 ++++- + tests/ui/struct_parse.stderr | 2 +- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tests/ui/parse_empty_try_from_os.stderr b/tests/ui/parse_empty_try_from_os.stderr +index 004881c..36f56f9 100644 +--- a/tests/ui/parse_empty_try_from_os.stderr ++++ b/tests/ui/parse_empty_try_from_os.stderr +@@ -1,4 +1,4 @@ +-error: cannot omit parser function name with `try_from_os_str` ++error: parser's function name for `try_from_os_str` mut be set explicitly + --> $DIR/parse_empty_try_from_os.rs:14:23 + | + 14 | #[structopt(parse(try_from_os_str))] +diff --git a/tests/ui/raw.stderr b/tests/ui/raw.stderr +index 5bb59af..ac85a74 100644 +--- a/tests/ui/raw.stderr ++++ b/tests/ui/raw.stderr +@@ -1,5 +1,8 @@ + error: `#[structopt(raw(...))` attributes are removed in structopt 0.3, they are replaced with raw methods +-help: if you meant to call `clap::Arg::raw()` method you should use bool literal, like `raw(true)` or `raw(false)` ++ ++ = help: if you meant to call `clap::Arg::raw()` method you should use bool literal, like `raw(true)` or `raw(false)` ++ = note: if you need to call some method from `clap::Arg/App` you should use raw method ++ + --> $DIR/raw.rs:13:17 + | + 13 | #[structopt(raw(case_insensitive = "true"))] +diff --git a/tests/ui/struct_parse.stderr b/tests/ui/struct_parse.stderr +index ac78b3e..5518214 100644 +--- a/tests/ui/struct_parse.stderr ++++ b/tests/ui/struct_parse.stderr +@@ -1,4 +1,4 @@ +-error: parse attribute is only allowed on fields ++error: `parse` attribute is only allowed on fields + --> $DIR/struct_parse.rs:12:29 + | + 12 | #[structopt(name = "basic", parse(from_str))] +-- +2.24.1 + diff --git a/rust-structopt.spec b/rust-structopt.spec index 61026d0..abc0fe2 100644 --- a/rust-structopt.spec +++ b/rust-structopt.spec @@ -16,6 +16,8 @@ Source: %{crates_source} # Initial patched metadata # * Update rustversion to 1, https://github.com/TeXitoi/structopt/pull/308 Patch0: structopt-fix-metadata.diff +# * Adjust tests to new proc-macro-error, https://github.com/TeXitoi/structopt/commit/39535cac8c40dd79c53f6603525e2af00594747d +Patch0001: 0001-Update-proc-macro-error-to-v0.4.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build}