audunhalland / entrait

Loosely coupled Rust application design made easy
83 stars 1 forks source link

Trait method cfgs aren't honored #18

Closed TheDan64 closed 1 year ago

TheDan64 commented 1 year ago

Suppose I have something like:

#[cfg(feature = "baz")]
struct Baz;

#[entrait]
trait Foo {
    fn bar();
    #[cfg(feature = "baz")]
    fn baz() -> Baz;
}

You'll get an error saying Baz doesn't exist when you don't provide the baz feature flag - entrait doesn't seem to propagate cfgs to the output code.

audunhalland commented 1 year ago

This is indeed a bug, working on a fix.

audunhalland commented 1 year ago

released 0.5.1 containing a fix for this.