Skip to content

Commit

Permalink
Support unstable-less nightly
Browse files Browse the repository at this point in the history
This change attempts to put unstable features behind an opt-in feature
flag as requested by issue #120. Unstable lints and compile_test.rs are
both gated by this feature which is added unconditionally to all CI
that touches more than just stable.

As expressed in issue #120, I have some concerns about *needing* to gate
compile_test.rs behind feature = "unstable". I'm not certain that this
unstable-less nightly eyre will work in production due to the reason
that compile_test.rs fails: three of our dependencies, anyhow,
thiserror, and proc-macro, all use a test for a nightly toolchain to
gate unstable features. Maybe I'm wrong though and this change is
sufficient!
  • Loading branch information
thenorili committed Nov 19, 2023
1 parent 9b68aee commit 0e1123b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
features:
- # default
- --no-default-features
- --features track-caller
- --features pyo3
- --features auto-install
- --features unstable track-caller
- --features unstable pyo3
- --features unstable auto-install
- --all-features
steps:
- uses: actions/checkout@v1
Expand Down
6 changes: 6 additions & 0 deletions color-spantrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ repository = { workspace = true }
readme = { workspace = true }
rust-version = { workspace = true }

[features]
default = ["auto-install", "track-caller"]
auto-install = []
track-caller = []
unstable = []

[dependencies]
tracing-error = "0.2.0"
tracing-core = "0.1.21"
Expand Down
2 changes: 1 addition & 1 deletion color-spantrace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
#![doc(html_root_url = "https://docs.rs/color-spantrace/0.2.0")]
#![cfg_attr(
nightly,
all(nightly, feature = "unstable"),
feature(rustdoc_missing_doc_code_examples),
warn(rustdoc::missing_doc_code_examples)
)]
Expand Down
1 change: 1 addition & 0 deletions eyre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rust-version = { workspace = true }
default = ["auto-install", "track-caller"]
auto-install = []
track-caller = []
unstable = []

[dependencies]
indenter = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion eyre/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
#![doc(html_root_url = "https://docs.rs/eyre/0.6.8")]
#![cfg_attr(
nightly,
all(nightly, feature = "unstable"),
feature(rustdoc_missing_doc_code_examples),
warn(rustdoc::missing_doc_code_examples)
)]
Expand Down
2 changes: 1 addition & 1 deletion eyre/tests/compiletest.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[rustversion::attr(not(nightly), ignore)]
#[cfg_attr(any(not(nightly), not(feature = "unstable")), ignore)]
#[cfg_attr(miri, ignore)]

Check warning on line 2 in eyre/tests/compiletest.rs

View workflow job for this annotation

GitHub Actions / Miri

unused attribute
#[test]
fn ui() {
Expand Down

0 comments on commit 0e1123b

Please sign in to comment.