diff options
| author | est31 <MTest31@outlook.com> | 2020-11-22 14:53:31 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2020-11-22 15:36:37 +0100 |
| commit | c2a1dfacb41aee0da05bf4fa7e07dbbc24fc861f (patch) | |
| tree | ff3bc9a5a1be46a272ab7cfdab47b20595a99e2d | |
| parent | 675f114d952df8be61ac74ebeac7550049f26ccd (diff) | |
| download | rust-c2a1dfacb41aee0da05bf4fa7e07dbbc24fc861f.tar.gz rust-c2a1dfacb41aee0da05bf4fa7e07dbbc24fc861f.zip | |
Add regression test for issue 73899
Adds regression test for https://github.com/rust-lang/rust/issues/73899
| -rw-r--r-- | src/test/ui/issues/issue-73899.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-73899.rs b/src/test/ui/issues/issue-73899.rs new file mode 100644 index 00000000000..2a3a5ab2a3b --- /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<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([()]); +} |
