From 63bb51d3ac3ec015d914e2b0792b4d5aa6e8e4a5 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Mon, 28 Sep 2020 22:48:07 -0400 Subject: Add unstable book docs for `-Zunsound-mir-opts` --- src/doc/unstable-book/src/compiler-flags/unsound-mir-opts.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/doc/unstable-book/src/compiler-flags/unsound-mir-opts.md (limited to 'src') diff --git a/src/doc/unstable-book/src/compiler-flags/unsound-mir-opts.md b/src/doc/unstable-book/src/compiler-flags/unsound-mir-opts.md new file mode 100644 index 00000000000..8e46e227c25 --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/unsound-mir-opts.md @@ -0,0 +1,8 @@ +# `unsound-mir-opts` + +-------------------- + +The `-Zunsound-mir-opts` compiler flag enables [MIR optimization passes] which can cause unsound behavior. +This flag should only be used by MIR optimization tests in the rustc test suite. + +[MIR optimization passes]: https://rustc-dev-guide.rust-lang.org/mir/optimizations.html -- cgit 1.4.1-3-g733a5 From 9340ee4380dcc9b81e0afb1ef5518730b064a78a Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 28 Sep 2020 00:06:58 +0300 Subject: Ensure that all LLVM components requested by tests are available on CI --- src/ci/run.sh | 2 ++ src/tools/compiletest/src/header.rs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ci/run.sh b/src/ci/run.sh index 5231aa2e766..181a7fcb732 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -104,6 +104,8 @@ if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ] RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools" fi +export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1 + # Print the date from the local machine and the date from an external source to # check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure # Pipelines it happened that the certificates were marked as expired. diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 17649dfab37..59f64e7df0f 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -208,10 +208,13 @@ impl EarlyProps { config.parse_name_value_directive(line, "needs-llvm-components") { let components: HashSet<_> = config.llvm_components.split_whitespace().collect(); - if !needed_components + if let Some(missing_component) = needed_components .split_whitespace() - .all(|needed_component| components.contains(needed_component)) + .find(|needed_component| !components.contains(needed_component)) { + if env::var_os("COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS").is_some() { + panic!("missing LLVM component: {}", missing_component); + } return true; } } -- cgit 1.4.1-3-g733a5 From 2c385040550fb1eb98cf14ace99129f05b1d7b3f Mon Sep 17 00:00:00 2001 From: Hameer Abbasi Date: Tue, 29 Sep 2020 13:18:29 +0200 Subject: Add test for async/await combined with const-generics. --- src/test/ui/const-generics/issue-74906.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/ui/const-generics/issue-74906.rs (limited to 'src') diff --git a/src/test/ui/const-generics/issue-74906.rs b/src/test/ui/const-generics/issue-74906.rs new file mode 100644 index 00000000000..9162d1142b6 --- /dev/null +++ b/src/test/ui/const-generics/issue-74906.rs @@ -0,0 +1,25 @@ +// edition:2018 +// check-pass +// revisions: full min +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(min, feature(min_const_generics))] + +const SIZE: usize = 16; + +struct Bar {} + +struct Foo {} + +impl Foo { + async fn biz(_: &[[u8; SIZE]]) -> Vec<()> { + vec![] + } + + pub async fn baz(&self) -> Bar { + Self::biz(&vec![]).await; + Bar {} + } +} + +fn main() { } -- cgit 1.4.1-3-g733a5 From f4d5275cbb87637daba704251c043d2b303e36d6 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 29 Sep 2020 15:36:08 -0700 Subject: Update books --- src/doc/embedded-book | 2 +- src/doc/rust-by-example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/doc/embedded-book b/src/doc/embedded-book index 0cd2ca11627..dd310616308 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit 0cd2ca116274b915924c3a7e07c1e046b6f19b77 +Subproject commit dd310616308e01f6cf227f46347b744aa56b77d9 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 19f0a0372af..7d3ff1c12db 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 19f0a0372af497b34369cf182d9d16156cab2969 +Subproject commit 7d3ff1c12db08a847a57a054be4a7951ce532d2d -- cgit 1.4.1-3-g733a5 From 607d30dcfa8c40b91d0073a18c5897eee00a4cda Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Tue, 29 Sep 2020 19:46:01 +0000 Subject: Add test for issue #74761 --- src/test/ui/type-alias-impl-trait/issue-74761.rs | 16 ++++++++++++++++ src/test/ui/type-alias-impl-trait/issue-74761.stderr | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/test/ui/type-alias-impl-trait/issue-74761.rs create mode 100644 src/test/ui/type-alias-impl-trait/issue-74761.stderr (limited to 'src') diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.rs b/src/test/ui/type-alias-impl-trait/issue-74761.rs new file mode 100644 index 00000000000..4345b5d886e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74761.rs @@ -0,0 +1,16 @@ +#![feature(member_constraints)] +#![feature(type_alias_impl_trait)] + +pub trait A { + type B; + fn f(&self) -> Self::B; +} +impl<'a, 'b> A for () { + //~^ ERROR the lifetime parameter `'a` is not constrained + //~| ERROR the lifetime parameter `'b` is not constrained + type B = impl core::fmt::Debug; + + fn f(&self) -> Self::B {} +} + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.stderr new file mode 100644 index 00000000000..3f38fa4de01 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74761.stderr @@ -0,0 +1,15 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:8:6 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:8:10 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0207`. -- cgit 1.4.1-3-g733a5