From 9facb6c7ddcd63020b406746926bcee5dc288044 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Thu, 30 Jun 2022 13:43:29 +0900 Subject: [PATCH 1/6] add regression test for #50439 --- src/test/ui/consts/issue-50439.rs | 29 +++++++++++++++++++++++++++ src/test/ui/consts/issue-50439.stderr | 10 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/test/ui/consts/issue-50439.rs create mode 100644 src/test/ui/consts/issue-50439.stderr diff --git a/src/test/ui/consts/issue-50439.rs b/src/test/ui/consts/issue-50439.rs new file mode 100644 index 0000000000000..0be7c405473ca --- /dev/null +++ b/src/test/ui/consts/issue-50439.rs @@ -0,0 +1,29 @@ +#![feature(specialization)] +#![allow(incomplete_features)] + +pub trait ReflectDrop { + const REFLECT_DROP: bool = false; +} + +impl ReflectDrop for T where T: Clone {} + +pub trait PinDropInternal { + fn is_valid() + where + Self: ReflectDrop; +} + +struct Bears(T); + +default impl ReflectDrop for Bears {} + +impl PinDropInternal for Bears { + fn is_valid() + where + Self: ReflectDrop, + { + let _ = [(); 0 - !!( as ReflectDrop>::REFLECT_DROP) as usize]; //~ ERROR constant expression depends on a generic parameter + } +} + +fn main() {} diff --git a/src/test/ui/consts/issue-50439.stderr b/src/test/ui/consts/issue-50439.stderr new file mode 100644 index 0000000000000..3fbdf33b2d881 --- /dev/null +++ b/src/test/ui/consts/issue-50439.stderr @@ -0,0 +1,10 @@ +error: constant expression depends on a generic parameter + --> $DIR/issue-50439.rs:25:22 + | +LL | let _ = [(); 0 - !!( as ReflectDrop>::REFLECT_DROP) as usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +error: aborting due to previous error + From d067cb4105e7f135b00698c3350e9eb44eb61e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 30 Jun 2022 16:42:39 +0200 Subject: [PATCH 2/6] add ice test for #97047 Fixes #97047 --- .../generic_const_exprs/issue-97047-ice-1.rs | 25 +++++++++++++++++++ .../issue-97047-ice-1.stderr | 19 ++++++++++++++ .../generic_const_exprs/issue-97047-ice-2.rs | 23 +++++++++++++++++ .../issue-97047-ice-2.stderr | 19 ++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs new file mode 100644 index 0000000000000..67e30232e2fbb --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs @@ -0,0 +1,25 @@ +// check-pass + +#![feature(adt_const_params, generic_const_exprs)] +//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] +//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] + +pub struct Changes +where + [(); CHANGES.len()]:, +{ + changes: [usize; CHANGES.len()], +} + +impl Changes +where + [(); CHANGES.len()]:, +{ + pub const fn new() -> Self { + Self { + changes: [0; CHANGES.len()], + } + } +} + +pub fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr new file mode 100644 index 0000000000000..b5b2b0e405a26 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr @@ -0,0 +1,19 @@ +warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-97047-ice-1.rs:3:12 + | +LL | #![feature(adt_const_params, generic_const_exprs)] + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #95174 for more information + +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-97047-ice-1.rs:3:30 + | +LL | #![feature(adt_const_params, generic_const_exprs)] + | ^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #76560 for more information + +warning: 2 warnings emitted + diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs new file mode 100644 index 0000000000000..00568a0894465 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs @@ -0,0 +1,23 @@ +// check-pass + +#![feature(adt_const_params, generic_const_exprs)] +//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] +//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] + +pub struct Changes +where + [(); CHANGES.len()]:, +{ + changes: [usize; CHANGES.len()], +} + +impl Changes +where + [(); CHANGES.len()]:, +{ + pub fn combine(&mut self, other: &Self) { + for _change in &self.changes {} + } +} + +pub fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr new file mode 100644 index 0000000000000..5dfbd87ccd480 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr @@ -0,0 +1,19 @@ +warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-97047-ice-2.rs:3:12 + | +LL | #![feature(adt_const_params, generic_const_exprs)] + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #95174 for more information + +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-97047-ice-2.rs:3:30 + | +LL | #![feature(adt_const_params, generic_const_exprs)] + | ^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #76560 for more information + +warning: 2 warnings emitted + From cec6933d0dd553322dcd5978fb418cb08347a868 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 30 Jun 2022 23:05:45 -0500 Subject: [PATCH 3/6] Fix `x dist rust-dev` on a fresh checkout Previously, it required you to manually run `x build` first, because it assumed the LLVM binaries were already present. --- src/bootstrap/dist.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 8182d2bf8fb3b..ae0ac37de1de5 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -2031,6 +2031,8 @@ impl Step for RustDev { let mut tarball = Tarball::new(builder, "rust-dev", &target.triple); tarball.set_overlay(OverlayKind::LLVM); + builder.ensure(crate::native::Llvm { target }); + let src_bindir = builder.llvm_out(target).join("bin"); // If updating this list, you likely want to change // src/bootstrap/download-ci-llvm-stamp as well, otherwise local users From ee3e5182912829ce3f447244161a28dd74f29491 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 2 Jul 2022 08:51:27 +0100 Subject: [PATCH 4/6] Add #95469 to the release notes --- RELEASES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index ea6ae46b0edb7..8154eab20599a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -78,6 +78,8 @@ Compatibility Notes - [rustdoc: doctests are now run on unexported `macro_rules!` macros, matching other private items][96630] - [rustdoc: Remove .woff font files][96279] - [Enforce Copy bounds for repeat elements while considering lifetimes][95819] +- [Windows: Fix potentinal unsoundness by aborting if `File` reads or writes cannot + complete synchronously][95469]. Internal Changes ---------------- @@ -99,6 +101,7 @@ and related tools. [95372]: https://github.com/rust-lang/rust/pull/95372/ [95380]: https://github.com/rust-lang/rust/pull/95380/ [95431]: https://github.com/rust-lang/rust/pull/95431/ +[95469]: https://github.com/rust-lang/rust/pull/95469/ [95705]: https://github.com/rust-lang/rust/pull/95705/ [95801]: https://github.com/rust-lang/rust/pull/95801/ [95819]: https://github.com/rust-lang/rust/pull/95819/ From de9b1da22a6fb021e4fb69667c6e049d9dc83606 Mon Sep 17 00:00:00 2001 From: Gimgim <93856041+gimbles@users.noreply.github.com> Date: Sat, 2 Jul 2022 20:39:20 +0530 Subject: [PATCH 5/6] feat: Add a documentation problem issue template --- .github/ISSUE_TEMPLATE/documentation.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/documentation.md diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000000000..1d93939e23360 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,16 @@ +--- +name: Documentation problem +about: Create a report for a documentation problem. +labels: A-docs +--- + + +### Location + +### Summary + From 8e26f43f830585238bef8e2834f8b578291ae135 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 2 Jul 2022 15:15:56 -0400 Subject: [PATCH 6/6] update Miri --- src/tools/miri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri b/src/tools/miri index ff62c3ac98eb8..f76ebd6feb9f5 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit ff62c3ac98eb85816190afa1c1ec5d0ad2e44235 +Subproject commit f76ebd6feb9f59be993336f84ecfdc441ad33d81