Skip to content

Commit

Permalink
Add test for rust-lang#56445
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 26, 2020
1 parent aeca4d6 commit ca722b9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/ui/impl-trait/issue-56445.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-629426939
// check-pass

#![crate_type = "lib"]

use std::marker::PhantomData;

pub struct S<'a>
{
pub m1: PhantomData<&'a u8>,
pub m2: [u8; S::size()],
}

impl<'a> S<'a>
{
pub const fn size() -> usize { 1 }

pub fn new() -> Self
{
Self
{
m1: PhantomData,
m2: [0; Self::size()],
}
}
}

0 comments on commit ca722b9

Please sign in to comment.