Skip to content

Commit

Permalink
Add regression test for issue 73899
Browse files Browse the repository at this point in the history
Adds regression test for rust-lang#73899
  • Loading branch information
est31 committed Nov 22, 2020
1 parent 675f114 commit c2a1dfa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/issues/issue-73899.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// run-pass
#![feature(const_evaluatable_checked)]
#![feature(const_generics)]
#![allow(incomplete_features)]

trait Foo {}

impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}

trait FooImpl<const IS_ZERO: bool> {}

impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}

impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}

fn foo<T: Foo>(_v: T) {}

fn main() {
foo([]);
foo([()]);
}

0 comments on commit c2a1dfa

Please sign in to comment.