Skip to content

Commit 8b27eff

Browse files
committed
Add regression test for ICE with TransmuteFrom and min_generic_const_args
Add a check-pass test that exercises TransmuteFrom with min_generic_const_args, which previously caused an ICE (expected ConstKind::Value).
1 parent fb27476 commit 8b27eff

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//! Ensure `TransmuteFrom` with `min_generic_const_args` doesn't ICE
2+
//! during well-formedness checking.
3+
//!
4+
//! Regression test for <https://github.com/rust-lang/rust/issues/150457>.
5+
6+
//@ check-pass (ICE was in wfcheck, not codegen)
7+
8+
#![feature(transmutability)]
9+
#![feature(min_generic_const_args)]
10+
11+
use std::mem::{Assume, TransmuteFrom};
12+
13+
struct W<'a>(&'a ());
14+
15+
fn test<'a>()
16+
where
17+
W<'a>: TransmuteFrom<
18+
(),
19+
{
20+
Assume {
21+
alignment: const { true },
22+
lifetimes: const { true },
23+
safety: const { true },
24+
validity: true,
25+
}
26+
},
27+
>,
28+
{
29+
}
30+
31+
fn main() {}

0 commit comments

Comments
 (0)