Skip to content

Commit 15e40c6

Browse files
committed
Workaround getrandom#545
1 parent 9f981cf commit 15e40c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rand_core/src/os.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ impl core::fmt::Display for OsError {
5858
}
5959
}
6060

61+
// NOTE: this should not require std; see getrandom#545
62+
#[cfg(feature = "std")]
6163
impl core::error::Error for OsError {
6264
#[inline]
6365
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
64-
self.0.source()
66+
core::error::Error::source(&self.0)
6567
}
6668
}
6769

0 commit comments

Comments
 (0)