]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/issue-76248.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / mir / issue-76248.rs
1 // This used to ICE during codegen after MIR inlining of g into f.
2 // The root cause was a missing fold of length constant in Rvalue::Repeat.
3 // Regression test for #76248.
4 //
5 // build-pass
6 // compile-flags: -Zmir-opt-level=3
7
8 const N: usize = 1;
9
10 pub struct Elem<M> {
11     pub x: [usize; N],
12     pub m: M,
13 }
14
15 pub fn f() -> Elem<()> {
16     g(())
17 }
18
19 #[inline]
20 pub fn g<M>(m: M) -> Elem<M> {
21     Elem {
22         x: [0; N],
23         m,
24     }
25 }
26
27 pub fn main() {
28     f();
29 }