Skip to content

Commit

Permalink
Add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yanok committed Oct 28, 2021
1 parent 6f942a2 commit 9a0a622
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/traits/issue-90195-2.rs
@@ -0,0 +1,20 @@
// check-pass
pub trait Archive {
type Archived;
}

impl<T> Archive for Option<T> {
type Archived = ();
}
pub type Archived<T> = <T as Archive>::Archived;

pub trait Deserialize<D> {}

const ARRAY_SIZE: usize = 32;
impl<__D> Deserialize<__D> for ()
where
Option<[u8; ARRAY_SIZE]>: Archive,
Archived<Option<[u8; ARRAY_SIZE]>>: Deserialize<__D>,
{
}
fn main() {}
21 changes: 21 additions & 0 deletions src/test/ui/traits/issue-90195.rs
@@ -0,0 +1,21 @@
// check-pass
pub trait Archive {
type Archived;
}

impl<T> Archive for Option<T> {
type Archived = ();
}
pub type Archived<T> = <T as Archive>::Archived;

pub trait Deserialize<D> {}

const ARRAY_SIZE: usize = 32;
impl<__D> Deserialize<__D> for ()
where
Option<[u8; ARRAY_SIZE]>: Archive,
Option<[u8; ARRAY_SIZE]>: Archive,
Archived<Option<[u8; ARRAY_SIZE]>>: Deserialize<__D>,
{
}
fn main() {}

0 comments on commit 9a0a622

Please sign in to comment.