From 6c795951346b846964fb031df07fba2d2cd8c7d0 Mon Sep 17 00:00:00 2001 From: Ellen Date: Mon, 13 Dec 2021 03:33:14 +0000 Subject: [PATCH] extra test for bug i found --- .../generic_arg_infer/dont-use-defaults.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs diff --git a/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs b/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs new file mode 100644 index 0000000000000..251160a0f5f29 --- /dev/null +++ b/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs @@ -0,0 +1,15 @@ +// run-pass +#![feature(generic_arg_infer)] + +// test that we dont use defaults to aide in type inference + +struct Foo; +impl Foo { + fn make_arr() -> [(); N] { + [(); N] + } +} + +fn main() { + let [(), (), ()] = Foo::<_>::make_arr(); +}