In the OIBIT RFC there are two limitations for default impls:
- The default impl must appear in the same module as
Trait (or a submodule).
Trait must not define any methods.
Limitation (1) does not appear to match the current implementation. The only error I can find pertaining to this rule is E0318, whose message is:
cannot create default implementations for traits outside the crate they're defined in; define a new trait instead
Also, the following example currently compiles:
#![feature(optin_builtin_traits)]
mod foo {
pub trait Foo { }
}
mod bar {
impl super::foo::Foo for .. { }
}
fn main() {}
I'm not sure if this is a bug in the implementation, if it's merely unimplemented, or if the RFC should be updated to reflect that you can define a default impl in the same crate, with no restriction on which module it's defined in.
In the OIBIT RFC there are two limitations for default impls:
Limitation (1) does not appear to match the current implementation. The only error I can find pertaining to this rule is E0318, whose message is:
Also, the following example currently compiles:
I'm not sure if this is a bug in the implementation, if it's merely unimplemented, or if the RFC should be updated to reflect that you can define a default impl in the same crate, with no restriction on which module it's defined in.