-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
A-attributesProposals relating to attributesProposals relating to attributesA-privacyPrivacy related proposals & ideasPrivacy related proposals & ideasA-traitsTrait system related proposals & ideasTrait system related proposals & ideasA-typesystemType system related proposals & ideasType system related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
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.
yohannd1, demurgos and pchampin
Metadata
Metadata
Assignees
Labels
A-attributesProposals relating to attributesProposals relating to attributesA-privacyPrivacy related proposals & ideasPrivacy related proposals & ideasA-traitsTrait system related proposals & ideasTrait system related proposals & ideasA-typesystemType system related proposals & ideasType system related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.