Skip to content

Commit

Permalink
Merge pull request #12 from bevyengine/fix-cfg
Browse files Browse the repository at this point in the history
Fix doc cfg and CI
  • Loading branch information
alice-i-cecile authored Dec 30, 2024
2 parents 8da80cc + f5fb8d1 commit c6e041f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
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

0 comments on commit c6e041f

Please sign in to comment.