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 eyre-rs#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 eyre-rs#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 75511af commit 9e309b7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --all ${{ matrix.features }}
args: --all --unstable ${{ matrix.features }}

test-msrv:
name: Test Suite
Expand All @@ -79,7 +79,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --all ${{ matrix.features }}
args: --all --unstable ${{ matrix.features }}

test-os:
name: Test Suite
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)]
#[test]
fn ui() {
Expand Down

0 comments on commit 9e309b7

Please sign in to comment.