diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-01 15:55:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-01 15:55:07 +0000 |
commit | fd5906790a45cf8f38922d26f772da9545035a41 (patch) | |
tree | 71a32dd3affcd6fece7a8d10856c9c0392fb7859 | |
parent | 2267b3f57e46ee74e63295d004d73a0e98f37311 (diff) | |
parent | 8aacca9fe33246470fe63df27fcff3bbc29eb27f (diff) | |
download | nix-fd5906790a45cf8f38922d26f772da9545035a41.zip |
Merge #1158
1158: Remove the last use of mem::uninitialized r=asomers a=asomers
Replace it with mem::zeroed. It isn't perfect, but it's better than it
was.
Issue #1115
Co-authored-by: Alan Somers <asomers@gmail.com>
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/sys/termios.rs | 2 | ||||
-rw-r--r-- | test/sys/test_ioctl.rs | 4 | ||||
-rw-r--r-- | test/test.rs | 2 |
4 files changed, 3 insertions, 7 deletions
@@ -14,8 +14,6 @@ #![deny(unstable_features)] #![deny(missing_copy_implementations)] #![deny(missing_debug_implementations)] -// XXX Allow deprecated items until release 0.16.0. See issue #1096. -#![allow(deprecated)] // External crates #[macro_use] diff --git a/src/sys/termios.rs b/src/sys/termios.rs index d08b2541..b5771fbb 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -250,7 +250,7 @@ impl Termios { #[doc(hidden)] pub unsafe fn default_uninit() -> Self { Termios { - inner: RefCell::new(mem::uninitialized()), + inner: RefCell::new(mem::zeroed()), input_flags: InputFlags::empty(), output_flags: OutputFlags::empty(), control_flags: ControlFlags::empty(), diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs index 9b286aa3..f8e313bf 100644 --- a/test/sys/test_ioctl.rs +++ b/test/sys/test_ioctl.rs @@ -323,7 +323,7 @@ mod freebsd_ioctls { #[test] fn test_ioctl_read() { let file = tempfile().unwrap(); - let mut termios = unsafe { mem::uninitialized() }; + let mut termios = unsafe { mem::zeroed() }; let res = unsafe { tiocgeta(file.as_raw_fd(), &mut termios) }; assert_eq!(res, Err(Sys(ENOTTY))); } @@ -332,7 +332,7 @@ mod freebsd_ioctls { #[test] fn test_ioctl_write_ptr() { let file = tempfile().unwrap(); - let termios: termios = unsafe { mem::uninitialized() }; + let termios: termios = unsafe { mem::zeroed() }; let res = unsafe { tiocseta(file.as_raw_fd(), &termios) }; assert_eq!(res, Err(Sys(ENOTTY))); } diff --git a/test/test.rs b/test/test.rs index 4b13fa44..370ae039 100644 --- a/test/test.rs +++ b/test/test.rs @@ -1,5 +1,3 @@ -// XXX Allow deprecated items until release 0.16.0. See issue #1096. -#![allow(deprecated)] extern crate bytes; #[cfg(any(target_os = "android", target_os = "linux"))] extern crate caps; |