From 1fd290c222f28ade7f5ee6f049a47b93a51b1f97 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 30 Dec 2023 18:37:05 -0800 Subject: [PATCH] Make CI verify that error_generic_member_access works in latest nightly --- .github/workflows/ci.yml | 3 +++ src/lib.rs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68858a5..017ddbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,9 @@ jobs: - name: Enable type layout randomization run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV if: matrix.rust == 'nightly' + - name: Enable nightly-only tests + run: echo RUSTFLAGS=${RUSTFLAGS}\ --cfg=anyhow_nightly_testing >> $GITHUB_ENV + if: matrix.rust == 'nightly' - run: cargo test - run: cargo check --no-default-features - run: cargo check --features backtrace diff --git a/src/lib.rs b/src/lib.rs index 21fe8bf..c2dcb66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -237,6 +237,13 @@ clippy::wrong_self_convention )] +#[cfg(all( + anyhow_nightly_testing, + feature = "std", + not(error_generic_member_access) +))] +compile_error!("Build script probe failed to compile."); + extern crate alloc; #[macro_use]