Merge from rustc · qinheping/verify-rust-std@c15d489 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -975,9 +975,17 @@ pub trait UpperHex {
975 975 /// `p` formatting.
976 976 ///
977 977 /// The `Pointer` trait should format its output as a memory location. This is commonly presented
978 -/// as hexadecimal.
978 +/// as hexadecimal. For more information on formatters, see [the module-level documentation][module].
979 979 ///
980 -/// For more information on formatters, see [the module-level documentation][module].
980 +/// Printing of pointers is not a reliable way to discover how Rust programs are implemented.
981 +/// The act of reading an address changes the program itself, and may change how the data is represented
982 +/// in memory, and may affect which optimizations are applied to the code.
983 +///
984 +/// The printed pointer values are not guaranteed to be stable nor unique identifiers of objects.
985 +/// Rust allows moving values to different memory locations, and may reuse the same memory locations
986 +/// for different purposes.
987 +///
988 +/// There is no guarantee that the printed value can be converted back to a pointer.
981 989 ///
982 990 /// [module]: ../../std/fmt/index.html
983 991 ///
Original file line number Diff line number Diff line change
@@ -1910,10 +1910,14 @@ impl crate::error::Error for ExitStatusError {}
1910 1910 /// to its parent under normal termination.
1911 1911 ///
1912 1912 /// `ExitCode` is intended to be consumed only by the standard library (via
1913 -/// [`Termination::report()`]), and intentionally does not provide accessors like
1914 -/// `PartialEq`, `Eq`, or `Hash`. Instead the standard library provides the
1915 -/// canonical `SUCCESS` and `FAILURE` exit codes as well as `From for
1916 -/// ExitCode` for constructing other arbitrary exit codes.
1913 +/// [`Termination::report()`]). For forwards compatibility with potentially
1914 +/// unusual targets, this type currently does not provide `Eq`, `Hash`, or
1915 +/// access to the raw value. This type does provide `PartialEq` for
1916 +/// comparison, but note that there may potentially be multiple failure
1917 +/// codes, some of which will _not_ compare equal to `ExitCode::FAILURE`.
1918 +/// The standard library provides the canonical `SUCCESS` and `FAILURE`
1919 +/// exit codes as well as `From for ExitCode` for constructing other
1920 +/// arbitrary exit codes.
1917 1921 ///
1918 1922 /// # Portability
1919 1923 ///
@@ -1952,7 +1956,7 @@ impl crate::error::Error for ExitStatusError {}
1952 1956 /// ExitCode::SUCCESS
1953 1957 /// }
1954 1958 /// ```
1955 -#[derive(Clone, Copy, Debug)]
1959 +#[derive(Clone, Copy, Debug, PartialEq)]
1956 1960 #[stable(feature = "process_exitcode", since = "1.61.0")]
1957 1961 pub struct ExitCode(imp::ExitCode);
1958 1962