-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Implement #[deprecated]
attribute (RFC 1270)
#30206
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Great work, @petrochenkov! I think allowing the features to diverge further was the express intent of the RFC. This means we can use |
I'd prefer the standard library to migrate to |
This patch looks quite thorough. Good work. |
"`#[deprecated]` attribute is unstable"); | ||
fileline_help!(self.tcx.sess, attr.span(), "add #![feature(deprecated)] to \ | ||
the crate features to enable"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should probably be in libsyntax/feature_gate.rs
aebbae0
to
67a9784
Compare
Updated with comments addressed. |
@bors r+ |
📌 Commit 67a9784 has been approved by |
Closes #29935 The attributes `deprecated` and `rustc_deprecated` are completely independent in this implementation and it leads to some noticeable code duplication. Representing `deprecated` as ``` Stability { level: Stable { since: "" }, feature: "", depr: Some(Deprecation), } ``` or, contrariwise, splitting rustc_deprecation from stability makes most of the duplication go away. I can do this refactoring, but before doing it I must be sure, that further divergence of `deprecated` and `rustc_deprecated` is certainly not a goal. cc @llogiq
Is there a reason (heh) that this was implemented with |
Yes, by request from the RFC author, also see rust-lang/rfcs#1270 (comment) |
I'm surprised. Implementation violate the RFC ( (This is not the first time i noticed that RFC was violated by intention. Please respect RFC! Please amend RFC first if you think there is an error.) |
I'm a bit busy ATM but will push a PR to change the RFC shortly to alleviate the situation. |
See RFC PR #1425 |
Oops, I had already submitted the same PR at rust-lang/rfcs#1423. @liigo your language is a bit stronger than necessary since this decision was essentially made in the RFC thread as it was being accepted, but just didn't make it into the text on time. |
I don't think so. Only three people says " When RFC 1270 was merging, Alex said:
That is, |
It isn't unusual to tweak details in the implementation after an RFC is accepted. Please forgive my cavalier attitude, but I don't think changing a field name on an unstable attribute requires the whole teams' consenus. |
I've just noticed, this is not marked with "relnotes", but probably should be. |
Is there a tracking issue for stabilization? |
Closes #29935
The attributes
deprecated
andrustc_deprecated
are completely independent in this implementation and it leads to some noticeable code duplication. Representingdeprecated
asor, contrariwise, splitting rustc_deprecation from stability makes most of the duplication go away.
I can do this refactoring, but before doing it I must be sure, that further divergence of
deprecated
andrustc_deprecated
is certainly not a goal.cc @llogiq