Sorry, since I don't know what causes this, can't be more specific, and don't know if the other bug reports (currently 4 others) are related or have distinct causes.
use core::num::Zero;
pub trait MyTrait {
pub fn method(&mut self);
}
pub struct MyStruct<U> {
pub attr: U,
}
pub impl<U: Num> MyStruct<U> {
pub fn other_method(&mut self) {
self.attr += Zero::zero();
}
}
impl MyTrait for MyStruct<f64> {
pub fn method(&mut self) {
self.other_method();
}
}
fn main() {
let x = MyStruct {attr: 0.0f64};
let _ = ~x as ~MyTrait;
}
Sorry, since I don't know what causes this, can't be more specific, and don't know if the other bug reports (currently 4 others) are related or have distinct causes.
Other issues with the same error:
This is as small as I can get the code: