]> git.lizzy.rs Git - rust.git/blobdiff - src/helpers.rs
Use err_unsup_format instead
[rust.git] / src / helpers.rs
index d134a19f4c23d56202b6faf891dd96196ff2f451..330d6bc996b78e3061416a48cdbe7e7246f0d897 100644 (file)
@@ -101,9 +101,8 @@ fn gen_random(
 
         if this.machine.communicate {
             // Fill the buffer using the host's rng.
-            getrandom::getrandom(&mut data).map_err(|err| {
-                InterpError::Unsupported(UnsupportedOpInfo::Unsupported(err.to_string()))
-            })?;
+            getrandom::getrandom(&mut data)
+                .map_err(|err| err_unsup_format!("getrandom failed: {}", err))?;
         }
         else {
             let rng = this.memory_mut().extra.rng.get_mut();