From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann <daniel.baumann@progress-linux.org> Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org> --- .../generic_arg_infer/infer-arg-test.rs | 2 +- .../generic_arg_infer/infer-arg-test.stderr | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'tests/ui/const-generics/generic_arg_infer') diff --git a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.rs b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.rs index 29aa0f59d..c254b4ee0 100644 --- a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.rs +++ b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.rs @@ -15,7 +15,7 @@ fn bad_infer_fn<_>() {} fn main() { - let a: All<_, _, _>; + let a: All<_, _, _>; //~ ERROR struct takes 2 generic arguments but 3 all_fn(); let v: [u8; _]; let v: [u8; 10] = [0; _]; diff --git a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr index e6d0c743d..a6b736261 100644 --- a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr +++ b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr @@ -19,6 +19,21 @@ LL | struct BadInfer<_>; = help: consider removing `_`, referring to it in a field, or using a marker such as `PhantomData` = help: if you intended `_` to be a const parameter, use `const _: usize` instead -error: aborting due to 3 previous errors +error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supplied + --> $DIR/infer-arg-test.rs:18:10 + | +LL | let a: All<_, _, _>; + | ^^^ - help: remove this generic argument + | | + | expected 2 generic arguments + | +note: struct defined here, with 2 generic parameters: `T`, `N` + --> $DIR/infer-arg-test.rs:3:8 + | +LL | struct All<'a, T, const N: usize> { + | ^^^ - -------------- + +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0392`. +Some errors have detailed explanations: E0107, E0392. +For more information about an error, try `rustc --explain E0107`. -- cgit v1.2.3