Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: #[deprecated] for Everyone #1270
Conversation
llogiq
added some commits
Jun 3, 2015
This comment has been minimized.
This comment has been minimized.
|
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:
|
This comment has been minimized.
This comment has been minimized.
|
The |
This comment has been minimized.
This comment has been minimized.
|
@seanmonstar Good point about And yes, I see types and public fields as API items, too. I forgot that |
This comment has been minimized.
This comment has been minimized.
olivren
commented
Sep 8, 2015
|
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 |
This comment has been minimized.
This comment has been minimized.
|
@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. |
alexcrichton
added
the
T-libs
label
Sep 8, 2015
This comment has been minimized.
This comment has been minimized.
bluss
commented
Sep 8, 2015
|
The staging_api attribute is called |
llogiq
changed the title
RFC: #[deprecate] for Everyone
RFC: #[deprecated] for Everyone
Sep 8, 2015
This comment has been minimized.
This comment has been minimized.
|
Well, I initially skipped the final |
This comment has been minimized.
This comment has been minimized.
mrhota
commented
Nov 7, 2015
|
Bikeshed/nitpick alert :)
Why "require" or mention semver? As mentioned in the final sentence the field won't be checked by |
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
mrhota
commented
Nov 7, 2015
|
@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? |
This comment has been minimized.
This comment has been minimized.
mrhota
commented
Nov 7, 2015
(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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@llogiq Thanks for this RFC! Definitely a worthwhile feature for the Rust ecosystem. I have a couple concerns:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@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 |
This comment has been minimized.
This comment has been minimized.
|
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
self-assigned this
Nov 17, 2015
This comment has been minimized.
This comment has been minimized.
|
@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 |
This comment has been minimized.
This comment has been minimized.
Toby-S
commented
Nov 19, 2015
|
|
This comment has been minimized.
This comment has been minimized.
|
@llogiq I agree that |
This comment has been minimized.
This comment has been minimized.
|
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. |
alexcrichton
referenced this pull request
Nov 19, 2015
Closed
Tracking issue for `#[deprecated]` #29935
alexcrichton
merged commit 8ec2ccd
into
rust-lang:master
Nov 19, 2015
This comment has been minimized.
This comment has been minimized.
llogiq
deleted the
llogiq:deprecate
branch
Nov 20, 2015
petrochenkov
referenced this pull request
Dec 22, 2015
Merged
Implement `#[deprecated]` attribute (RFC 1270) #30206
llogiq
referenced this pull request
Dec 23, 2015
Closed
deprecate attribute: renamed reason to note #1425
This comment has been minimized.
This comment has been minimized.
quodlibetor
commented
Jul 9, 2017
|
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 ? |
This comment has been minimized.
This comment has been minimized.
|
@quodlibetor Fixed! |
llogiq commentedSep 5, 2015
•
edited by sfackler
Library authors need a way of evolving their API painlessly. This is it.
Rendered