about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorStephane Raux <stephaneyfx@gmail.com>2019-12-09 22:56:37 -0800
committerstephaneyfx <stephaneyfx@gmail.com>2019-12-09 23:20:49 -0800
commitfe6ddd5d15c4f0108c32fb731b688f34fbeba788 (patch)
treef56f29a8ff56e90c4a841b109a8b527bdd934a2e /src/liballoc
parentead115949017533de244049c58f4b6886243eda7 (diff)
downloadrust-fe6ddd5d15c4f0108c32fb731b688f34fbeba788.tar.gz
rust-fe6ddd5d15c4f0108c32fb731b688f34fbeba788.zip
Specify behavior when passed a null pointer
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/boxed.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index a7e09d72b4a..2f24086bf2c 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -73,8 +73,12 @@
 //!
 //! ```c
 //! /* C header */
-//! struct Foo* foo_new(void); /* Returns ownership to the caller */
-//! void foo_delete(struct Foo*); /* Takes ownership from the caller */
+//! 
+//! /* Returns ownership to the caller */
+//! struct Foo* foo_new(void);
+//! 
+//! /* Takes ownership from the caller; no-op when invoked with NULL */
+//! void foo_delete(struct Foo*);
 //! ```
 //! 
 //! These two functions might be implemented in Rust as follows. Here, the