Open
Description
Issue by huonw
Monday Jul 08, 2013 at 14:16 GMT
For earlier discussion, see rust-lang/rust#7649
This issue was labelled with: A-attributes, B-RFC in the Rust repository
If there was a #[no_override]
attribute that made it impossible to override a default method, there would be very little need for the FooUtil
traits (with this attribute default methods would have almost exactly the same properties as *Util
, except the seperate trait can be imported separately). i.e.
trait Foo {
fn bar(&self);
#[no_override]
fn call_bar(&self) { self.bar(); }
}
impl Foo for int {
fn bar(&self) {}
fn call_bar(&self) {} // error!
}
This would provide a workaround for #5898 that is a proper solution in its own right.