mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
22 lines
402 B
Rust
22 lines
402 B
Rust
//@ compile-flags: -Znext-solver
|
|
//@ revisions: pass fail
|
|
//@[pass] check-pass
|
|
|
|
struct Wrapper<T, const N: usize>([T; N]);
|
|
|
|
trait Foo {}
|
|
fn needs_foo<F: Foo>() {}
|
|
|
|
#[cfg(fail)]
|
|
impl<T> Foo for [T; 1] {}
|
|
|
|
#[cfg(pass)]
|
|
impl<T, const N: usize> Foo for [T; N] {}
|
|
|
|
fn test<T, const N: usize>() {
|
|
needs_foo::<[T; N]>();
|
|
//[fail]~^ ERROR the trait bound `[T; N]: Foo` is not satisfied
|
|
}
|
|
|
|
fn main() {}
|