Skip to content

Commit 745fe6a

Browse files
committed
Add regression test for ICE in mono item collection
Add a build-pass test that 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 745fe6a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)