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 upImplement `#[deprecated]` attribute (RFC 1270) #30206
Conversation
rust-highfive
assigned
brson
Dec 4, 2015
This comment has been minimized.
This comment has been minimized.
|
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
Great work, @petrochenkov! I think allowing the features to diverge further was the express intent of the RFC. This means we can use |
This comment has been minimized.
This comment has been minimized.
|
I'd prefer the standard library to migrate to |
This comment has been minimized.
This comment has been minimized.
|
This patch looks quite thorough. Good work. |
brson
reviewed
Dec 10, 2015
| "`#[deprecated]` attribute is unstable"); | ||
| fileline_help!(self.tcx.sess, attr.span(), "add #![feature(deprecated)] to \ | ||
| the crate features to enable"); | ||
| } |
This comment has been minimized.
This comment has been minimized.
brson
reviewed
Dec 10, 2015
| // unmarked impls for it. See FIXME above for more details. | ||
|
|
||
| debug!("lookup: trait_id={:?}", trait_id); | ||
| return lookup_deprecation(tcx, trait_id); |
This comment has been minimized.
This comment has been minimized.
brson
Dec 10, 2015
Contributor
The duplication of this method strikes me as particularly bad. Can the contents be abstracted into lookup_uncached_generic?
This comment has been minimized.
This comment has been minimized.
petrochenkov
Dec 12, 2015
Author
Contributor
I've removed some obsolete code from these functions instead, should be better now.
brson
reviewed
Dec 10, 2015
| @@ -577,74 +577,71 @@ impl LateLintPass for MissingDebugImplementations { | |||
| declare_lint! { | |||
| DEPRECATED, | |||
| Warn, | |||
| "detects use of #[rustc_deprecated] items" | |||
| "detects use of `#[deprecated]` or `#[rustc_deprecated]` items" | |||
This comment has been minimized.
This comment has been minimized.
brson
Dec 10, 2015
Contributor
The existence of #[rustc_deprecated] is an implementation detail. Can we change this string to 'detects use of deprecated items'?
brson
reviewed
Dec 10, 2015
|
|
||
| // #[deprecated] can't be used in staged api | ||
|
|
||
| #![feature(deprecated, staged_api)] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
petrochenkov
Dec 12, 2015
Author
Contributor
We removed #[staged_api] attribute, not #[feature(staged_api)].
#[feature(staged_api)] gates stability attributes.
brson
reviewed
Dec 10, 2015
| fn trait_deprecated(&self) {} | ||
| #[deprecated(since = "1.0.0", note = "text")] | ||
| fn trait_deprecated_text(&self) {} | ||
| } |
This comment has been minimized.
This comment has been minimized.
brson
Dec 10, 2015
Contributor
Why isn't there a test with the deprecated attribute on the trait itself?
petrochenkov
added some commits
Dec 4, 2015
petrochenkov
force-pushed the
petrochenkov:newdepr
branch
from
aebbae0
to
67a9784
Dec 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Updated with comments addressed. |
This comment has been minimized.
This comment has been minimized.
brson
commented on src/librustc/middle/stability.rs in 105bd15
Dec 14, 2015
|
Huh, this is a surprising patch. Were these four blocks of code in these two lookup_*_uncached methods not actually doing anything useful? Where is this work done now? |
This comment has been minimized.
This comment has been minimized.
|
All trait impls have annotations now (this work was done in rust-lang#29152 and rust-lang#29083), so there's no need to infer them from annotations on traits. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
bors
merged commit 67a9784
into
rust-lang:master
Dec 16, 2015
This was referenced Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Is there a reason (heh) that this was implemented with |
This comment has been minimized.
This comment has been minimized.
Yes, by request from the RFC author, also see rust-lang/rfcs#1270 (comment) |
durka
referenced this pull request
Dec 22, 2015
Merged
Amend RFC 1270 to describe actual implementation #1423
This comment has been minimized.
This comment has been minimized.
|
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.) |
This comment has been minimized.
This comment has been minimized.
|
I'm a bit busy ATM but will push a PR to change the RFC shortly to alleviate the situation. |
This comment has been minimized.
This comment has been minimized.
|
See RFC PR #1425 |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
I don't think so. Only three people says " When RFC 1270 was merging, Alex said:
That is, |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
I've just noticed, this is not marked with "relnotes", but probably should be. |
bluss
added
the
relnotes
label
Jan 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Is there a tracking issue for stabilization? |
petrochenkov commentedDec 4, 2015
Closes #29935
The attributes
deprecatedandrustc_deprecatedare completely independent in this implementation and it leads to some noticeable code duplication. Representingdeprecatedasor, 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
deprecatedandrustc_deprecatedis certainly not a goal.cc @llogiq