@@ -1070,23 +1070,26 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1070
1070
thread. state = ThreadState :: Terminated ;
1071
1071
1072
1072
let current_span = this. machine . current_span ( ) ;
1073
- let thread_local_allocations = this. machine . threads . thread_terminated (
1074
- this. machine . data_race . as_mut ( ) ,
1075
- current_span,
1076
- ) ;
1073
+ let thread_local_allocations =
1074
+ this. machine . threads . thread_terminated ( this. machine . data_race . as_mut ( ) , current_span) ;
1077
1075
match this. get_active_thread_id ( ) {
1078
1076
// For main thread, add thread-local statics to static roots and skip deallocating
1079
1077
// backing memory
1080
- ThreadId ( 0 ) => for ptr in thread_local_allocations {
1081
- if let Some ( alloc) = ptr. provenance . get_alloc_id ( ) {
1082
- trace ! ( "Main thread thread-local static stored as static root: {:?}" , alloc) ;
1083
- this. machine . static_roots . push ( alloc) ;
1084
- }
1085
- }
1078
+ ThreadId ( 0 ) =>
1079
+ for ptr in thread_local_allocations {
1080
+ if let Some ( alloc) = ptr. provenance . get_alloc_id ( ) {
1081
+ trace ! (
1082
+ "Main thread thread-local static stored as static root: {:?}" ,
1083
+ alloc
1084
+ ) ;
1085
+ this. machine . static_roots . push ( alloc) ;
1086
+ }
1087
+ } ,
1086
1088
// Deallocate backing memory of thread-local statics
1087
- ThreadId ( _) => for ptr in thread_local_allocations {
1088
- this. deallocate_ptr ( ptr. into ( ) , None , MiriMemoryKind :: Tls . into ( ) ) ?;
1089
- }
1089
+ ThreadId ( _) =>
1090
+ for ptr in thread_local_allocations {
1091
+ this. deallocate_ptr ( ptr. into ( ) , None , MiriMemoryKind :: Tls . into ( ) ) ?;
1092
+ } ,
1090
1093
}
1091
1094
Ok ( ( ) )
1092
1095
}
0 commit comments