Rollup merge of #79302 - est31:issue_73899_test, r=lcnr

Add regression test for issue 73899

Closes #73899
This commit is contained in:
Guillaume Gomez 2020-11-22 16:15:15 +01:00 committed by GitHub
commit 749fe400c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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([()]);
}