File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -663,8 +663,8 @@ pub fn set_print(sink: Option<Box<Write + Send>>) -> Option<Box<Write + Send>> {
663
663
///
664
664
/// This function is used to print error messages, so it takes extra
665
665
/// care to avoid causing a panic when `local_stream` is unusable.
666
- /// For instance, if the TLS key for the local stream is uninitialized
667
- /// or already destroyed, or if the local stream is locked by another
666
+ /// For instance, if the TLS key for the local stream is
667
+ /// already destroyed, or if the local stream is locked by another
668
668
/// thread, it will just fall back to the global stream.
669
669
///
670
670
/// However, if the actual I/O causes an error, this function does panic.
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ impl<T: 'static> LocalKey<T> {
272
272
///
273
273
/// This will lazily initialize the value if this thread has not referenced
274
274
/// this key yet. If the key has been destroyed (which may happen if this is called
275
- /// in a destructor), this function will return a ThreadLocalError.
275
+ /// in a destructor), this function will return a ` ThreadLocalError` .
276
276
///
277
277
/// # Panics
278
278
///
@@ -484,11 +484,7 @@ mod tests {
484
484
assert ! ( FOO . try_with( |_| ( ) ) . is_err( ) ) ;
485
485
}
486
486
}
487
- fn foo ( ) -> Foo {
488
- assert ! ( FOO . try_with( |_| ( ) ) . is_err( ) ) ;
489
- Foo
490
- }
491
- thread_local ! ( static FOO : Foo = foo( ) ) ;
487
+ thread_local ! ( static FOO : Foo = Foo ) ;
492
488
493
489
thread:: spawn ( || {
494
490
assert ! ( FOO . try_with( |_| ( ) ) . is_ok( ) ) ;
@@ -520,6 +516,7 @@ mod tests {
520
516
impl Drop for S1 {
521
517
fn drop ( & mut self ) {
522
518
unsafe {
519
+ HITS += 1 ;
523
520
if K2 . try_with ( |_| ( ) ) . is_err ( ) {
524
521
assert_eq ! ( HITS , 3 ) ;
525
522
} else {
You can’t perform that action at this time.
0 commit comments