Terse diagnostic on lack of ~const bound in inherent associated const functions #126975
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
F-const_trait_impl
`#![feature(const_trait_impl)]`
PG-const-traits
Project group: Const traits
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When a trait is used as a bounds to a generic inherent implementation, and that inherent implementation defines a const function, methods from that bounding trait are not being handled as const inside that definition.
I tried this code:
I expected to see this happen: The code would compile and use the const bar() method implemented on F.
Instead, this happened: The compiler yields the error:
Meta
This was tested on rustc 1.81.0-nightly (6b0f4b5 2024-06-24).
The text was updated successfully, but these errors were encountered: