diff --git a/tests/ui/const-generics/mgca/direct-const-arg-placeholder.rs b/tests/ui/const-generics/mgca/direct-const-arg-placeholder.rs new file mode 100644 index 0000000000000..72b5221c1fccd --- /dev/null +++ b/tests/ui/const-generics/mgca/direct-const-arg-placeholder.rs @@ -0,0 +1,10 @@ +//! Regression test for +#![feature(min_generic_const_args)] +struct S; + +fn foo() -> S { + //~^ ERROR: type annotations needed + //~| ERROR: the placeholder `_` is not allowed + todo!() +} +fn main() {} diff --git a/tests/ui/const-generics/mgca/direct-const-arg-placeholder.stderr b/tests/ui/const-generics/mgca/direct-const-arg-placeholder.stderr new file mode 100644 index 0000000000000..1d6b851b009e1 --- /dev/null +++ b/tests/ui/const-generics/mgca/direct-const-arg-placeholder.stderr @@ -0,0 +1,21 @@ +error[E0282]: type annotations needed + --> $DIR/direct-const-arg-placeholder.rs:5:43 + | +LL | fn foo() -> S { + | ___________________________________________^ +LL | | +LL | | +LL | | todo!() +LL | | } + | |_^ cannot infer type for struct `S<_>` + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/direct-const-arg-placeholder.rs:5:39 + | +LL | fn foo() -> S { + | ^ not allowed in type signatures + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0121, E0282. +For more information about an error, try `rustc --explain E0121`.