about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorPhlosioneer <mattmdrr2@gmail.com>2018-03-11 07:41:13 -0400
committerPhlosioneer <mattmdrr2@gmail.com>2018-03-11 07:53:19 -0400
commit908328fca03c1bf69ce335974f4dcabd8e5d18f4 (patch)
treea352fda0348ab054ce225608425fa93be936d308 /src/libstd
parent1733a61141d125beb45587dd89d54cd4a01cdd5a (diff)
downloadrust-908328fca03c1bf69ce335974f4dcabd8e5d18f4.tar.gz
rust-908328fca03c1bf69ce335974f4dcabd8e5d18f4.zip
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".
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/stdio.rs9
-rw-r--r--src/libstd/net/addr.rs9
-rw-r--r--src/libstd/net/ip.rs9
-rw-r--r--src/libstd/time.rs6
4 files changed, 33 insertions, 0 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs
index 1f73054e3be..4565b7fa0d6 100644
--- a/src/libstd/io/stdio.rs
+++ b/src/libstd/io/stdio.rs
@@ -30,18 +30,27 @@ thread_local! {
 ///
 /// This handle is not synchronized or buffered in any fashion. Constructed via
 /// the `std::io::stdio::stdin_raw` function.
+///
+/// The size of a StdinRaw struct may vary depending on the target operating
+/// system, and may change between Rust releases.
 struct StdinRaw(stdio::Stdin);
 
 /// A handle to a raw instance of the standard output stream of this process.
 ///
 /// This handle is not synchronized or buffered in any fashion. Constructed via
 /// the `std::io::stdio::stdout_raw` function.
+///
+/// The size of a StdoutRaw struct may vary depending on the target operating
+/// system, and may change between Rust releases.
 struct StdoutRaw(stdio::Stdout);
 
 /// A handle to a raw instance of the standard output stream of this process.
 ///
 /// This handle is not synchronized or buffered in any fashion. Constructed via
 /// the `std::io::stdio::stderr_raw` function.
+///
+/// The size of a StderrRaw struct may vary depending on the target operating
+/// system, and may change between Rust releases.
 struct StderrRaw(stdio::Stderr);
 
 /// Constructs a new raw handle to the standard input of this process.
diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs
index fa430939f05..75b05063839 100644
--- a/src/libstd/net/addr.rs
+++ b/src/libstd/net/addr.rs
@@ -28,6 +28,9 @@ use slice;
 /// as possibly some version-dependent additional information. See [`SocketAddrV4`]'s and
 /// [`SocketAddrV6`]'s respective documentation for more details.
 ///
+/// The size of a SocketAddr instance may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [IP address]: ../../std/net/enum.IpAddr.html
 /// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
 /// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
@@ -61,6 +64,9 @@ pub enum SocketAddr {
 ///
 /// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
 ///
+/// The size of a SocketAddrV4 struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
 /// [IPv4 address]: ../../std/net/struct.Ipv4Addr.html
 /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
@@ -88,6 +94,9 @@ pub struct SocketAddrV4 { inner: c::sockaddr_in }
 ///
 /// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
 ///
+/// The size of a SocketAddrV6 struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
 /// [IPv6 address]: ../../std/net/struct.Ipv6Addr.html
 /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index 0d73a6f4fd7..36a34e147d5 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -26,6 +26,9 @@ use sys_common::{AsInner, FromInner};
 /// This enum can contain either an [`Ipv4Addr`] or an [`Ipv6Addr`], see their
 /// respective documentation for more details.
 ///
+/// The size of an IpAddr instance may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [`Ipv4Addr`]: ../../std/net/struct.Ipv4Addr.html
 /// [`Ipv6Addr`]: ../../std/net/struct.Ipv6Addr.html
 ///
@@ -61,6 +64,9 @@ pub enum IpAddr {
 ///
 /// See [`IpAddr`] for a type encompassing both IPv4 and IPv6 addresses.
 ///
+/// The size of an Ipv4Addr struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [IETF RFC 791]: https://tools.ietf.org/html/rfc791
 /// [`IpAddr`]: ../../std/net/enum.IpAddr.html
 ///
@@ -93,6 +99,9 @@ pub struct Ipv4Addr {
 ///
 /// See [`IpAddr`] for a type encompassing both IPv4 and IPv6 addresses.
 ///
+/// The size of an Ipv6Addr struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [IETF RFC 4291]: https://tools.ietf.org/html/rfc4291
 /// [`IpAddr`]: ../../std/net/enum.IpAddr.html
 ///
diff --git a/src/libstd/time.rs b/src/libstd/time.rs
index 12f2a9bb85f..054450a5186 100644
--- a/src/libstd/time.rs
+++ b/src/libstd/time.rs
@@ -49,6 +49,9 @@ pub use core::time::Duration;
 /// allows measuring the duration between two instants (or comparing two
 /// instants).
 ///
+/// The size of an Instant struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// Example:
 ///
 /// ```no_run
@@ -88,6 +91,9 @@ pub struct Instant(time::Instant);
 /// fixed point in time, a `SystemTime` can be converted to a human-readable time,
 /// or perhaps some other string representation.
 ///
+/// The size of a SystemTime struct may vary depending on the target operating
+/// system, and may change between Rust releases.
+///
 /// [`Instant`]: ../../std/time/struct.Instant.html
 /// [`Result`]: ../../std/result/enum.Result.html
 /// [`Duration`]: ../../std/time/struct.Duration.html