Skip to content

Commit ca722b9

Browse files
committed
Add test for rust-lang#56445
1 parent aeca4d6 commit ca722b9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/test/ui/impl-trait/issue-56445.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-629426939
2+
// check-pass
3+
4+
#![crate_type = "lib"]
5+
6+
use std::marker::PhantomData;
7+
8+
pub struct S<'a>
9+
{
10+
pub m1: PhantomData<&'a u8>,
11+
pub m2: [u8; S::size()],
12+
}
13+
14+
impl<'a> S<'a>
15+
{
16+
pub const fn size() -> usize { 1 }
17+
18+
pub fn new() -> Self
19+
{
20+
Self
21+
{
22+
m1: PhantomData,
23+
m2: [0; Self::size()],
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)