2025-07-01 21:46:28 +05:00
|
|
|
//! This checks that compiler correctly evaluate constant array lengths within trait `impl` headers.
|
|
|
|
|
//!
|
|
|
|
|
//! Regression test for <https://github.com/rust-lang/rust/issues/49208>.
|
2018-03-22 09:56:04 +01:00
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
|
fn foo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Foo for [(); 1] {
|
|
|
|
|
fn foo() {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
<[(); 0] as Foo>::foo() //~ ERROR E0277
|
|
|
|
|
}
|