Skip to content

Commit 226ca65

Browse files
committed
Test all features in check.sh.
1 parent 6ca190f commit 226ca65

File tree

10 files changed

+28
-40
lines changed

10 files changed

+28
-40
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535

3636
- name: Install cargo plugins
3737
run: |
38+
cargo install cargo-hack
3839
cargo install cargo-rdme
3940
cargo install cargo-machete
4041
cargo install taplo-cli

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ serde_json = "1.0.145"
3535
static_assertions = "1.1.0"
3636

3737
[features]
38-
fatal-warnings = []
3938
triomphe = ["dep:triomphe"]
4039
serde = ["dep:serde"]
4140

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ archery = "<version>"
4242

4343
`archery` defines a [`SharedPointer`](https://docs.rs/archery/latest/archery/shared_pointer/struct.SharedPointer.html)
4444
that receives the [kind of pointer](https://docs.rs/archery/latest/archery/shared_pointer/kind/trait.SharedPointerKind.html)
45-
as a type parameter. This gives you a convenient and ergonomic way to abstract the pointer
45+
as a type parameter. This gives you a convenient and ergonomic way to abstract the pointer
4646
type away.
4747

4848
### Example
@@ -90,8 +90,8 @@ kind in [`SharedPointer`](https://docs.rs/archery/latest/archery/shared_pointer/
9090

9191
### Serialization
9292

93-
We support serialization through [serde](https://crates.io/crates/serde). To use it
94-
enable the `serde` feature. To do so change the archery dependency in your `Cargo.toml` to
93+
We support serialization through [serde](https://crates.io/crates/serde). To use it
94+
enable the `serde` feature. To do so change the archery dependency in your `Cargo.toml` to
9595

9696
```toml
9797
[dependencies]
@@ -100,13 +100,13 @@ archery = { version = "<version>", features = ["serde"] }
100100
## Limitations
101101

102102
Currently it is not possible to have unsized types inside a
103-
[`SharedPointer`](https://docs.rs/archery/latest/archery/shared_pointer/struct.SharedPointer.html). As a workaround you can put the
103+
[`SharedPointer`](https://docs.rs/archery/latest/archery/shared_pointer/struct.SharedPointer.html). As a workaround you can put the
104104
unsized type inside a [`Box`](https://doc.rust-lang.org/stable/alloc/boxed/struct.Box.html).
105105

106106
## Alternative approaches
107107

108108
An alternative to the approach taken by `archery` is to use traits with associated types to encode
109-
type-level functions. This has been suggested
109+
type-level functions. This has been suggested
110110
[multiple](https://github.com/orium/rpds/issues/7#issuecomment-362635901)
111111
[times](https://joshlf.com/post/2018/10/18/rust-higher-kinded-types-already/#comment-4160863400),
112112
but offers ugly ergonomics (see

benches/archery_shared_pointer_arc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
2-
31
use archery::*;
4-
use std::ops::Deref;
5-
62
use criterion::{Criterion, criterion_group, criterion_main};
73
use std::hint::black_box;
4+
use std::ops::Deref;
85

96
fn archery_shared_pointer_arc_deref(c: &mut Criterion) {
107
let limit = 200_000;

benches/archery_shared_pointer_arct.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
2-
31
use archery::*;
4-
use std::ops::Deref;
5-
62
use criterion::{Criterion, criterion_group, criterion_main};
73
use std::hint::black_box;
4+
use std::ops::Deref;
85

96
fn archery_shared_pointer_arct_deref(c: &mut Criterion) {
107
let limit = 200_000;

benches/archery_shared_pointer_rc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
2-
31
use archery::*;
4-
use std::ops::Deref;
5-
62
use criterion::{Criterion, criterion_group, criterion_main};
73
use std::hint::black_box;
4+
use std::ops::Deref;
85

96
fn archery_shared_pointer_rc_deref(c: &mut Criterion) {
107
let limit = 200_000;

benches/std_arc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
2-
3-
use std::ops::Deref;
4-
use std::sync::Arc;
5-
61
use criterion::{Criterion, criterion_group, criterion_main};
72
use std::hint::black_box;
3+
use std::ops::Deref;
4+
use std::sync::Arc;
85

96
fn std_arc_deref(c: &mut Criterion) {
107
let limit = 200_000;

benches/std_rc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
2-
3-
use std::ops::Deref;
4-
use std::rc::Rc;
5-
61
use criterion::{Criterion, criterion_group, criterion_main};
72
use std::hint::black_box;
3+
use std::ops::Deref;
4+
use std::rc::Rc;
85

96
fn std_rc_deref(c: &mut Criterion) {
107
let limit = 200_000;

src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![no_std]
2-
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
3-
// Note: If you change this remember to update `README.md`. To do so run `cargo rdme`.
2+
// Note: If you change this remember to update `README.md`. To do so run `cargo rdme`.
43
//! `archery` is a rust library that offers a way to abstraction over
54
//! [`Rc`](::alloc::rc::Rc) and
65
//! [`Arc`](::alloc::sync::Arc) smart pointers.
@@ -31,7 +30,7 @@
3130
//!
3231
//! `archery` defines a [`SharedPointer`](crate::shared_pointer::SharedPointer)
3332
//! that receives the [kind of pointer](crate::shared_pointer::kind::SharedPointerKind)
34-
//! as a type parameter. This gives you a convenient and ergonomic way to abstract the pointer
33+
//! as a type parameter. This gives you a convenient and ergonomic way to abstract the pointer
3534
//! type away.
3635
//!
3736
//! ## Example
@@ -95,8 +94,8 @@
9594
//!
9695
//! ## Serialization
9796
//!
98-
//! We support serialization through [serde](https://crates.io/crates/serde). To use it
99-
//! enable the `serde` feature. To do so change the archery dependency in your `Cargo.toml` to
97+
//! We support serialization through [serde](https://crates.io/crates/serde). To use it
98+
//! enable the `serde` feature. To do so change the archery dependency in your `Cargo.toml` to
10099
//!
101100
//! ```toml
102101
//! [dependencies]
@@ -105,13 +104,13 @@
105104
//! # Limitations
106105
//!
107106
//! Currently it is not possible to have unsized types inside a
108-
//! [`SharedPointer`](crate::shared_pointer::SharedPointer). As a workaround you can put the
107+
//! [`SharedPointer`](crate::shared_pointer::SharedPointer). As a workaround you can put the
109108
//! unsized type inside a [`Box`](::alloc::boxed::Box).
110109
//!
111110
//! # Alternative approaches
112111
//!
113112
//! An alternative to the approach taken by `archery` is to use traits with associated types to encode
114-
//! type-level functions. This has been suggested
113+
//! type-level functions. This has been suggested
115114
//! [multiple](https://github.com/orium/rpds/issues/7#issuecomment-362635901)
116115
//! [times](https://joshlf.com/post/2018/10/18/rust-higher-kinded-types-already/#comment-4160863400),
117116
//! but offers ugly ergonomics (see

tools/check.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,24 @@ assert_installed "cargo"
2020

2121
trap on_failure ERR
2222

23+
export RUSTFLAGS="-Dwarnings"
24+
2325
function check_basic {
26+
assert_installed "cargo-hack"
27+
2428
echo 'Building:'
25-
cargo build --features fatal-warnings --all-targets
29+
cargo build --all-targets --all-features
2630
echo 'Testing:'
27-
cargo test --features fatal-warnings --all-targets
31+
cargo hack test --each-feature --all-targets
2832
# Weirdly, the `cargo test ... --all-targets ...` above does not run the tests in the documentation, so we run the
2933
# doc tests like this.
3034
# See https://github.com/rust-lang/cargo/issues/6669.
3135
echo 'Testing doc:'
32-
cargo test --features fatal-warnings --doc
36+
cargo test --doc --all-features
3337
echo 'Checking the benchmarks:'
34-
cargo bench --features fatal-warnings -- --test
38+
cargo bench --all-features -- --test
3539
echo 'Checking documentation:'
36-
cargo doc --features fatal-warnings --no-deps
40+
cargo doc --no-deps --all-features
3741

3842
# Tests for memory safety and memory leaks with miri.
3943
if [ -z "$MIRI_TOOLCHAIN" ]; then

0 commit comments

Comments
 (0)