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

General maintenance #12

Merged
merged 10 commits into from
Dec 22, 2023
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
Expand All @@ -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" }
Expand All @@ -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
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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.
Expand Down