]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/miri/src/shims/tls.rs
handle unknown targets more gracefully
[rust.git] / src / tools / miri / src / shims / tls.rs
index 54fdf2872ab4d3967c594fba3d30def27840b96f..ca31efa486c2717d03795f227ae6530988b7bfc1 100644 (file)
@@ -257,16 +257,11 @@ pub fn on_stack_empty<'tcx>(
                         // And move to the final state.
                         self.0 = Done;
                     }
-                    "wasi" | "none" => {
-                        // No OS, no TLS dtors.
+                    _ => {
+                        // No TLS dtor support.
                         // FIXME: should we do something on wasi?
                         self.0 = Done;
                     }
-                    os => {
-                        throw_unsup_format!(
-                            "the TLS machinery does not know how to handle OS `{os}`"
-                        );
-                    }
                 }
             }
             PthreadDtors(state) => {
@@ -303,12 +298,12 @@ fn schedule_windows_tls_dtors(&mut self) -> InterpResult<'tcx> {
             return Ok(());
         }
         let thread_callback =
-            this.eval_windows("thread_local_key", "p_thread_callback")?.to_pointer(this)?;
+            this.eval_windows("thread_local_key", "p_thread_callback").to_pointer(this)?;
         let thread_callback = this.get_ptr_fn(thread_callback)?.as_instance()?;
 
         // FIXME: Technically, the reason should be `DLL_PROCESS_DETACH` when the main thread exits
         // but std treats both the same.
-        let reason = this.eval_windows("c", "DLL_THREAD_DETACH")?;
+        let reason = this.eval_windows("c", "DLL_THREAD_DETACH");
 
         // The signature of this function is `unsafe extern "system" fn(h: c::LPVOID, dwReason: c::DWORD, pv: c::LPVOID)`.
         // FIXME: `h` should be a handle to the current module and what `pv` should be is unknown