-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: #[deprecated] for Everyone #1270
Conversation
I have never found value in a 'since' label for deprecations. How long an Also, I would find it useful to be able to mark structs, enums, modules, On Sat, Sep 5, 2015, 1:15 AM llogiq notifications@github.com wrote:
|
The |
@seanmonstar Good point about And yes, I see types and public fields as API items, too. I forgot that |
A It seems odd to me that the I think it is fine to make the I would not introduce an hypothetical I like the idea of the |
@olivren Thank you; those are good suggestions. I figure I was a bit inconsistent in my thinking; It is a proxy for the probability of the item being removed, with the benefit that the removal is in the future, and thus hard to predict, whereas the deprecation is in the present/past, and thus doesn't require a chrystal ball. |
The staging_api attribute is called |
Well, I initially skipped the final |
Bikeshed/nitpick alert :)
Why "require" or mention semver? As mentioned in the final sentence the field won't be checked by |
@mrhota because cargo uses semver to decide what version of a crate to use -- in particular when resolving multiple dependencies with different version requirements. It's an important aspect of reproducible/reliable builds, which deprecation is part of. |
@gankro You're right. I only mention it because I'm not sure why semver is mentioned if the field isn't going to be checked. Moreover, the field can be checked by cargo, which is probably the proper place for the check anyway, since it's part of the manifest spec. Cargo, and cargo alone, should enforce the usage of semver. If I'm not using cargo, then it shouldn't matter, right? |
(Is that how Cargo works now?) What if Cargo didn't bother silencing deprecation warnings on dependencies? I'm not sure that would be so bad. It could be potentially useful information (you can file reports with the relevant package's maintainers). Plus you'd get to KISS. |
Since the semver check would be done as a lint and cargo silences lints on dependencies, yes, this is how it works. And no, this is done in rustc, not cargo. |
@llogiq Thanks for this RFC! Definitely a worthwhile feature for the Rust ecosystem. I have a couple concerns:
|
|
For (2), I don't see why For (3), yeah, I was saying that we could introduce it as unstable first. Though, if we end up going with the simplified design that's basically how the feature has been working forever, I don't know that we need a long stabilization process. For (4), I'm not overly worried; we should be able to layer something on later on. |
@aturon: Fine with me. Unfortunately, I'm a bit short on time, so I plan to have the update some time next week. To sum it up: since will stay optional, but if there is checked by the |
The compiler currently has no knowledge of crate versions, actually, it's all opaque information coming from Cargo which passes through the compiler. Along those lines I don't think that the compiler itself should have any validation of the |
@aturon I finally came around to update the RFC. Before we get to implement it, I have another question to you folks: Should we rename the |
|
@llogiq I agree that |
Thanks for the update @llogiq! I'm going to go ahead and merge this for now and we can always tweak minor details like naming here and there after this is merged. Note that this will continue to be unstable to start out with and we'll stabilize it at a future date at which point the naming can be clarified. |
The rendered link in the original post here points to a file which no longer exists, and all the commits in this thread refer to an RFC that still specifies Since this is still a popular target for search engines maybe someone could update the original "rendered" link to point to https://github.com/rust-lang/rfcs/blob/master/text/1270-deprecation.md ? |
@quodlibetor Fixed! |
Library authors need a way of evolving their API painlessly. This is it.
Rendered