Skip to content
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

add ice test for #97047 #98715

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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