rollup merge of #19832: japaric/no-nocopy

r? @aturon / @alexcrichton
This commit is contained in:
Alex Crichton
2014-12-17 08:34:09 -08:00
11 changed files with 19 additions and 48 deletions

View File

@@ -186,8 +186,10 @@ mod imp {
/// service provider with the `PROV_RSA_FULL` type.
/// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed
/// This does not block.
#[allow(missing_copy_implementations)]
pub struct OsRng {
marker: marker::NoCopy
// dummy field to ensure that this struct cannot be constructed outside of this module
_dummy: (),
}
#[repr(C)]
@@ -205,7 +207,7 @@ mod imp {
impl OsRng {
/// Create a new `OsRng`.
pub fn new() -> IoResult<OsRng> {
Ok(OsRng {marker: marker::NoCopy} )
Ok(OsRng { _dummy: () })
}
}