]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issue-56445.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / ui / impl-trait / issue-56445.rs
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     pub m1: PhantomData<&'a u8>,
10     pub m2: [u8; S::size()],
11 }
12
13 impl<'a> S<'a>
14 {
15     pub const fn size() -> usize { 1 }
16
17     pub fn new() -> Self
18     {
19         Self
20         {
21             m1: PhantomData,
22             m2: [0; Self::size()],
23         }
24     }
25 }