@@ -23,11 +23,11 @@ impl Signal {
23
23
}
24
24
}
25
25
26
- struct Foo ( Signal ) ;
26
+ struct NotifyOnDrop ( Signal ) ;
27
27
28
- impl Drop for Foo {
28
+ impl Drop for NotifyOnDrop {
29
29
fn drop ( & mut self ) {
30
- let Foo ( ref f) = * self ;
30
+ let NotifyOnDrop ( ref f) = * self ;
31
31
f. notify ( ) ;
32
32
}
33
33
}
@@ -82,18 +82,18 @@ fn states() {
82
82
83
83
#[ test]
84
84
fn smoke_dtor ( ) {
85
- thread_local ! ( static FOO : UnsafeCell <Option <Foo >> = UnsafeCell :: new( None ) ) ;
85
+ thread_local ! ( static FOO : UnsafeCell <Option <NotifyOnDrop >> = UnsafeCell :: new( None ) ) ;
86
86
run ( & FOO ) ;
87
- thread_local ! ( static FOO2 : UnsafeCell <Option <Foo >> = const { UnsafeCell :: new( None ) } ) ;
87
+ thread_local ! ( static FOO2 : UnsafeCell <Option <NotifyOnDrop >> = const { UnsafeCell :: new( None ) } ) ;
88
88
run ( & FOO2 ) ;
89
89
90
- fn run ( key : & ' static LocalKey < UnsafeCell < Option < Foo > > > ) {
90
+ fn run ( key : & ' static LocalKey < UnsafeCell < Option < NotifyOnDrop > > > ) {
91
91
let signal = Signal :: default ( ) ;
92
92
let signal2 = signal. clone ( ) ;
93
93
let t = thread:: spawn ( move || unsafe {
94
94
let mut signal = Some ( signal2) ;
95
95
key. with ( |f| {
96
- * f. get ( ) = Some ( Foo ( signal. take ( ) . unwrap ( ) ) ) ;
96
+ * f. get ( ) = Some ( NotifyOnDrop ( signal. take ( ) . unwrap ( ) ) ) ;
97
97
} ) ;
98
98
} ) ;
99
99
signal. wait ( ) ;
@@ -187,13 +187,13 @@ fn self_referential() {
187
187
fn dtors_in_dtors_in_dtors ( ) {
188
188
struct S1 ( Signal ) ;
189
189
thread_local ! ( static K1 : UnsafeCell <Option <S1 >> = UnsafeCell :: new( None ) ) ;
190
- thread_local ! ( static K2 : UnsafeCell <Option <Foo >> = UnsafeCell :: new( None ) ) ;
190
+ thread_local ! ( static K2 : UnsafeCell <Option <NotifyOnDrop >> = UnsafeCell :: new( None ) ) ;
191
191
192
192
impl Drop for S1 {
193
193
fn drop ( & mut self ) {
194
194
let S1 ( ref signal) = * self ;
195
195
unsafe {
196
- let _ = K2 . try_with ( |s| * s. get ( ) = Some ( Foo ( signal. clone ( ) ) ) ) ;
196
+ let _ = K2 . try_with ( |s| * s. get ( ) = Some ( NotifyOnDrop ( signal. clone ( ) ) ) ) ;
197
197
}
198
198
}
199
199
}
@@ -211,13 +211,13 @@ fn dtors_in_dtors_in_dtors() {
211
211
fn dtors_in_dtors_in_dtors_const_init ( ) {
212
212
struct S1 ( Signal ) ;
213
213
thread_local ! ( static K1 : UnsafeCell <Option <S1 >> = const { UnsafeCell :: new( None ) } ) ;
214
- thread_local ! ( static K2 : UnsafeCell <Option <Foo >> = const { UnsafeCell :: new( None ) } ) ;
214
+ thread_local ! ( static K2 : UnsafeCell <Option <NotifyOnDrop >> = const { UnsafeCell :: new( None ) } ) ;
215
215
216
216
impl Drop for S1 {
217
217
fn drop ( & mut self ) {
218
218
let S1 ( ref signal) = * self ;
219
219
unsafe {
220
- let _ = K2 . try_with ( |s| * s. get ( ) = Some ( Foo ( signal. clone ( ) ) ) ) ;
220
+ let _ = K2 . try_with ( |s| * s. get ( ) = Some ( NotifyOnDrop ( signal. clone ( ) ) ) ) ;
221
221
}
222
222
}
223
223
}
0 commit comments