Hello there
I would like to conditionnally compile supertrait depending on the selected features.
For example, I have a trait MyTrait:
pub trait MyTrait: Copy + Trait1 + Trait2 {
/// implementation
}
And I have a feature named: "with-trait1"
So when someone uses my crate like this:
[dependencies]
my_crate = { version = "0.1.0", features = ["with-trait1"] }
I would like my trait to have these supertraits
pub trait MyTrait: Copy + Trait1 + Trait2 {
/// implementation
}
And without this feature I would like:
pub trait MyTrait: Copy + Trait2 {
/// implementation
}
But I can't do:
pub trait MyTrait: Copy + #[cfg(feature = "with-trait1")] Trait1 + Trait2 {
/// implementation
}
Is there a way to achieve this please ?
Thanks a lot