Closed
Description
As noted in #81914, given the following:
fn main() {}
struct MyStruct;
trait Test {
}
impl Test for MyStruct {
const TEST: fn() -> _ = 42;
}
we emit
error[E0438]: const `TEST` is not a member of trait `Test`
--> main_test.rs:10:5
|
10 | const TEST: fn() -> _ = 42;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `Test`
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> main_test.rs:10:25
|
10 | const TEST: fn() -> _ = 42;
| ^
| |
| not allowed in type signatures
| help: use type parameters instead: `T`
Follow up to #81885.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: An error or lint that needs small tweaks.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.