]> git.lizzy.rs Git - rust.git/blobdiff - src/shims/dlsym.rs
Auto merge of #2183 - RalfJung:better-provenance-control, r=RalfJung
[rust.git] / src / shims / dlsym.rs
index d83a309c3e1f703c31c13dc8b96877d81e0d4f53..c5081582281bc3ef2dd89d723174b3c75560b4c5 100644 (file)
@@ -2,23 +2,23 @@
 use rustc_target::spec::abi::Abi;
 
 use crate::*;
-use shims::posix::dlsym as posix;
+use shims::unix::dlsym as unix;
 use shims::windows::dlsym as windows;
 
 #[derive(Debug, Copy, Clone)]
 #[allow(non_camel_case_types)]
 pub enum Dlsym {
-    Posix(posix::Dlsym),
+    Posix(unix::Dlsym),
     Windows(windows::Dlsym),
 }
 
 impl Dlsym {
     // Returns an error for unsupported symbols, and None if this symbol
     // should become a NULL pointer (pretend it does not exist).
-    pub fn from_str(name: &[u8], target_os: &str) -> InterpResult<'static, Option<Dlsym>> {
+    pub fn from_str<'tcx>(name: &[u8], target_os: &str) -> InterpResult<'tcx, Option<Dlsym>> {
         let name = &*String::from_utf8_lossy(name);
         Ok(match target_os {
-            "linux" | "macos" => posix::Dlsym::from_str(name, target_os)?.map(Dlsym::Posix),
+            "linux" | "macos" => unix::Dlsym::from_str(name, target_os)?.map(Dlsym::Posix),
             "windows" => windows::Dlsym::from_str(name)?.map(Dlsym::Windows),
             os => bug!("dlsym not implemented for target_os {}", os),
         })
@@ -38,7 +38,7 @@ fn call_dlsym(
         let this = self.eval_context_mut();
         match dlsym {
             Dlsym::Posix(dlsym) =>
-                posix::EvalContextExt::call_dlsym(this, dlsym, abi, args, dest, ret),
+                unix::EvalContextExt::call_dlsym(this, dlsym, abi, args, dest, ret),
             Dlsym::Windows(dlsym) =>
                 windows::EvalContextExt::call_dlsym(this, dlsym, abi, args, dest, ret),
         }