mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Add regression test for issue 73899
Adds regression test for https://github.com/rust-lang/rust/issues/73899
This commit is contained in:
parent
675f114d95
commit
c2a1dfacb4
21
src/test/ui/issues/issue-73899.rs
Normal file
21
src/test/ui/issues/issue-73899.rs
Normal 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([()]);
|
||||
}
|
Loading…
Reference in New Issue
Block a user