Hi,
When I am trying to have a const trait, I am having the following error:
error[E0049]: method `as_message` has 1 const parameter but its trait declaration has 0 const parameters
--> src/main.rs:18:1
|
18 | #[const_trait]
| ^^^^^^^^^^^^^^ found 1 const parameter
19 | pub trait AsMessage {
20 | fn as_message(&self) -> Message;
| - expected 0 const parameters
For more information about this error, try `rustc --explain E0049`.
I provide the link in Rust playground for an example. If I remove the #[const_trait] and remove const from trait implementations, it compiles and works. I wonder what the cause is. If you can help me on that issue, I'd appreciate that.
Thanks in advance.