about summary refs log tree commit diff
path: root/library/std/src/ffi
diff options
context:
space:
mode:
authorNathan Whitaker <nathan.whitaker01@gmail.com>2020-09-21 16:32:28 -0400
committerNathan Whitaker <nathan.whitaker01@gmail.com>2020-10-26 18:19:48 -0400
commit1bcd2452fe0abd1510b21cfa9aef19898a5c14fe (patch)
tree3de94c385ad958dd42c35b04b292dd382bb00c49 /library/std/src/ffi
parent737bfeffd2805f2372c934999afd8ea87921d835 (diff)
downloadrust-1bcd2452fe0abd1510b21cfa9aef19898a5c14fe.tar.gz
rust-1bcd2452fe0abd1510b21cfa9aef19898a5c14fe.zip
Address review comments
Diffstat (limited to 'library/std/src/ffi')
-rw-r--r--library/std/src/ffi/c_str.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs
index a9ab0d1d83b..1cfd73863a6 100644
--- a/library/std/src/ffi/c_str.rs
+++ b/library/std/src/ffi/c_str.rs
@@ -109,7 +109,9 @@ use crate::sys;
 /// documentation of `CString` before use, as improper ownership management
 /// of `CString` instances can lead to invalid memory accesses, memory leaks,
 /// and other memory errors.
+
 #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone)]
+#[cfg_attr(not(test), rustc_diagnostic_item = "cstring_type")]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct CString {
     // Invariant 1: the slice ends with a zero byte and has a length of at least one.