File tree Expand file tree Collapse file tree 3 files changed +5
-82
lines changed Expand file tree Collapse file tree 3 files changed +5
-82
lines changed Original file line number Diff line number Diff line change 1
1
use std:: cmp:: Ordering ;
2
+ use std:: fmt:: Debug ;
2
3
use std:: sync:: atomic:: AtomicUsize ;
3
4
use std:: sync:: atomic:: Ordering :: SeqCst ;
4
5
5
- use crate :: fmt:: Debug ; // the `Debug` trait is the only thing we use from `crate::fmt`
6
-
7
6
/// A blueprint for crash test dummy instances that monitor particular events.
8
7
/// Some instances may be configured to panic at some point.
9
8
/// Events are `clone`, `drop` or some anonymous `query`.
@@ -36,6 +35,7 @@ impl CrashTestDummy {
36
35
}
37
36
38
37
/// Returns how many times instances of the dummy have been cloned.
38
+ #[ allow( unused) ]
39
39
pub ( crate ) fn cloned ( & self ) -> usize {
40
40
self . cloned . load ( SeqCst )
41
41
}
@@ -46,6 +46,7 @@ impl CrashTestDummy {
46
46
}
47
47
48
48
/// Returns how many times instances of the dummy have had their `query` member invoked.
49
+ #[ allow( unused) ]
49
50
pub ( crate ) fn queried ( & self ) -> usize {
50
51
self . queried . load ( SeqCst )
51
52
}
@@ -71,6 +72,7 @@ impl Instance<'_> {
71
72
}
72
73
73
74
/// Some anonymous query, the result of which is already given.
75
+ #[ allow( unused) ]
74
76
pub ( crate ) fn query < R > ( & self , result : R ) -> R {
75
77
self . origin . queried . fetch_add ( 1 , SeqCst ) ;
76
78
if self . panic == Panic :: InQuery {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #[ path = "../../testing/crash_test.rs" ]
1
2
pub mod crash_test;
You can’t perform that action at this time.
0 commit comments