From 2dd69aaafc64fe9dce74088b5371a6cfb032e01e Mon Sep 17 00:00:00 2001 From: Janik Rabe Date: Thu, 1 Jul 2021 22:15:13 +0100 Subject: [PATCH 01/18] Document iteration order of `retain` functions For `HashSet` and `HashMap`, this simply copies the comment from `BinaryHeap::retain`. For `BTreeSet` and `BTreeMap`, this adds an additional guarantee that wasn't previously documented. I think that because these data structures are inherently ordered and other functions guarantee ordered iteration, it makes sense to provide this guarantee for `retain` as well. --- library/alloc/src/collections/btree/map.rs | 1 + library/alloc/src/collections/btree/set.rs | 1 + library/std/src/collections/hash/map.rs | 1 + library/std/src/collections/hash/set.rs | 1 + 4 files changed, 4 insertions(+) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index d7519c6d0936c..70eae6419281b 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -936,6 +936,7 @@ impl BTreeMap { /// Retains only the elements specified by the predicate. /// /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`. + /// The elements are visited in ascending key order. /// /// # Examples /// diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 737932d931c02..9f4296e26b81d 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -847,6 +847,7 @@ impl BTreeSet { /// Retains only the elements specified by the predicate. /// /// In other words, remove all elements `e` such that `f(&e)` returns `false`. + /// The elements are visited in ascending order. /// /// # Examples /// diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index a1f52a9c2e880..241f33746d625 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -936,6 +936,7 @@ where /// Retains only the elements specified by the predicate. /// /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`. + /// The elements are visited in unsorted (and unspecified) order. /// /// # Examples /// diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 5220c8ad70977..372feff7fa026 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -914,6 +914,7 @@ where /// Retains only the elements specified by the predicate. /// /// In other words, remove all elements `e` such that `f(&e)` returns `false`. + /// The elements are visited in unsorted (and unspecified) order. /// /// # Examples /// From 803f79db48bcbf0df62616378c81eef1905050b8 Mon Sep 17 00:00:00 2001 From: inquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com> Date: Thu, 15 Jul 2021 16:44:56 -0700 Subject: [PATCH 02/18] Stabilize `into_parts()` and `into_error()` --- library/std/src/io/buffered/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/std/src/io/buffered/mod.rs b/library/std/src/io/buffered/mod.rs index 65497817f8160..38076ab3a2b7b 100644 --- a/library/std/src/io/buffered/mod.rs +++ b/library/std/src/io/buffered/mod.rs @@ -133,7 +133,6 @@ impl IntoInnerError { /// /// # Example /// ``` - /// #![feature(io_into_inner_error_parts)] /// use std::io::{BufWriter, ErrorKind, Write}; /// /// let mut not_enough_space = [0u8; 10]; @@ -143,7 +142,7 @@ impl IntoInnerError { /// let err = into_inner_err.into_error(); /// assert_eq!(err.kind(), ErrorKind::WriteZero); /// ``` - #[unstable(feature = "io_into_inner_error_parts", issue = "79704")] + #[stable(feature = "io_into_inner_error_parts", since = "1.55.0")] pub fn into_error(self) -> Error { self.1 } @@ -156,7 +155,6 @@ impl IntoInnerError { /// /// # Example /// ``` - /// #![feature(io_into_inner_error_parts)] /// use std::io::{BufWriter, ErrorKind, Write}; /// /// let mut not_enough_space = [0u8; 10]; @@ -167,7 +165,7 @@ impl IntoInnerError { /// assert_eq!(err.kind(), ErrorKind::WriteZero); /// assert_eq!(recovered_writer.buffer(), b"t be actually written"); /// ``` - #[unstable(feature = "io_into_inner_error_parts", issue = "79704")] + #[stable(feature = "io_into_inner_error_parts", since = "1.55.0")] pub fn into_parts(self) -> (Error, W) { (self.1, self.0) } From 3c384cee52e002244caaa0ef0288aadcb85be691 Mon Sep 17 00:00:00 2001 From: waterlens <82268070+waterlens@users.noreply.github.com> Date: Fri, 16 Jul 2021 17:56:51 +0800 Subject: [PATCH 03/18] Fix panics on Windows when the build was cancelled --- src/bootstrap/job.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/job.rs b/src/bootstrap/job.rs index 2fe9b06e42643..5c0322e18a4ab 100644 --- a/src/bootstrap/job.rs +++ b/src/bootstrap/job.rs @@ -103,12 +103,20 @@ pub unsafe fn setup(build: &mut Build) { }; let parent = OpenProcess(PROCESS_DUP_HANDLE, FALSE, pid.parse().unwrap()); - assert!( - !parent.is_null(), - "PID `{}` doesn't seem to exist: {}", - pid, - io::Error::last_os_error() - ); + + // If we get a null parent pointer here, it is possible that either + // we have got an invalid pid or the parent process has been closed. + // Since the first case rarely happens + // (only when wrongly setting the environmental variable), + // so it might be better to improve the experience of the second case + // when users have interrupted the parent process and we don't finish + // duplicating the handle yet. + // We just need close the job object if that occurs. + if parent.is_null() { + CloseHandle(job); + return; + } + let mut parent_handle = ptr::null_mut(); let r = DuplicateHandle( GetCurrentProcess(), From 15a2e4853b891c720047bb182081d869280f5c1d Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Mon, 12 Jul 2021 15:46:52 +0100 Subject: [PATCH 04/18] Package LLVM libs for the target rather than the build host --- src/bootstrap/dist.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 92853378e5881..c37763243c0a5 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1955,8 +1955,16 @@ fn maybe_install_llvm(builder: &Builder<'_>, target: TargetSelection, dst_libdir cmd.arg("--libfiles"); builder.verbose(&format!("running {:?}", cmd)); let files = output(&mut cmd); + let build_llvm_out = &builder.llvm_out(builder.config.build); + let target_llvm_out = &builder.llvm_out(target); for file in files.trim_end().split(' ') { - builder.install(Path::new(file), dst_libdir, 0o644); + // If we're not using a custom LLVM, make sure we package for the target. + let file = if let Ok(relative_path) = Path::new(file).strip_prefix(build_llvm_out) { + target_llvm_out.join(relative_path) + } else { + PathBuf::from(file) + }; + builder.install(&file, dst_libdir, 0o644); } !builder.config.dry_run } else { From 24254d693b0f4d55c57c3e9a7df4cb8795d2d9d2 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Wed, 14 Jul 2021 14:50:38 +0100 Subject: [PATCH 05/18] Fix download-ci-llvm help comment --- config.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml.example b/config.toml.example index 9a820f0803f0a..775133f2ab319 100644 --- a/config.toml.example +++ b/config.toml.example @@ -38,7 +38,7 @@ changelog-seen = 2 # This is false by default so that distributions don't unexpectedly download # LLVM from the internet. # -# All tier 1 targets are currently supported; set this to `"if-supported"` if +# All tier 1 targets are currently supported; set this to `"if-available"` if # you are not sure whether you're on a tier 1 target. # # We also currently only support this when building LLVM for the build triple. From 6cba79851adbc88f75e50b0eed456f74967ff19c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 18 Jul 2021 17:21:59 +0200 Subject: [PATCH 06/18] better support for running libcore and liballoc tests with Miri --- library/alloc/src/lib.rs | 4 ++++ library/core/src/lib.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index e8bd4bcb01f29..fa1f361a5b6d1 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -56,6 +56,10 @@ //! [`Rc`]: rc //! [`RefCell`]: core::cell +// To run liballoc tests without x.py without ending up with two copies of liballoc, Miri needs to be +// able to "empty" this crate. See . +// rustc itself never sets the feature, so this line has no affect there. +#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))] #![allow(unused_attributes)] #![stable(feature = "alloc", since = "1.36.0")] #![doc( diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 8bbce7e552c9b..23e022b741378 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -49,6 +49,10 @@ // // This cfg won't affect doc tests. #![cfg(not(test))] +// To run libcore tests without x.py without ending up with two copies of libcore, Miri needs to be +// able to "empty" this crate. See . +// rustc itself never sets the feature, so this line has no affect there. +#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))] #![stable(feature = "core", since = "1.6.0")] #![doc( html_playground_url = "https://play.rust-lang.org/", From 7df032738c9d9b9f5a9ea30aa66138e8548d4a3a Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Mon, 19 Jul 2021 07:24:07 +0200 Subject: [PATCH 07/18] add testcase for 87076 using https://github.com/rust-lang/rust/issues/87076#issuecomment-878090143 as testcase --- .../ui/const-generics/issues/issue-87076.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-87076.rs diff --git a/src/test/ui/const-generics/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs new file mode 100644 index 0000000000000..5dfda943bf69c --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-87076.rs @@ -0,0 +1,20 @@ +// build-pass + +#![feature(const_generics)] +#![allow(incomplete_features)] + +#[derive(PartialEq, Eq)] +pub struct UnitDims { + pub time: u8, + pub length: u8, +} + +pub struct UnitValue; + +impl UnitValue { + fn crash() {} +} + +fn main() { + UnitValue::<{ UnitDims { time: 1, length: 2 } }>::crash(); +} From 05217d5e70cb27067eda4e9a8d13f6bed081e240 Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Mon, 19 Jul 2021 07:25:27 +0200 Subject: [PATCH 08/18] move const-generic issues into seperate directory --- src/test/ui/const-generics/{ => issues}/auxiliary/impl-const.rs | 0 .../{ => issues}/issue-61522-array-len-succ.full.stderr | 0 .../{ => issues}/issue-61522-array-len-succ.min.stderr | 0 .../ui/const-generics/{ => issues}/issue-61522-array-len-succ.rs | 0 .../issue-66596-impl-trait-for-str-const-arg.min.stderr | 0 .../{ => issues}/issue-66596-impl-trait-for-str-const-arg.rs | 0 src/test/ui/const-generics/{ => issues}/issue-67375.full.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67375.min.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67375.rs | 0 src/test/ui/const-generics/{ => issues}/issue-67945-1.full.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-1.min.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-1.rs | 0 src/test/ui/const-generics/{ => issues}/issue-67945-2.full.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-2.min.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-2.rs | 0 src/test/ui/const-generics/{ => issues}/issue-67945-3.full.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-3.min.stderr | 0 src/test/ui/const-generics/{ => issues}/issue-67945-3.rs | 0 .../{ => issues}/issue-68104-print-stack-overflow.rs | 0 .../ui/const-generics/{ => issues}/issue-70180-1-stalled_on.rs | 0 .../ui/const-generics/{ => issues}/issue-70180-2-stalled_on.rs | 0 src/test/ui/const-generics/{ => issues}/issue-71202.rs | 0 src/test/ui/const-generics/{ => issues}/issue-71986.rs | 0 src/test/ui/const-generics/{ => issues}/issue-73899.rs | 0 src/test/ui/const-generics/{ => issues}/issue-74906.rs | 0 src/test/ui/const-generics/{ => issues}/issue-75763.rs | 0 .../issue-79518-default_trait_method_normalization.rs | 0 .../issue-79518-default_trait_method_normalization.stderr | 0 .../{ => issues}/issue-80561-incorrect-param-env.rs | 0 src/test/ui/const-generics/{ => issues}/issue-86820.rs | 0 src/test/ui/const-generics/{ => issues}/issue-86820.stderr | 0 31 files changed, 0 insertions(+), 0 deletions(-) rename src/test/ui/const-generics/{ => issues}/auxiliary/impl-const.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-61522-array-len-succ.full.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-61522-array-len-succ.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-61522-array-len-succ.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-66596-impl-trait-for-str-const-arg.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-66596-impl-trait-for-str-const-arg.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-67375.full.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67375.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67375.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-1.full.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-1.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-1.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-2.full.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-2.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-2.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-3.full.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-3.min.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-67945-3.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-68104-print-stack-overflow.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-70180-1-stalled_on.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-70180-2-stalled_on.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-71202.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-71986.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-73899.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-74906.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-75763.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-79518-default_trait_method_normalization.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-79518-default_trait_method_normalization.stderr (100%) rename src/test/ui/const-generics/{ => issues}/issue-80561-incorrect-param-env.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-86820.rs (100%) rename src/test/ui/const-generics/{ => issues}/issue-86820.stderr (100%) diff --git a/src/test/ui/const-generics/auxiliary/impl-const.rs b/src/test/ui/const-generics/issues/auxiliary/impl-const.rs similarity index 100% rename from src/test/ui/const-generics/auxiliary/impl-const.rs rename to src/test/ui/const-generics/issues/auxiliary/impl-const.rs diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.full.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr similarity index 100% rename from src/test/ui/const-generics/issue-61522-array-len-succ.full.stderr rename to src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr rename to src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.rs b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs similarity index 100% rename from src/test/ui/const-generics/issue-61522-array-len-succ.rs rename to src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs diff --git a/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr rename to src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr diff --git a/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs similarity index 100% rename from src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.rs rename to src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs diff --git a/src/test/ui/const-generics/issue-67375.full.stderr b/src/test/ui/const-generics/issues/issue-67375.full.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67375.full.stderr rename to src/test/ui/const-generics/issues/issue-67375.full.stderr diff --git a/src/test/ui/const-generics/issue-67375.min.stderr b/src/test/ui/const-generics/issues/issue-67375.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67375.min.stderr rename to src/test/ui/const-generics/issues/issue-67375.min.stderr diff --git a/src/test/ui/const-generics/issue-67375.rs b/src/test/ui/const-generics/issues/issue-67375.rs similarity index 100% rename from src/test/ui/const-generics/issue-67375.rs rename to src/test/ui/const-generics/issues/issue-67375.rs diff --git a/src/test/ui/const-generics/issue-67945-1.full.stderr b/src/test/ui/const-generics/issues/issue-67945-1.full.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-1.full.stderr rename to src/test/ui/const-generics/issues/issue-67945-1.full.stderr diff --git a/src/test/ui/const-generics/issue-67945-1.min.stderr b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-1.min.stderr rename to src/test/ui/const-generics/issues/issue-67945-1.min.stderr diff --git a/src/test/ui/const-generics/issue-67945-1.rs b/src/test/ui/const-generics/issues/issue-67945-1.rs similarity index 100% rename from src/test/ui/const-generics/issue-67945-1.rs rename to src/test/ui/const-generics/issues/issue-67945-1.rs diff --git a/src/test/ui/const-generics/issue-67945-2.full.stderr b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-2.full.stderr rename to src/test/ui/const-generics/issues/issue-67945-2.full.stderr diff --git a/src/test/ui/const-generics/issue-67945-2.min.stderr b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-2.min.stderr rename to src/test/ui/const-generics/issues/issue-67945-2.min.stderr diff --git a/src/test/ui/const-generics/issue-67945-2.rs b/src/test/ui/const-generics/issues/issue-67945-2.rs similarity index 100% rename from src/test/ui/const-generics/issue-67945-2.rs rename to src/test/ui/const-generics/issues/issue-67945-2.rs diff --git a/src/test/ui/const-generics/issue-67945-3.full.stderr b/src/test/ui/const-generics/issues/issue-67945-3.full.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-3.full.stderr rename to src/test/ui/const-generics/issues/issue-67945-3.full.stderr diff --git a/src/test/ui/const-generics/issue-67945-3.min.stderr b/src/test/ui/const-generics/issues/issue-67945-3.min.stderr similarity index 100% rename from src/test/ui/const-generics/issue-67945-3.min.stderr rename to src/test/ui/const-generics/issues/issue-67945-3.min.stderr diff --git a/src/test/ui/const-generics/issue-67945-3.rs b/src/test/ui/const-generics/issues/issue-67945-3.rs similarity index 100% rename from src/test/ui/const-generics/issue-67945-3.rs rename to src/test/ui/const-generics/issues/issue-67945-3.rs diff --git a/src/test/ui/const-generics/issue-68104-print-stack-overflow.rs b/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs similarity index 100% rename from src/test/ui/const-generics/issue-68104-print-stack-overflow.rs rename to src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs diff --git a/src/test/ui/const-generics/issue-70180-1-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs similarity index 100% rename from src/test/ui/const-generics/issue-70180-1-stalled_on.rs rename to src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs diff --git a/src/test/ui/const-generics/issue-70180-2-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs similarity index 100% rename from src/test/ui/const-generics/issue-70180-2-stalled_on.rs rename to src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs diff --git a/src/test/ui/const-generics/issue-71202.rs b/src/test/ui/const-generics/issues/issue-71202.rs similarity index 100% rename from src/test/ui/const-generics/issue-71202.rs rename to src/test/ui/const-generics/issues/issue-71202.rs diff --git a/src/test/ui/const-generics/issue-71986.rs b/src/test/ui/const-generics/issues/issue-71986.rs similarity index 100% rename from src/test/ui/const-generics/issue-71986.rs rename to src/test/ui/const-generics/issues/issue-71986.rs diff --git a/src/test/ui/const-generics/issue-73899.rs b/src/test/ui/const-generics/issues/issue-73899.rs similarity index 100% rename from src/test/ui/const-generics/issue-73899.rs rename to src/test/ui/const-generics/issues/issue-73899.rs diff --git a/src/test/ui/const-generics/issue-74906.rs b/src/test/ui/const-generics/issues/issue-74906.rs similarity index 100% rename from src/test/ui/const-generics/issue-74906.rs rename to src/test/ui/const-generics/issues/issue-74906.rs diff --git a/src/test/ui/const-generics/issue-75763.rs b/src/test/ui/const-generics/issues/issue-75763.rs similarity index 100% rename from src/test/ui/const-generics/issue-75763.rs rename to src/test/ui/const-generics/issues/issue-75763.rs diff --git a/src/test/ui/const-generics/issue-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs similarity index 100% rename from src/test/ui/const-generics/issue-79518-default_trait_method_normalization.rs rename to src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs diff --git a/src/test/ui/const-generics/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr similarity index 100% rename from src/test/ui/const-generics/issue-79518-default_trait_method_normalization.stderr rename to src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr diff --git a/src/test/ui/const-generics/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs similarity index 100% rename from src/test/ui/const-generics/issue-80561-incorrect-param-env.rs rename to src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs diff --git a/src/test/ui/const-generics/issue-86820.rs b/src/test/ui/const-generics/issues/issue-86820.rs similarity index 100% rename from src/test/ui/const-generics/issue-86820.rs rename to src/test/ui/const-generics/issues/issue-86820.rs diff --git a/src/test/ui/const-generics/issue-86820.stderr b/src/test/ui/const-generics/issues/issue-86820.stderr similarity index 100% rename from src/test/ui/const-generics/issue-86820.stderr rename to src/test/ui/const-generics/issues/issue-86820.stderr From f63c80556acdc819f4f2953fabb4760b2da02292 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Mon, 19 Jul 2021 16:48:12 +0200 Subject: [PATCH 09/18] add --codegen-backends=foo,bar ./configure flag Unfortunately this requires a proper ./configure flag, as the codegen backends config entry is a list, not a string (breaking --set). --- src/bootstrap/configure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 999882a1c04b0..8d9f169e6c50d 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -160,6 +160,7 @@ def v(*args): o("extended", "build.extended", "build an extended rust tool set") v("tools", None, "List of extended tools will be installed") +v("codegen-backends", None, "List of codegen backends to build") v("build", "build.build", "GNUs ./configure syntax LLVM build triple") v("host", None, "GNUs ./configure syntax LLVM host triples") v("target", None, "GNUs ./configure syntax LLVM target triples") @@ -339,6 +340,8 @@ def set(key, value): set('target.{}.llvm-filecheck'.format(build()), value) elif option.name == 'tools': set('build.tools', value.split(',')) + elif option.name == 'codegen-backends': + set('rust.codegen-backends', value.split(',')) elif option.name == 'host': set('build.host', value.split(',')) elif option.name == 'target': From a02756c14a587fe1834d4707240c0698bf7229b0 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 22 Jul 2021 02:01:42 +0000 Subject: [PATCH 10/18] Fix `--dry-run` when download-ci-llvm is set Previously it would error out: ``` $ x check --dry-run thread 'main' panicked at 'std::fs::read_to_string(ci_llvm.join("link-type.txt")) failed with No such file or directory (os error 2) ("CI llvm missing: /home/joshua/rustc3/build/tmp-dry-run/x86_64-unknown-linux-gnu/ci-llvm")', src/bootstrap/config.rs:795:33 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Build completed unsuccessfully in 0:00:10 ``` --- src/bootstrap/config.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 483816b98d689..1769899a6cd01 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -792,8 +792,16 @@ impl Config { // CI-built LLVM can be either dynamic or static. let ci_llvm = config.out.join(&*config.build.triple).join("ci-llvm"); - let link_type = t!(std::fs::read_to_string(ci_llvm.join("link-type.txt"))); - config.llvm_link_shared = link_type == "dynamic"; + config.llvm_link_shared = if config.dry_run { + // just assume dynamic for now + true + } else { + let link_type = t!( + std::fs::read_to_string(ci_llvm.join("link-type.txt")), + format!("CI llvm missing: {}", ci_llvm.display()) + ); + link_type == "dynamic" + }; } if config.llvm_thin_lto { From 6194cc8f485954b659c1f196b46fcb67fd73d455 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 22 Jul 2021 14:20:46 -0400 Subject: [PATCH 11/18] Don't default to `submodules = true` unless the rust repo has a .git directory --- src/bootstrap/config.rs | 11 ++++++++--- src/bootstrap/lib.rs | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 483816b98d689..b560de95e319f 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -13,6 +13,7 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use crate::cache::{Interned, INTERNER}; +use crate::channel::GitInfo; pub use crate::flags::Subcommand; use crate::flags::{Color, Flags}; use crate::util::exe; @@ -48,7 +49,7 @@ pub struct Config { /// Call Build::ninja() instead of this. pub ninja_in_file: bool, pub verbose: usize, - pub submodules: bool, + pub submodules: Option, pub fast_submodules: bool, pub compiler_docs: bool, pub docs_minification: bool, @@ -552,7 +553,7 @@ impl Config { config.backtrace = true; config.rust_optimize = true; config.rust_optimize_tests = true; - config.submodules = true; + config.submodules = None; config.fast_submodules = true; config.docs = true; config.docs_minification = true; @@ -658,11 +659,11 @@ impl Config { config.npm = build.npm.map(PathBuf::from); config.gdb = build.gdb.map(PathBuf::from); config.python = build.python.map(PathBuf::from); + config.submodules = build.submodules; set(&mut config.low_priority, build.low_priority); set(&mut config.compiler_docs, build.compiler_docs); set(&mut config.docs_minification, build.docs_minification); set(&mut config.docs, build.docs); - set(&mut config.submodules, build.submodules); set(&mut config.fast_submodules, build.fast_submodules); set(&mut config.locked_deps, build.locked_deps); set(&mut config.vendor, build.vendor); @@ -1075,6 +1076,10 @@ impl Config { pub fn llvm_enabled(&self) -> bool { self.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) } + + pub fn submodules(&self, rust_info: &GitInfo) -> bool { + self.submodules.unwrap_or(rust_info.is_git()) + } } fn set(field: &mut T, val: Option) { diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 6bcdbe3e4bbbb..245f3eada2af7 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -486,7 +486,7 @@ impl Build { t!(std::fs::read_dir(dir)).next().is_none() } - if !self.config.submodules { + if !self.config.submodules(&self.rust_info) { return; } @@ -562,7 +562,7 @@ impl Build { "library/stdarch", ]; // Avoid running git when there isn't a git checkout. - if !self.config.submodules { + if !self.config.submodules(&self.rust_info) { return; } let output = output( From 8837bf1acd2d0682c1030524fb328a073974112c Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Thu, 15 Jul 2021 20:04:14 +0100 Subject: [PATCH 12/18] Remove Option from BufWriter Fixes #72925 --- library/std/src/io/buffered/bufwriter.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs index ef2769d431fbb..c98244132befd 100644 --- a/library/std/src/io/buffered/bufwriter.rs +++ b/library/std/src/io/buffered/bufwriter.rs @@ -68,7 +68,7 @@ use crate::ptr; /// [`flush`]: BufWriter::flush #[stable(feature = "rust1", since = "1.0.0")] pub struct BufWriter { - inner: Option, + inner: W, // The buffer. Avoid using this like a normal `Vec` in common code paths. // That is, don't use `buf.push`, `buf.extend_from_slice`, or any other // methods that require bounds checking or the like. This makes an enormous @@ -112,7 +112,7 @@ impl BufWriter { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn with_capacity(capacity: usize, inner: W) -> BufWriter { - BufWriter { inner: Some(inner), buf: Vec::with_capacity(capacity), panicked: false } + BufWriter { inner, buf: Vec::with_capacity(capacity), panicked: false } } /// Send data in our local buffer into the inner writer, looping as @@ -161,10 +161,9 @@ impl BufWriter { } let mut guard = BufGuard::new(&mut self.buf); - let inner = self.inner.as_mut().unwrap(); while !guard.done() { self.panicked = true; - let r = inner.write(guard.remaining()); + let r = self.inner.write(guard.remaining()); self.panicked = false; match r { @@ -212,7 +211,7 @@ impl BufWriter { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn get_ref(&self) -> &W { - self.inner.as_ref().unwrap() + &self.inner } /// Gets a mutable reference to the underlying writer. @@ -232,7 +231,7 @@ impl BufWriter { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn get_mut(&mut self) -> &mut W { - self.inner.as_mut().unwrap() + &mut self.inner } /// Returns a reference to the internally buffered data. @@ -308,7 +307,7 @@ impl BufWriter { pub fn into_inner(mut self) -> Result>> { match self.flush_buf() { Err(e) => Err(IntoInnerError::new(self, e)), - Ok(()) => Ok(self.inner.take().unwrap()), + Ok(()) => Ok(self.into_raw_parts().0), } } @@ -339,7 +338,12 @@ impl BufWriter { pub fn into_raw_parts(mut self) -> (W, Result, WriterPanicked>) { let buf = mem::take(&mut self.buf); let buf = if !self.panicked { Ok(buf) } else { Err(WriterPanicked { buf }) }; - (self.inner.take().unwrap(), buf) + + // SAFETY: forget(self) prevents double dropping inner + let inner = unsafe { ptr::read(&mut self.inner) }; + mem::forget(self); + + (inner, buf) } // Ensure this function does not get inlined into `write`, so that it @@ -643,7 +647,7 @@ where { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("BufWriter") - .field("writer", &self.inner.as_ref().unwrap()) + .field("writer", &self.inner) .field("buffer", &format_args!("{}/{}", self.buf.len(), self.buf.capacity())) .finish() } @@ -663,7 +667,7 @@ impl Seek for BufWriter { #[stable(feature = "rust1", since = "1.0.0")] impl Drop for BufWriter { fn drop(&mut self) { - if self.inner.is_some() && !self.panicked { + if !self.panicked { // dtors should not panic, so we ignore a failed flush let _r = self.flush_buf(); } From 831ac196398c2dec18cdfb2299d465f64ec05223 Mon Sep 17 00:00:00 2001 From: chaz-kiker Date: Tue, 20 Jul 2021 15:04:32 -0500 Subject: [PATCH 13/18] Squash all commits. add test for issue 86507 add stderr for issue 86507 update issue-86507 UI test add comment for the expected error in UI test file add proper 'refers to ' in suggestion update diagnostic phrasing; update test to match new phrasing; re-organize logic for checking T: Sync evaluate additional obligation to figure out if T is Sync run './x.py test tidy --bless' incorporate changes from review; reorganize logic for readability --- .../src/traits/error_reporting/suggestions.rs | 35 ++++++++++++++++--- src/test/ui/async-await/issue-86507.rs | 25 +++++++++++++ src/test/ui/async-await/issue-86507.stderr | 23 ++++++++++++ 3 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 src/test/ui/async-await/issue-86507.rs create mode 100644 src/test/ui/async-await/issue-86507.stderr diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 1c6a83b578305..9a33875d6e493 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -1857,12 +1857,37 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { } } GeneratorInteriorOrUpvar::Upvar(upvar_span) => { + // `Some(ref_ty)` if `target_ty` is `&T` and `T` fails to impl `Sync` + let refers_to_non_sync = match target_ty.kind() { + ty::Ref(_, ref_ty, _) => match self.evaluate_obligation(&obligation) { + Ok(eval) if !eval.may_apply() => Some(ref_ty), + _ => None, + }, + _ => None, + }; + + let (span_label, span_note) = match refers_to_non_sync { + // if `target_ty` is `&T` and `T` fails to impl `Sync`, + // include suggestions to make `T: Sync` so that `&T: Send` + Some(ref_ty) => ( + format!( + "has type `{}` which {}, because `{}` is not `Sync`", + target_ty, trait_explanation, ref_ty + ), + format!( + "captured value {} because `&` references cannot be sent unless their referent is `Sync`", + trait_explanation + ), + ), + None => ( + format!("has type `{}` which {}", target_ty, trait_explanation), + format!("captured value {}", trait_explanation), + ), + }; + let mut span = MultiSpan::from_span(upvar_span); - span.push_span_label( - upvar_span, - format!("has type `{}` which {}", target_ty, trait_explanation), - ); - err.span_note(span, &format!("captured value {}", trait_explanation)); + span.push_span_label(upvar_span, span_label); + err.span_note(span, &span_note); } } diff --git a/src/test/ui/async-await/issue-86507.rs b/src/test/ui/async-await/issue-86507.rs new file mode 100644 index 0000000000000..317f0317664b6 --- /dev/null +++ b/src/test/ui/async-await/issue-86507.rs @@ -0,0 +1,25 @@ +// edition:2018 + +use ::core::pin::Pin; +use ::core::future::Future; +use ::core::marker::Send; + +trait Foo { + fn bar<'me, 'async_trait, T: Send>(x: &'me T) + -> Pin + Send + 'async_trait>> + where 'me: 'async_trait; +} + +impl Foo for () { + fn bar<'me, 'async_trait, T: Send>(x: &'me T) + -> Pin + Send + 'async_trait>> + where 'me:'async_trait { + Box::pin( //~ ERROR future cannot be sent between threads safely + async move { + let x = x; + } + ) + } +} + +fn main() { } diff --git a/src/test/ui/async-await/issue-86507.stderr b/src/test/ui/async-await/issue-86507.stderr new file mode 100644 index 0000000000000..51e8f61085b22 --- /dev/null +++ b/src/test/ui/async-await/issue-86507.stderr @@ -0,0 +1,23 @@ +error: future cannot be sent between threads safely + --> $DIR/issue-86507.rs:17:13 + | +LL | / Box::pin( +LL | | async move { +LL | | let x = x; +LL | | } +LL | | ) + | |_____________^ future created by async block is not `Send` + | +note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` + --> $DIR/issue-86507.rs:19:29 + | +LL | let x = x; + | ^ has type `&T` which is not `Send`, because `T` is not `Sync` + = note: required for the cast to the object type `dyn Future + Send` +help: consider further restricting type parameter `T` + | +LL | where 'me:'async_trait, T: std::marker::Sync { + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + From 327eef999e546a6329d1af51f1fc9fe14145f202 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 23 Jul 2021 11:41:21 +0200 Subject: [PATCH 14/18] Add test for fonts used for module items --- src/test/rustdoc-gui/module-items-font.goml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/test/rustdoc-gui/module-items-font.goml diff --git a/src/test/rustdoc-gui/module-items-font.goml b/src/test/rustdoc-gui/module-items-font.goml new file mode 100644 index 0000000000000..817b148bee1a6 --- /dev/null +++ b/src/test/rustdoc-gui/module-items-font.goml @@ -0,0 +1,4 @@ +// This test checks that the correct font is used on module items (in index.html pages). +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".item-table .module-item a", {"font-family": '"Fira Sans", Arial, sans-serif'}, ALL) +assert-css: (".item-table .docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}, ALL) From d71410757d1e44dbcfb83ad2cfe75d687c695b91 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 17 Jun 2021 16:59:00 -0300 Subject: [PATCH 15/18] Add VecMap::get_value_matching and assert if > 1 element Otherwise is a bug that we want to uncover. --- compiler/rustc_data_structures/src/vec_map.rs | 27 ++++++++++++++++--- compiler/rustc_typeck/src/collect/type_of.rs | 4 +-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs index e3fa587985df0..cc7ec9432faed 100644 --- a/compiler/rustc_data_structures/src/vec_map.rs +++ b/compiler/rustc_data_structures/src/vec_map.rs @@ -1,4 +1,5 @@ use std::borrow::Borrow; +use std::fmt::Debug; use std::iter::FromIterator; use std::slice::Iter; use std::vec::IntoIter; @@ -12,7 +13,8 @@ pub struct VecMap(Vec<(K, V)>); impl VecMap where - K: PartialEq, + K: Debug + PartialEq, + V: Debug, { pub fn new() -> Self { VecMap(Default::default()) @@ -37,14 +39,31 @@ where self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1) } - /// Returns the value corresponding to the supplied predicate filter. + /// Returns the any value corresponding to the supplied predicate filter. /// /// The supplied predicate will be applied to each (key, value) pair and it will return a /// reference to the values where the predicate returns `true`. - pub fn get_by(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> Option<&V> { + pub fn any_value_matching(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> Option<&V> { self.0.iter().find(|kv| predicate(kv)).map(|elem| &elem.1) } + /// Returns the value corresponding to the supplied predicate filter. It crashes if there's + /// more than one matching element. + /// + /// The supplied predicate will be applied to each (key, value) pair and it will return a + /// reference to the value where the predicate returns `true`. + pub fn get_value_matching(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> Option<&V> { + let mut filter = self.0.iter().filter(|kv| predicate(kv)); + let (_, value) = filter.next()?; + // This should return just one element, otherwise it's a bug + assert!( + filter.next().is_none(), + "Collection {:?} should have just one matching element", + self + ); + Some(value) + } + /// Returns `true` if the map contains a value for the specified key. /// /// The key may be any borrowed form of the map's key type, @@ -131,7 +150,7 @@ impl IntoIterator for VecMap { } } -impl Extend<(K, V)> for VecMap { +impl Extend<(K, V)> for VecMap { fn extend>(&mut self, iter: I) { for (k, v) in iter { self.insert(k, v); diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 15469cb0066c5..8029a7dc0e3dd 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -364,7 +364,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { let concrete_ty = tcx .mir_borrowck(owner.expect_local()) .concrete_opaque_types - .get_by(|(key, _)| key.def_id == def_id.to_def_id()) + .get_value_matching(|(key, _)| key.def_id == def_id.to_def_id()) .map(|concrete_ty| *concrete_ty) .unwrap_or_else(|| { tcx.sess.delay_span_bug( @@ -531,7 +531,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> { .tcx .typeck(def_id) .concrete_opaque_types - .get_by(|(key, _)| key.def_id == self.def_id) + .any_value_matching(|(key, _)| key.def_id == self.def_id) .is_none() { debug!("no constraints in typeck results"); From c79df8563b805732d6d04767a7d57384f57fcb0e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 22 Jul 2021 18:24:20 -0300 Subject: [PATCH 16/18] Add ConstraintLocator docs --- compiler/rustc_typeck/src/collect/type_of.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 8029a7dc0e3dd..50e4ba4fe6c3e 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -512,8 +512,15 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> { struct ConstraintLocator<'tcx> { tcx: TyCtxt<'tcx>, + + /// def_id of the opaque type whose defining uses are being checked def_id: DefId, - // (first found type span, actual type) + + /// as we walk the defining uses, we are checking that all of them + /// define the same hidden type. This variable is set to `Some` + /// with the first type that we find, and then later types are + /// checked against it (we also carry the span of that first + /// type). found: Option<(Span, Ty<'tcx>)>, } From 97721a1c3785a159371c7b064df5c06cffd1922e Mon Sep 17 00:00:00 2001 From: r00ster Date: Fri, 23 Jul 2021 19:02:52 +0200 Subject: [PATCH 17/18] Add missing article --- src/bootstrap/compile.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 77d2684b5d2a4..78c9a25262243 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -3,7 +3,7 @@ //! //! This module contains some of the real meat in the rustbuild build system //! which is where Cargo is used to compile the standard library, libtest, and -//! compiler. This module is also responsible for assembling the sysroot as it +//! the compiler. This module is also responsible for assembling the sysroot as it //! goes along from the output of the previous stage. use std::borrow::Cow; From a1518f091552afdf370c699a359af0b7d34e402d Mon Sep 17 00:00:00 2001 From: chaz-kiker Date: Fri, 23 Jul 2021 12:30:52 -0500 Subject: [PATCH 18/18] update clippy ui test 'future_not_send.stderr' to match the new diagnostic messages --- src/tools/clippy/tests/ui/future_not_send.stderr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/clippy/tests/ui/future_not_send.stderr b/src/tools/clippy/tests/ui/future_not_send.stderr index b59dbb3e76c64..c734051ccf320 100644 --- a/src/tools/clippy/tests/ui/future_not_send.stderr +++ b/src/tools/clippy/tests/ui/future_not_send.stderr @@ -55,11 +55,11 @@ note: captured value is not `Send` LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell) -> bool { | ^^ has type `std::rc::Rc<[u8]>` which is not `Send` = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` -note: captured value is not `Send` +note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` --> $DIR/future_not_send.rs:20:40 | LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell) -> bool { - | ^^^^ has type `&std::cell::Cell` which is not `Send` + | ^^^^ has type `&std::cell::Cell` which is not `Send`, because `std::cell::Cell` is not `Sync` = note: `std::cell::Cell` doesn't implement `std::marker::Sync` error: future cannot be sent between threads safely