Skip to content

Commit 594f2f8

Browse files
committed
1. Fix build error related to missing enable_deprecated_hook cargo feature.
1 parent f8cffce commit 594f2f8

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
- uses: actions/checkout@v3
3131
- name: Run cargo deftest
3232
run: cargo test --verbose
33+
- name: Run cargo test nodeffeatures+lib
34+
run: cargo test --no-default-features --lib --verbose
3335
- name: Run cargo alltest
3436
run: cargo test --all-features --verbose
3537

src/core/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ impl Default for StateManuallyDrop {
491491
}
492492
}
493493

494-
#[cfg(test)]
494+
#[cfg(all(test, feature = "support_panic_trig"))]
495495
#[test]
496496
fn test_state() {
497497
let state = StateManuallyDrop::empty();
@@ -501,7 +501,7 @@ fn test_state() {
501501
state.deref_or_trig::<PanicTrigManuallyDrop>(); // ok
502502
}
503503

504-
#[cfg(test)]
504+
#[cfg(all(test, feature = "support_panic_trig"))]
505505
#[test]
506506
fn test_reset() {
507507
let state = StateManuallyDrop::empty();

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ pub use crate::core::state as state;
282282
#[doc(hidden)]
283283
#[deprecated(since = "0.1.5", note = "Use `SafeManuallyDrop::core::hook` instead")]
284284
#[allow(deprecated)]
285+
#[cfg(feature = "enable_deprecated_hook")]
285286
pub use crate::core::hook as hook;
286287

287288
#[doc(hidden)]

tests/all.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fn build_new_test_vec() -> Vec<String> {
1212
vec
1313
}
1414

15+
#[cfg(feature = "support_panic_trig")]
1516
#[allow(unused_unsafe)]
1617
mod panic_test_methods {
1718
use SafeManuallyDrop::AlwaysSafePanicManuallyDrop as PanicManuallyDrop;
@@ -160,6 +161,7 @@ mod panic_test_methods {
160161
}
161162
}
162163

164+
#[cfg(all(test, feature = "support_panic_trig"))]
163165
#[test]
164166
fn test_panic_mode() {
165167
static mut PANIC_COUNTER: usize = 0;

0 commit comments

Comments
 (0)