stability icon indicating copy to clipboard operation
stability copied to clipboard

Support marking trait implementations as unstable

Open sagebind opened this issue 3 years ago • 0 comments

It could be useful to mark certain trait implementations as unstable, for example:

// The struct itself is stable...
pub struct MyStruct {
    // ...
}

// But its FromStr implementation is not.
#[stability::unstable(feature = "mystruct-fromstr")]
impl FromStr for MyStruct {
    // etc...
}

I'm not sure that this is really possible to do though in just a macro, since a type either implements a trait or not. I don't think there's a way to implement a trait just within the context of the current crate and not "leak" the implementation to consumers. Maybe some sort of deref/newtype magic would work...

sagebind avatar Oct 23 '20 00:10 sagebind