Skip to content

Commit

Permalink
Update deps (#12)
Browse files Browse the repository at this point in the history
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 <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Dec 22, 2023
1 parent dcc2ce1 commit 0e22e8d
Showing 12 changed files with 51 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[workspace]
readme = "README.md"
resolver = "2"

members = [
"proc-macro-warning",

"ui-tests/derive",
"ui-tests/ui",
]

[workspace.package]
readme = "README.md"
14 changes: 14 additions & 0 deletions MAINTAIN.md
Original file line number Diff line number Diff line change
@@ -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
```
7 changes: 4 additions & 3 deletions proc-macro-warning/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <oliver@tasty.limo>"]
@@ -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 = []
7 changes: 4 additions & 3 deletions proc-macro-warning/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-03-31"
channel = "nightly-2023-12-12"
components = [ "rustfmt", "clippy" ]
profile = "minimal"
2 changes: 1 addition & 1 deletion ui-tests/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion ui-tests/ui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@ edition = "2021"
publish = false

[dev-dependencies]
trybuild = "1.0.85"
trybuild = "1.0.86"
derive = { path = "../derive" }
1 change: 1 addition & 0 deletions ui-tests/ui/src/warn/derive_basic.stderr
Original file line number Diff line number Diff line change
@@ -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)]`
1 change: 1 addition & 0 deletions ui-tests/ui/src/warn/derive_raw.stderr
Original file line number Diff line number Diff line change
@@ -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)]`
1 change: 1 addition & 0 deletions ui-tests/ui/src/warn/derive_twice_errors.stderr
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 0e22e8d

Please sign in to comment.