From c2a1dfacb41aee0da05bf4fa7e07dbbc24fc861f Mon Sep 17 00:00:00 2001 From: est31 Date: Sun, 22 Nov 2020 14:53:31 +0100 Subject: [PATCH] Add regression test for issue 73899 Adds regression test for https://github.com/rust-lang/rust/issues/73899 --- src/test/ui/issues/issue-73899.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/ui/issues/issue-73899.rs diff --git a/src/test/ui/issues/issue-73899.rs b/src/test/ui/issues/issue-73899.rs new file mode 100644 index 0000000000000..2a3a5ab2a3bb0 --- /dev/null +++ b/src/test/ui/issues/issue-73899.rs @@ -0,0 +1,21 @@ +// run-pass +#![feature(const_evaluatable_checked)] +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait Foo {} + +impl Foo for [(); N] where Self: FooImpl<{ N == 0 }> {} + +trait FooImpl {} + +impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {} + +impl FooImpl<{ 0u8 != 0u8 }> for [(); N] {} + +fn foo(_v: T) {} + +fn main() { + foo([]); + foo([()]); +}