2024-10-02 19:42:06 +08:00
|
|
|
error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
|
|
|
|
|
--> $DIR/call-const-trait-method-fail.rs:27:5
|
2022-01-28 21:57:29 +11:00
|
|
|
|
|
|
|
|
|
LL | a.plus(b)
|
2024-10-02 19:42:06 +08:00
|
|
|
| ^ the trait `Plus` is not implemented for `u32`
|
2022-02-10 20:22:54 +11:00
|
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
note: required by a bound in `Plus::plus`
|
2024-10-02 19:42:06 +08:00
|
|
|
--> $DIR/call-const-trait-method-fail.rs:5:1
|
2024-06-25 09:50:01 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait]
|
|
|
|
|
| ^^^^^^^^^^^^^^ required by this bound in `Plus::plus`
|
|
|
|
|
LL | pub trait Plus {
|
|
|
|
|
LL | fn plus(self, rhs: Self) -> Self;
|
|
|
|
|
| ---- required by a bound in this associated function
|
2024-10-02 19:42:06 +08:00
|
|
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
|
|
|
|
|
|
|
|
|
|
LL | pub const fn add_u32(a: u32, b: u32) -> u32 where u32: Plus {
|
|
|
|
|
| +++++++++++++++
|
2020-02-04 14:03:37 -08:00
|
|
|
|
2024-10-02 19:42:06 +08:00
|
|
|
error: aborting due to 1 previous error
|
2020-02-04 14:03:37 -08:00
|
|
|
|
2023-08-06 13:20:55 +00:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|