Skip to content

Commit 7ce50f8

Browse files
committed
Add test for soundness issue on new solver
1 parent 656a9da commit 7ce50f8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//! Regression test for <https://github.com/rust-lang/trait-system-refactor-initiative/issues/296>.
2+
//@ compile-flags: -Znext-solver=globally
3+
//@ check-pass
4+
5+
// CHECK PASS TO SHOW IT PASSES, BUT IT SHOULD NOT
6+
// THIS CODE SEGFAULTS, WITH REASON
7+
8+
fn foo<const M: u32>() -> Box<dyn Tr<M>> {
9+
loop {}
10+
}
11+
12+
trait Tr<const N: usize> {}
13+
14+
fn main() {}

0 commit comments

Comments
 (0)