Skip to content

Commit 60ca0f8

Browse files
committed
chore: defensive checks added to keep v0.2 stable
1 parent 49e57bc commit 60ca0f8

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ TRYBUILD=overwrite cargo test -p capsec --test compile_tests
156156
- **Include tests.** New authority patterns need integration tests. New type-system features need compile-fail tests.
157157
- **Run `cargo capsec audit`** against the repo itself before submitting — capsec dogfoods its own tool.
158158
- **Keep the security model intact.** `Cap<P>` must remain unforgeable and `!Send`. `Permission` must remain sealed. `Cap::new()` must remain `pub(crate)`. Any change that weakens these guarantees needs discussion in an issue first.
159+
- **`#[must_use]` convention.** Any new function or method returning `Result<T, CapSecError>`, `Cap<P>`, `SendCap<P>`, or `CapRoot` must have `#[must_use]`. Exception: if the return type itself already carries `#[must_use]` (e.g., `Cap<P>` does), a bare `#[must_use]` on the function is redundant and clippy will flag it — skip it in that case. The goal: discarding a capability check or proof token should always produce a compiler warning.
159160
- **Update docs** if you change public API. The facade crate's `lib.rs` doc comments and crate READMEs should stay current.
160161

161162
## Context pattern and macros

crates/capsec-core/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![deny(missing_docs)]
2+
#![deny(rustdoc::broken_intra_doc_links)]
3+
14
//! # capsec-core
25
//!
36
//! Zero-cost capability tokens and permission traits for compile-time

crates/capsec-std/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![deny(missing_docs)]
2+
#![deny(rustdoc::broken_intra_doc_links)]
3+
14
//! # capsec-std
25
//!
36
//! Capability-gated wrappers around the Rust standard library.

crates/capsec-tokio/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![deny(missing_docs)]
2+
#![deny(rustdoc::broken_intra_doc_links)]
3+
14
//! # capsec-tokio
25
//!
36
//! Async capability-gated wrappers for [tokio](https://tokio.rs/) — the async

crates/capsec/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ trybuild.workspace = true
2222
capsec-core.workspace = true
2323
capsec-tokio = { workspace = true, features = ["full"] }
2424
tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "net", "process", "io-util"] }
25+
26+
[lints.rust]
27+
missing_docs = "deny"
28+
29+
[lints.rustdoc]
30+
broken_intra_doc_links = "deny"

0 commit comments

Comments
 (0)