Skip to content

Rollup of 6 pull requests #98820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 2, 2022
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Documentation problem
about: Create a report for a documentation problem.
labels: A-docs
---
<!--
Thank you for finding a documentation problem! 📚

Documentation problems might be grammatical issues, typos, or unclear wording, please provide details regarding the documentation including where it is present.

-->

### Location

### Summary

3 changes: 3 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------
Expand All @@ -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/
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<const CHANGES: &'static [&'static str]>
where
[(); CHANGES.len()]:,
{
changes: [usize; CHANGES.len()],
}

impl<const CHANGES: &'static [&'static str]> Changes<CHANGES>
where
[(); CHANGES.len()]:,
{
pub const fn new() -> Self {
Self {
changes: [0; CHANGES.len()],
}
}
}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/76560> for more information

warning: 2 warnings emitted

Original file line number Diff line number Diff line change
@@ -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<const CHANGES: &'static [&'static str]>
where
[(); CHANGES.len()]:,
{
changes: [usize; CHANGES.len()],
}

impl<const CHANGES: &'static [&'static str]> Changes<CHANGES>
where
[(); CHANGES.len()]:,
{
pub fn combine(&mut self, other: &Self) {
for _change in &self.changes {}
}
}

pub fn main() {}
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/76560> for more information

warning: 2 warnings emitted

29 changes: 29 additions & 0 deletions src/test/ui/consts/issue-50439.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#![feature(specialization)]
#![allow(incomplete_features)]

pub trait ReflectDrop {
const REFLECT_DROP: bool = false;
}

impl<T> ReflectDrop for T where T: Clone {}

pub trait PinDropInternal {
fn is_valid()
where
Self: ReflectDrop;
}

struct Bears<T>(T);

default impl<T> ReflectDrop for Bears<T> {}

impl<T: Sized> PinDropInternal for Bears<T> {
fn is_valid()
where
Self: ReflectDrop,
{
let _ = [(); 0 - !!(<Bears<T> as ReflectDrop>::REFLECT_DROP) as usize]; //~ ERROR constant expression depends on a generic parameter
}
}

fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/consts/issue-50439.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: constant expression depends on a generic parameter
--> $DIR/issue-50439.rs:25:22
|
LL | let _ = [(); 0 - !!(<Bears<T> as ReflectDrop>::REFLECT_DROP) as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this may fail depending on what value the parameter takes

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/tools/miri
Submodule miri updated 381 files