diff options
| author | bors <bors@rust-lang.org> | 2022-10-14 22:56:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-14 22:56:53 +0000 |
| commit | 8147e6e427a1b3c4aedcd9fd85bd457888f80972 (patch) | |
| tree | a52cac2a5c92bedd81aff8169141a4ef382bdabd /library/std/src | |
| parent | bf15a9e5263fcea065a7ae9c179b2d24c2deb670 (diff) | |
| parent | a96f1a8a1eef38f024d6fcff932f55a2a760a395 (diff) | |
| download | rust-8147e6e427a1b3c4aedcd9fd85bd457888f80972.tar.gz rust-8147e6e427a1b3c4aedcd9fd85bd457888f80972.zip | |
Auto merge of #103069 - matthiaskrgr:rollup-xxsx6sk, r=matthiaskrgr
Rollup of 9 pull requests
Successful merges:
- #102092 (refactor: use grep -E/-F instead of fgrep/egrep)
- #102781 (Improved documentation for `std::io::Error`)
- #103017 (Avoid dropping TLS Key on sgx)
- #103039 (checktools: fix comments)
- #103045 (Remove leading newlines from integer primitive doc examples)
- #103047 (Update browser-ui-test version to fix some flaky tests)
- #103054 (Clean up rust-logo rustdoc GUI test)
- #103059 (Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)`)
- #103067 (More alphabetical sorting)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/io/error.rs | 6 | ||||
| -rw-r--r-- | library/std/src/sys/sgx/abi/tls/mod.rs | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index feb3fb989a7..3cabf24492e 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -387,7 +387,7 @@ pub enum ErrorKind { impl ErrorKind { pub(crate) fn as_str(&self) -> &'static str { use ErrorKind::*; - // Strictly alphabetical, please. (Sadly rustfmt cannot do this yet.) + // tidy-alphabetical-start match *self { AddrInUse => "address in use", AddrNotAvailable => "address not available", @@ -431,6 +431,7 @@ impl ErrorKind { WouldBlock => "operation would block", WriteZero => "write zero", } + // tidy-alphabetical-end } } @@ -481,6 +482,7 @@ impl Error { /// originate from the OS itself. The `error` argument is an arbitrary /// payload which will be contained in this [`Error`]. /// + /// Note that this function allocates memory on the heap. /// If no extra payload is required, use the `From` conversion from /// `ErrorKind`. /// @@ -495,7 +497,7 @@ impl Error { /// // errors can also be created from other errors /// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error); /// - /// // creating an error without payload + /// // creating an error without payload (and without memory allocation) /// let eof_error = Error::from(ErrorKind::UnexpectedEof); /// ``` #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/std/src/sys/sgx/abi/tls/mod.rs b/library/std/src/sys/sgx/abi/tls/mod.rs index 13d96e9a633..09c4ab3d3e9 100644 --- a/library/std/src/sys/sgx/abi/tls/mod.rs +++ b/library/std/src/sys/sgx/abi/tls/mod.rs @@ -111,6 +111,7 @@ impl Tls { rtabort!("TLS limit exceeded") }; TLS_DESTRUCTOR[index].store(dtor.map_or(0, |f| f as usize), Ordering::Relaxed); + unsafe { Self::current() }.data[index].set(ptr::null_mut()); Key::from_index(index) } |
