]> git.lizzy.rs Git - rust.git/commitdiff
Specify behavior when passed a null pointer
authorStephane Raux <stephaneyfx@gmail.com>
Tue, 10 Dec 2019 06:56:37 +0000 (22:56 -0800)
committerstephaneyfx <stephaneyfx@gmail.com>
Tue, 10 Dec 2019 07:20:49 +0000 (23:20 -0800)
src/liballoc/boxed.rs

index a7e09d72b4a92cdaae9337faed99af581e32fd00..2f24086bf2c9857b82c35e373ddec0d450a6b63d 100644 (file)
 //!
 //! ```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