-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Description
I would expect this to compile, but it doesn't. Is this intentional? It seems that M2
discards the f64: Mul<Self, Output=Self>
constraint.
use std::ops::{Mul};
pub trait M: Sized where f64: Mul<Self, Output=Self> {
}
pub trait M2: M {
fn f(self, a: f64) -> Self {
a * self
}
}
Error is:
error: the trait `core::ops::Mul<Self>` is not implemented for the type `f64` [E0277]
<anon>:11 a * self
Metadata
Metadata
Assignees
Labels
No labels