Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support marking trait implementations as unstable #1

Open
sagebind opened this issue Oct 23, 2020 · 1 comment
Open

Support marking trait implementations as unstable #1

sagebind opened this issue Oct 23, 2020 · 1 comment

Comments

@sagebind
Copy link
Owner

sagebind commented Oct 23, 2020

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...

@joshka
Copy link
Contributor

joshka commented Jun 27, 2024

https://crates.io/crates/instability 0.3.1 has this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants