Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/ui/const-generics/mgca/direct-const-arg-placeholder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/159558>
#![feature(min_generic_const_args)]
struct S<const N: usize>;

fn foo() -> S<core::direct_const_arg!(_)> {
//~^ ERROR: type annotations needed
//~| ERROR: the placeholder `_` is not allowed
todo!()
}
fn main() {}
21 changes: 21 additions & 0 deletions tests/ui/const-generics/mgca/direct-const-arg-placeholder.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0282]: type annotations needed
--> $DIR/direct-const-arg-placeholder.rs:5:43
|
LL | fn foo() -> S<core::direct_const_arg!(_)> {
| ___________________________________________^
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<core::direct_const_arg!(_)> {
| ^ 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`.
Loading