diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-05-25 22:29:06 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-05-27 00:48:37 +0900 |
| commit | ca722b935835f7ce3acfbb840141cc17941fc63b (patch) | |
| tree | 73a82e2c7d0effb587bd8b74748a0aad62a919ee | |
| parent | aeca4d6428c52cbf2c8d1f28657b0bdf92e4ea7c (diff) | |
| download | rust-ca722b935835f7ce3acfbb840141cc17941fc63b.tar.gz rust-ca722b935835f7ce3acfbb840141cc17941fc63b.zip | |
Add test for #56445
| -rw-r--r-- | src/test/ui/impl-trait/issue-56445.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/issue-56445.rs b/src/test/ui/impl-trait/issue-56445.rs new file mode 100644 index 00000000000..a34d7bae3a6 --- /dev/null +++ b/src/test/ui/impl-trait/issue-56445.rs @@ -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()], + } + } +} |
