Skip to content

Commit 68ea4d5

Browse files
committed
Add regression test for mono item collection ICE with generic_const_exprs
Exercises -Clink-dead-code=true with generic_const_exprs and min_generic_const_args, which previously caused an ICE in mono item collection.
1 parent fb27476 commit 68ea4d5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! Ensure `-Clink-dead-code=true` with `generic_const_exprs` and
2+
//! `min_generic_const_args` doesn't ICE in mono item collection.
3+
//!
4+
//! Regression test for <https://github.com/rust-lang/rust/issues/149035>.
5+
6+
//@ build-pass
7+
//@ compile-flags: -Clink-dead-code=true
8+
9+
#![feature(min_generic_const_args, generic_const_exprs)]
10+
11+
type const L: usize = 4;
12+
trait Print<const N: usize> {
13+
fn print() -> usize {
14+
N
15+
}
16+
}
17+
struct Printer;
18+
impl Print<L> for Printer {}
19+
20+
fn main() {}

0 commit comments

Comments
 (0)