diff options
| author | bors <bors@rust-lang.org> | 2020-02-29 10:43:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-29 10:43:32 +0000 |
| commit | 3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e (patch) | |
| tree | f832b09e3ffce6a55b209ef234a99c06742d18eb /src/libstd | |
| parent | 04e7f96dd89b1f0ad615dff1c85d11d4c4c64cb4 (diff) | |
| parent | bbfec7ca41887af04abb4510677c4539a95f03a2 (diff) | |
| download | rust-3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e.tar.gz rust-3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e.zip | |
Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #69477 (docs: add mention of async blocks in move keyword docs) - #69504 (Use assert_ne in hash tests) - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.) - #69551 (use is_empty() instead of len() == x to determine if structs are empty.) - #69563 (Fix no_std detection for target triples) - #69567 (use .to_string() instead of format!() macro to create strings) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/backtrace.rs | 2 | ||||
| -rw-r--r-- | src/libstd/keyword_docs.rs | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/libstd/backtrace.rs b/src/libstd/backtrace.rs index a1c9aa75d77..97db0ff3791 100644 --- a/src/libstd/backtrace.rs +++ b/src/libstd/backtrace.rs @@ -304,7 +304,7 @@ impl Backtrace { // If no frames came out assume that this is an unsupported platform // since `backtrace` doesn't provide a way of learning this right now, // and this should be a good enough approximation. - let inner = if frames.len() == 0 { + let inner = if frames.is_empty() { Inner::Unsupported } else { Inner::Captured(Mutex::new(Capture { diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 58f4e76cd30..3c69c1160d5 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -895,6 +895,15 @@ mod mod_keyword {} /// // x is no longer available /// ``` /// +/// `move` is also valid before an async block. +/// +/// ```rust +/// let capture = "hello"; +/// let block = async move { +/// println!("rust says {} from async block", capture); +/// }; +/// ``` +/// /// For more information on the `move` keyword, see the [closure]'s section /// of the Rust book or the [threads] section /// |
