From 5d855c455111049bc335e7c57618e4e57fe86548 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Sat, 18 Apr 2020 17:01:44 +0100 Subject: [PATCH 1/5] Add regression test for #69654 --- .../ui/const-generics/issues/issue-69654.rs | 18 ++++++++++++++++++ .../const-generics/issues/issue-69654.stderr | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-69654.rs create mode 100644 src/test/ui/const-generics/issues/issue-69654.stderr diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs new file mode 100644 index 0000000000000..2befbe56d85c7 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.rs @@ -0,0 +1,18 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait Bar {} +impl Bar for [u8; O] {} +//~^ ERROR expected value, found type parameter `O` + +struct Foo {} +impl Foo +where + [u8; O]: Bar<[(); O]>, +{ + fn foo() {} +} + +fn main() { + Foo::foo(); +} diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/issues/issue-69654.stderr new file mode 100644 index 0000000000000..9d52603f462be --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.stderr @@ -0,0 +1,14 @@ +error[E0423]: expected value, found type parameter `O` + --> $DIR/issue-69654.rs:5:25 + | +LL | impl Bar for [u8; O] {} + | ^ help: a tuple variant with a similar name exists: `Ok` + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), + | --------------------------------------------------- similarly named tuple variant `Ok` defined here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0423`. From 3a40cbb665495400daf9052c836aa54732f632aa Mon Sep 17 00:00:00 2001 From: Nathan Abel Date: Sat, 18 Apr 2020 14:30:16 -0400 Subject: [PATCH 2/5] Change wording on read_vectored docs --- src/libstd/io/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 5ab88260d6ac1..9d83927653711 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -570,8 +570,9 @@ pub trait Read { /// Like `read`, except that it reads into a slice of buffers. /// /// Data is copied to fill each buffer in order, with the final buffer - /// written to possibly being only partially filled. This method must behave - /// as a single call to `read` with the buffers concatenated would. + /// written to possibly being only partially filled. This method must + /// behave equivalently to a single call to `read` with concatenated + /// buffers. /// /// The default implementation calls `read` with either the first nonempty /// buffer provided, or an empty one if none exists. From db1fbd4a11db579436f68be3a8f5fe03484aa45d Mon Sep 17 00:00:00 2001 From: Mohsen Zohrevandi Date: Wed, 25 Mar 2020 19:28:14 -0700 Subject: [PATCH 3/5] Process termination tests Related issues: - https://github.com/fortanix/rust-sgx/issues/109 --- .../process-termination-blocking-io.rs | 18 ++++++++++++++++++ .../process-termination-simple.rs | 12 ++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/test/ui/process-termination/process-termination-blocking-io.rs create mode 100644 src/test/ui/process-termination/process-termination-simple.rs diff --git a/src/test/ui/process-termination/process-termination-blocking-io.rs b/src/test/ui/process-termination/process-termination-blocking-io.rs new file mode 100644 index 0000000000000..d9027fc89e299 --- /dev/null +++ b/src/test/ui/process-termination/process-termination-blocking-io.rs @@ -0,0 +1,18 @@ +// program should terminate even if a thread is blocked on I/O. +// https://github.com/fortanix/rust-sgx/issues/109 + +// run-pass + +use std::{net::TcpListener, sync::mpsc, thread}; + +fn main() { + let (tx, rx) = mpsc::channel(); + thread::spawn(move || { + let listen = TcpListener::bind("0:0").unwrap(); + tx.send(()).unwrap(); + while let Ok(_) = listen.accept() {} + }); + rx.recv().unwrap(); + for _ in 0..3 { thread::yield_now(); } + println!("Exiting main thread"); +} diff --git a/src/test/ui/process-termination/process-termination-simple.rs b/src/test/ui/process-termination/process-termination-simple.rs new file mode 100644 index 0000000000000..7098a34512ee3 --- /dev/null +++ b/src/test/ui/process-termination/process-termination-simple.rs @@ -0,0 +1,12 @@ +// program should terminate when std::process::exit is called from any thread + +// run-pass + +use std::{process, thread}; + +fn main() { + let h = thread::spawn(|| { + process::exit(0); + }); + let _ = h.join(); +} From 5a5fa39909f0793790c9365bd6a1c81347a0f8cf Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 25 Apr 2020 19:14:58 -0400 Subject: [PATCH 4/5] Handle build completion message from Cargo This was introduced in the recent bump to 1.43 bootstrap cargo --- src/bootstrap/compile.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 06ab0a9c310af..2ad2b1a5a4106 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -1012,4 +1012,7 @@ pub enum CargoMessage<'a> { BuildScriptExecuted { package_id: Cow<'a, str>, }, + BuildFinished { + success: bool, + }, } From 4b762ec95ae42a30c419396d87660afbebc80ee8 Mon Sep 17 00:00:00 2001 From: Zach Reizner Date: Mon, 27 Apr 2020 15:51:51 -0700 Subject: [PATCH 5/5] Update link to unstable book for llvm_asm macro --- src/libcore/macros/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/macros/mod.rs b/src/libcore/macros/mod.rs index 85d848f54fbb7..18d5eaa964849 100644 --- a/src/libcore/macros/mod.rs +++ b/src/libcore/macros/mod.rs @@ -1316,7 +1316,7 @@ pub(crate) mod builtin { /// /// Read the [unstable book] for the usage. /// - /// [unstable book]: ../unstable-book/library-features/asm.html + /// [unstable book]: ../unstable-book/library-features/llvm-asm.html #[unstable( feature = "llvm_asm", issue = "70173",