rust/src/libstd
Tim Neumann 571734fdd7
Rollup merge of #48932 - Phlosioneer:43601-document-opaque-size, r=KodrAus
Document when types have OS-dependent sizes

As per issue #43601, types that can change size depending on the
target operating system should say so in their documentation.

I used this template when adding doc comments:

```
The size of a(n) <name> struct may vary depending on the target
operating system, and may change between Rust releases.
```

For enums, I used "instance" instead of "struct".

I added documentation to these types:
```
- std::time::Instant						(contains sys::time::Instant)
- std::time::SystemTime						(contains sys::time::SystemTime)

- std::io::StdinRaw							(contains sys::stdio::Stdin)
- std::io::StdoutRaw						(contains sys::stdio::Stdout)
- std::io::Stderr							(contains sys::stdio::Stderr)

- std::net::addr::SocketAddrV4				(contains sys::net::netc::sockaddr_in)
- std::net::addr::SocketAddrV6				(contains sys::net::netc::sockaddr_in6)
- std::net::addr::SocketAddr				(contains std::net::addr::SocketAddrV4 and SocketAddrV6)
- std::net::ip::Ipv4Addr					(contains sys::net::netc::in_addr)
- std::net::ip::Ipv6Addr					(contains sys::net::netc::in6_addr)
- std::net::ip::IpAddr						(contains std::net::ip::Ipv4Addr and Ipv6Addr)
```

I also found that these types varied in size; however, I don't think they need documentation, as it's already fairly obvious that they change based on different OS's:

```
- std::fs::DirBuilder						(contains sys::fs::DirBuilder)
- std::fs::FileType							(contains sys::fs::FileType)
- std::fs::Permissions						(contains sys::fs::FilePermissions)
- std::fs::OpenOptions						(contains sys::fs::OpenOptions)
- std::fs::DirEntry							(contains sys::fs::DirEntry)
- std::fs::ReadDir							(contains sys::fs::ReadDir)
- std::fs::Metadata							(contains sys::fs::FileAttr)
- std::fs::File								(contains sys::fs::File)

- std::process::Child						(contains sys::process::Process)
- std::process::ChildStdin					(contains sys::process::AnonPipe)
- std::process::ChildStdout					(contains sys::process::AnonPipe)
- std::process::ChildStderr					(contains sys::process::AnonPipe)
- std::process::Command						(contains sys::process::Command)
- std::process::Stdio						(contains sys::process::Stdio)
- std::process::ExitStatus					(contains sys::process::ExitStatus)
- std::process::Output						(contains std::process::ExitStatus)

- std::sys_common::condvar::Condvar			(contains sys::condvar::Condvar)
- std::sys_common::mutex::Mutex				(contains sys::mutex::Mutex)
- std::sys_common::net::LookupHost			(contains sys::net::netc::addrinfo)
- std::sys_common::net::TcpStream			(contains sys::net::Socket)
- std::sys_common::net::TcpListener			(contains sys::net::Socket)
- std::sys_common::net::UdpSocket			(contains sys::net::Socket)
- std::sys_common::remutex::ReentrantMutex	(contains sys::mutex::ReentrantMutex)
- std::sys_common::rwlock::RWLock			(contains sys::rwlock::RWLock)
- std::sys_common::thread_local::Key		(contains sys::thread_local::Key)
```
Maybe we should just put a comment about the size of structs in the module-level docs for `fs`, `process`, and `sys_common`?

If anyone can think of other types that can change size, comment below. I'm also open to changing the wording.

closes #43601.
2018-03-26 15:14:54 +02:00
..
collections setting ABORTING_MALLOC for asmjs backend 2018-03-15 17:43:05 +00:00
ffi Add new warning for CStr::from_ptr 2018-02-24 16:50:44 +01:00
io Remove StdioRaw doc additions, add backticks 2018-03-20 07:31:22 -04:00
net Rollup merge of #48932 - Phlosioneer:43601-document-opaque-size, r=KodrAus 2018-03-26 15:14:54 +02:00
os fix docs link 2018-02-06 09:26:15 -06:00
prelude Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
sync Rollup merge of #47970 - vlovich:condvar_wait_until, r=dtolnay 2018-02-25 15:54:39 +08:00
sys Auto merge of #49315 - TheDan64:smaller_unsafe_block, r=joshtriplett 2018-03-25 05:26:58 +00:00
sys_common Rollup merge of #48624 - bdrewery:freebsd-posix-spawn, r=alexcrichton 2018-03-23 10:16:07 -07:00
tests Update Cargo submodule 2018-03-11 10:59:28 -07:00
thread Fix a bug introduced in previous commit 2018-03-01 00:07:27 +01:00
ascii.rs Deprecate the AsciiExt trait in favor of inherent methods 2018-03-21 17:54:33 +01:00
build.rs rustc: Embed LLVM bitcode by default on iOS 2018-03-13 08:29:19 -07:00
Cargo.toml Update Cargo submodule 2018-03-11 10:59:28 -07:00
env.rs Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs} 2018-02-05 00:00:09 +01:00
error.rs replace convert::Infallible with ! 2018-03-15 12:35:56 +08:00
f32.rs Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 2018-03-21 18:11:57 -07:00
f64.rs Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 2018-03-21 18:11:57 -07:00
fs.rs Fix Issue #48345, is_file, is_dir, and is_symlink note mutual exclusion 2018-03-16 03:41:53 -04:00
heap.rs Update miri to rustc changes 2017-12-06 09:25:29 +01:00
lib.rs Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakis 2018-03-25 01:26:32 +08:00
macros.rs document format_args! further wrt. Debug & Display" 2018-03-21 07:55:09 +01:00
memchr.rs Fix inconsistent doc headings 2017-08-24 18:42:53 +02:00
num.rs Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAus 2018-03-23 09:27:06 -05:00
panic.rs Auto merge of #47687 - SimonSapin:panic-impl, r=sfackler 2018-02-18 06:02:35 +00:00
panicking.rs make #[unwind] attribute specify expectations more clearly 2018-02-20 19:12:52 -05:00
path.rs Rollup merge of #48292 - topecongiro:from_str-for-path-and-pathbuf, r=alexcrichton 2018-03-08 11:25:54 -08:00
primitive_docs.rs stabilise feature(never_type) 2018-03-14 12:44:51 +08:00
process.rs Minor formatting consistency fix. 2018-03-25 01:27:45 -05:00
rt.rs move Termination trait to std::process 2018-02-22 17:57:08 -05:00
time.rs Add backticks 2018-03-24 23:41:34 -04:00