Skip to content

Commit 8926c15

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163510 b: refs/heads/snap-stage3 c: c3778fa h: refs/heads/master v: v3
1 parent 2e24938 commit 8926c15

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 556d971f83ea5950444b0a5b5392cd0040f077f6
4+
refs/heads/snap-stage3: c3778fae6f57d30381476ea0110cb445e52b407a
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libstd/rand/os.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ mod imp {
187187
/// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed
188188
/// This does not block.
189189
#[allow(missing_copy_implementations)]
190-
pub struct OsRng;
190+
pub struct OsRng {
191+
// dummy field to ensure that this struct cannot be constructed outside of this module
192+
_dummy: (),
193+
}
191194

192195
#[repr(C)]
193196
struct SecRandom;
@@ -204,7 +207,7 @@ mod imp {
204207
impl OsRng {
205208
/// Create a new `OsRng`.
206209
pub fn new() -> IoResult<OsRng> {
207-
Ok(OsRng)
210+
Ok(OsRng { _dummy: () })
208211
}
209212
}
210213

0 commit comments

Comments
 (0)