summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-30 22:02:33 +0000
committerbors <bors@rust-lang.org>2018-04-30 22:02:33 +0000
commit357bf00f1c0ee065239ee0213b854ee65f44eb03 (patch)
tree4769114d678a6150b43718a2d595a0bdad894e72 /src/libstd/ffi
parent17841cc97ac950312355403b6cfe11b916e242a6 (diff)
parent3dbdccc6a9c1ead58325d415381b25c676386c34 (diff)
downloadrust-357bf00f1c0ee065239ee0213b854ee65f44eb03.tar.gz
rust-357bf00f1c0ee065239ee0213b854ee65f44eb03.zip
Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/c_str.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 8164f52d3c3..7c358aafa9b 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -988,6 +988,7 @@ impl CStr {
     /// behavior when `ptr` is used inside the `unsafe` block:
     ///
     /// ```no_run
+    /// # #![allow(unused_must_use)]
     /// use std::ffi::{CString};
     ///
     /// let ptr = CString::new("Hello").unwrap().as_ptr();
@@ -1003,6 +1004,7 @@ impl CStr {
     /// To fix the problem, bind the `CString` to a local variable:
     ///
     /// ```no_run
+    /// # #![allow(unused_must_use)]
     /// use std::ffi::{CString};
     ///
     /// let hello = CString::new("Hello").unwrap();