Skip to content

Commit

Permalink
Rollup merge of #79302 - est31:issue_73899_test, r=lcnr
Browse files Browse the repository at this point in the history
Add regression test for issue 73899

Closes #73899
  • Loading branch information
GuillaumeGomez committed Nov 22, 2020
2 parents 70a839f + c2a1dfa commit 749fe40
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 749fe40

Please sign in to comment.