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

Fix doc cfg and CI #12

Merged
merged 1 commit into from
Dec 30, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
toolchain: stable
- name: Check Compile
run: |
cargo test --target-dir ../../../target
cargo test --workspace
cargo check --benches --target-dir ../target --manifest-path ./benches/Cargo.toml
cargo check --workspace --examples
cargo check --workspace
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
toolchain: stable
- name: Check Compile
run: |
cargo test --target-dir ../../../target
cargo test --workspace
cargo check --benches --target-dir ../target --manifest-path ./benches/Cargo.toml
cargo check --workspace --examples
cargo check --workspace
Expand All @@ -72,7 +72,9 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@beta
- name: Build and check docs
run: cargo run -p ci -- doc
run: |
cargo test --workspace --doc --no-fail-fast
cargo doc --workspace --all-features --no-deps --document-private-items --keep-going
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 --cfg docsrs_dep"
Expand Down
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
unsafe_code = "deny"
unsafe_op_in_unsafe_fn = "warn"
unused_qualifications = "warn"
internal_features = { level = "allow" }

[lints.rust]
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
unsafe_code = "deny"
unsafe_op_in_unsafe_fn = "warn"
unused_qualifications = "warn"
internal_features = { level = "allow" }

[profile.release]
opt-level = 3
lto = true

[package.metadata.docs.rs]
# This cfg is needed so that #[doc(fake_variadic)] is correctly propagated for
# impls for re-exported traits. See https://github.com/rust-lang/cargo/issues/8811
# for details on why this is needed. Since dependencies don't expect to be built
# with `--cfg docsrs` (and thus fail to compile), we use a different cfg.
rustc-args = ["--cfg", "docsrs_dep"]
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
all-features = true
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]

# Examples

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Downloads](https://img.shields.io/crates/d/variadics_please.svg)](https://crates.io/crates/variadics_please)
[![Docs](https://docs.rs/variadics_please/badge.svg)](https://docs.rs/variadics_please/latest/variadics_please/)

Provides a macro for implementing traits on variadic types.
Provides macros for implementing traits on variadic types.

## Contributing

Expand Down
4 changes: 0 additions & 4 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ rand = "0.8"
rand_chacha = "0.3"
criterion = { version = "0.3", features = ["html_reports"] }

[profile.release]
opt-level = 3
lto = true

[[bench]]
name = "dummy"
path = "benches/dummy.rs"
Expand Down
5 changes: 5 additions & 0 deletions examples/demonstrations/all_tuples.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
//! An example of using `all_tuples!`

use variadics_please::all_tuples;

fn main() {}

/// For demonstration
pub trait Foo {
/// For demonstration
const FOO_HARDER: bool;
/// For demonstration
fn foo() -> bool;
}

Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Provides macros for implementing traits on variadic types.

// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]

use proc_macro::TokenStream;
use proc_macro2::{Literal, Span as Span2, TokenStream as TokenStream2};
Expand Down
Loading