forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#98820 - RalfJung:rollup-i3mip9a, r=RalfJung
Rollup of 6 pull requests Successful merges: - rust-lang#98701 (Add regression test for rust-lang#50439) - rust-lang#98715 (add ice test for rust-lang#97047) - rust-lang#98753 (Fix `x dist rust-dev` on a fresh checkout) - rust-lang#98805 (Add rust-lang#95469 to the release notes) - rust-lang#98812 (feat: Add a documentation problem issue template) - rust-lang#98819 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
10 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
23 changes: 23 additions & 0 deletions
23
src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|