Skip to content

Commit 4957414

Browse files
committed
auto merge of #7690 : kevinmehall/rust/document-c_void, r=huonw
I added documentation for when to use and not to use `c_void`, since it tripped me up when I started. (See issue #7627)
2 parents 9b5d523 + 663a959 commit 4957414

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/libc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ pub mod types {
186186
// Standard types that are opaque or common, so are not per-target.
187187
pub mod common {
188188
pub mod c95 {
189+
/**
190+
Type used to construct void pointers for use with C.
191+
192+
This type is only useful as a pointer target. Do not use it as a
193+
return type for FFI functions which have the `void` return type in
194+
C. Use the unit type `()` or omit the return type instead.
195+
*/
189196
pub enum c_void {}
190197
pub enum FILE {}
191198
pub enum fpos_t {}

0 commit comments

Comments
 (0)