From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/traits/new-solver/const-param-placeholder.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/ui/traits/new-solver/const-param-placeholder.rs (limited to 'tests/ui/traits/new-solver/const-param-placeholder.rs') diff --git a/tests/ui/traits/new-solver/const-param-placeholder.rs b/tests/ui/traits/new-solver/const-param-placeholder.rs new file mode 100644 index 000000000..a83102a4c --- /dev/null +++ b/tests/ui/traits/new-solver/const-param-placeholder.rs @@ -0,0 +1,21 @@ +// compile-flags: -Ztrait-solver=next +// revisions: pass fail +//[pass] check-pass + +struct Wrapper([T; N]); + +trait Foo {} +fn needs_foo() {} + +#[cfg(fail)] +impl Foo for [T; 1] {} + +#[cfg(pass)] +impl Foo for [T; N] {} + +fn test() { + needs_foo::<[T; N]>(); + //[fail]~^ ERROR the trait bound `[T; N]: Foo` is not satisfied +} + +fn main() {} -- cgit v1.2.3