From 1e69adc9b62f4001884e0db1be942daf1ed9cd10 Mon Sep 17 00:00:00 2001 From: Mathias Gottschlag Date: Tue, 12 May 2020 18:35:23 +0200 Subject: [PATCH 1/2] Fix compiler warnings (requires rustc 1.36.0). mem::unitialized() is deprecated, use mem::MaybeUninit instead which exists since rustc 1.36.0. --- src/lib.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5556d9e..a42bf0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -193,7 +193,7 @@ impl Chip { /// Open the GPIO Chip at the provided path (e.g. `/dev/gpiochip`) pub fn new>(path: P) -> Result { let f = File::open(path.as_ref())?; - let mut info: ffi::gpiochip_info = unsafe { mem::uninitialized() }; + let mut info: ffi::gpiochip_info = unsafe { mem::MaybeUninit::uninit().assume_init() }; ffi::gpio_get_chipinfo_ioctl(f.as_raw_fd(), &mut info)?; Ok(Chip { @@ -328,12 +328,12 @@ pub struct LineInfo { consumer: Option, } -/// Line Request Flags -/// -/// Maps to kernel [`GPIOHANDLE_REQUEST_*`] flags. -/// -/// [`GPIOHANDLE_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L58 bitflags! { + /// Line Request Flags + /// + /// Maps to kernel [`GPIOHANDLE_REQUEST_*`] flags. + /// + /// [`GPIOHANDLE_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L58 pub struct LineRequestFlags: u32 { const INPUT = (1 << 0); const OUTPUT = (1 << 1); @@ -343,12 +343,12 @@ bitflags! { } } -/// Event request flags -/// -/// Maps to kernel [`GPIOEVENT_REQEST_*`] flags. -/// -/// [`GPIOEVENT_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L109 bitflags! { + /// Event request flags + /// + /// Maps to kernel [`GPIOEVENT_REQEST_*`] flags. + /// + /// [`GPIOEVENT_REQUEST_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L109 pub struct EventRequestFlags: u32 { const RISING_EDGE = (1 << 0); const FALLING_EDGE = (1 << 1); @@ -356,12 +356,12 @@ bitflags! { } } -/// Informational Flags -/// -/// Maps to kernel [`GPIOLINE_FLAG_*`] flags. -/// -/// [`GPIOLINE_FLAG_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L29 bitflags! { + /// Informational Flags + /// + /// Maps to kernel [`GPIOLINE_FLAG_*`] flags. + /// + /// [`GPIOLINE_FLAG_*`]: https://elixir.bootlin.com/linux/v4.9.127/source/include/uapi/linux/gpio.h#L29 pub struct LineFlags: u32 { const KERNEL = (1 << 0); const IS_OUT = (1 << 1); From e2ae6cffac871f2ea7f5d1ca64d3a2eb1d47ed3f Mon Sep 17 00:00:00 2001 From: Mathias Gottschlag Date: Thu, 14 May 2020 09:11:33 +0200 Subject: [PATCH 2/2] Increase MSRV to 1.36.0. --- .travis.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f95148..752adf8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,7 +72,7 @@ matrix: # MSRV - env: TARGET=x86_64-unknown-linux-gnu - rust: 1.34.0 + rust: 1.36.0 if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) before_install: diff --git a/README.md b/README.md index bfd5efe..e08af16 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ to be considered reliable. ## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.34.0 and up. It *might* +This crate is guaranteed to compile on stable Rust 1.36.0 and up. It *might* compile with older versions but that may change in any new patch release. ## License