From 0e22e8de1dcdaa918cee60ba6f67ddccb003f642 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 22 Dec 2023 22:08:28 +0100 Subject: [PATCH] Update deps (#12) Changes: - Add MAINTAIN.md to explain publishing after #11 - Update deps - Set version to 1.0.1 - Correctly set the workspace.readme key --------- Signed-off-by: Oliver Tale-Yazdi --- .github/workflows/rust.yml | 8 ++--- Cargo.lock | 30 +++++++++---------- Cargo.toml | 5 +++- MAINTAIN.md | 14 +++++++++ proc-macro-warning/Cargo.toml | 7 +++-- proc-macro-warning/src/lib.rs | 7 +++-- rust-toolchain.toml | 2 +- ui-tests/derive/Cargo.toml | 2 +- ui-tests/ui/Cargo.toml | 2 +- ui-tests/ui/src/warn/derive_basic.stderr | 1 + ui-tests/ui/src/warn/derive_raw.stderr | 1 + .../ui/src/warn/derive_twice_errors.stderr | 1 + 12 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 MAINTAIN.md diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8f48064..2d60a33 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,16 +30,16 @@ jobs: run: cargo check --all-targets --no-default-features # still broken --locked - name: Build - run: cargo build --all-targets --all-features --locked + run: cargo build --all-targets --features derive_debug --locked - name: Test - run: cargo test --locked --all-targets --all-features + run: cargo test --locked --all-targets --features derive_debug - name: Clippy - run: cargo clippy --locked --all-targets --all-features -- -D warnings + run: cargo clippy --locked --all-targets --features derive_debug -- -D warnings - name: Documentation - run: cargo doc --locked --no-deps --all-features + run: cargo doc --locked --no-deps --features derive_debug - name: Doc Test run: cargo test --locked --doc diff --git a/Cargo.lock b/Cargo.lock index f169ce6..ad358e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,7 +40,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "proc-macro-warning" -version = "1.0.0" +version = "1.0.1" dependencies = [ "derive", "proc-macro2", @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.68" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] @@ -74,18 +74,18 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" dependencies = [ "proc-macro2", "quote", @@ -116,18 +116,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] [[package]] name = "trybuild" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196a58260a906cedb9bf6d8034b6379d0c11f552416960452f267402ceeddff1" +checksum = "8419ecd263363827c5730386f418715766f584e2f874d32c23c5b00bd9727e7e" dependencies = [ "basic-toml", "glob", diff --git a/Cargo.toml b/Cargo.toml index f4c2049..80fb5b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -readme = "README.md" +resolver = "2" members = [ "proc-macro-warning", @@ -7,3 +7,6 @@ members = [ "ui-tests/derive", "ui-tests/ui", ] + +[workspace.package] +readme = "README.md" diff --git a/MAINTAIN.md b/MAINTAIN.md new file mode 100644 index 0000000..f85a3e9 --- /dev/null +++ b/MAINTAIN.md @@ -0,0 +1,14 @@ +# Maintain + +Info regarding crate maintenance. + +## Publishing + +The README file of the `proc-macro-warning` crate is not found during normal `cargo publish` invocation. We therefore always publish with the `publish` feature, that adapts the path for publishing. + +```bash +# Check that it works +cargo publish -p proc-macro-warning --features publish --dry-run +# Actually do the publish +cargo publish -p proc-macro-warning --features publish +``` diff --git a/proc-macro-warning/Cargo.toml b/proc-macro-warning/Cargo.toml index 55ada33..968cfcb 100644 --- a/proc-macro-warning/Cargo.toml +++ b/proc-macro-warning/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proc-macro-warning" -version = "1.0.0" +version = "1.0.1" edition = "2021" license = "GPL-3.0 OR Apache-2.0" authors = ["Oliver Tale-Yazdi "] @@ -9,9 +9,9 @@ repository = "https://github.com/ggwpez/proc-macro-warning" readme.workspace = true [dependencies] -proc-macro2 = { version = "1.0.68", default-features = false } +proc-macro2 = { version = "1.0.71", default-features = false } quote = { version = "1.0.33", default-features = false } -syn = { version = "2.0.38", default-features = false } +syn = { version = "2.0.42", default-features = false } [dev-dependencies] derive = { path = "../ui-tests/derive" } @@ -20,3 +20,4 @@ derive = { path = "../ui-tests/derive" } default = ["derive_debug"] derive_debug = [] +publish = [] diff --git a/proc-macro-warning/src/lib.rs b/proc-macro-warning/src/lib.rs index 70a110e..6ff313a 100644 --- a/proc-macro-warning/src/lib.rs +++ b/proc-macro-warning/src/lib.rs @@ -3,11 +3,12 @@ * SPDX-License-Identifier: (GPL-3.0 or Apache-2.0) */ -#![doc = include_str!("../../README.md")] +// Publishing builds the crate outside of the workspace and leads it to have a different root path: +#![cfg_attr(feature = "publish", doc = include_str!("../README.md"))] +#![cfg_attr(not(feature = "publish"), doc = include_str!("../../README.md"))] #![deny(unsafe_code)] #![deny(missing_docs)] -use core::ops::Deref; use proc_macro2::Span; use quote::{quote_spanned, ToTokens}; use syn::Ident; @@ -151,7 +152,7 @@ impl DeprecatedWarningBuilder { /// Multiple help links for the user to explain the transition and justification. #[must_use] pub fn help_links(self, links: &[&str]) -> Self { - Self { links: links.iter().map(|s| s.deref().into()).collect(), ..self } + Self { links: links.iter().map(|s| (*s).into()).collect(), ..self } } /// Set the span of the warning. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a39fada..a472f17 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-03-31" +channel = "nightly-2023-12-12" components = [ "rustfmt", "clippy" ] profile = "minimal" diff --git a/ui-tests/derive/Cargo.toml b/ui-tests/derive/Cargo.toml index f40852a..b1d6279 100644 --- a/ui-tests/derive/Cargo.toml +++ b/ui-tests/derive/Cargo.toml @@ -10,4 +10,4 @@ proc-macro = true [dependencies] proc-macro-warning = { path = "../../proc-macro-warning" } quote = "1.0.33" -syn = "2.0.38" +syn = "2.0.42" diff --git a/ui-tests/ui/Cargo.toml b/ui-tests/ui/Cargo.toml index f588a29..5bf3215 100644 --- a/ui-tests/ui/Cargo.toml +++ b/ui-tests/ui/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" publish = false [dev-dependencies] -trybuild = "1.0.85" +trybuild = "1.0.86" derive = { path = "../derive" } diff --git a/ui-tests/ui/src/warn/derive_basic.stderr b/ui-tests/ui/src/warn/derive_basic.stderr index abd9ebb..73dfb42 100644 --- a/ui-tests/ui/src/warn/derive_basic.stderr +++ b/ui-tests/ui/src/warn/derive_basic.stderr @@ -7,3 +7,4 @@ error: use of deprecated constant `test::_w`: | ^^^^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(deprecated)]` diff --git a/ui-tests/ui/src/warn/derive_raw.stderr b/ui-tests/ui/src/warn/derive_raw.stderr index a8b6551..6bce4c0 100644 --- a/ui-tests/ui/src/warn/derive_raw.stderr +++ b/ui-tests/ui/src/warn/derive_raw.stderr @@ -8,3 +8,4 @@ error: use of deprecated constant `VeryOldStuff::_w`: | ^^^^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(deprecated)]` diff --git a/ui-tests/ui/src/warn/derive_twice_errors.stderr b/ui-tests/ui/src/warn/derive_twice_errors.stderr index 190b49c..5577bd5 100644 --- a/ui-tests/ui/src/warn/derive_twice_errors.stderr +++ b/ui-tests/ui/src/warn/derive_twice_errors.stderr @@ -18,6 +18,7 @@ error: use of deprecated constant `test::_w`: | ^^^^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(deprecated)]` error: use of deprecated constant `test::_w`: It is deprecated to foo.