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 up`#[deprecated]` does nothing if placed on an impl item. #39935
Comments
This comment has been minimized.
This comment has been minimized.
|
This is unfortunately a limitation of stability today, it just doesn't work at all with trait impls. (we run into this all the time in libstd as well) |
Mark-Simulacrum
added
the
A-stability
label
May 23, 2017
quodlibetor
added a commit
to quodlibetor/rust-chrono
that referenced
this issue
Jul 9, 2017
quodlibetor
referenced this issue
Jul 10, 2017
Merged
Deprecated warnings in cargo output for rustc-serialize feature #174
Mark-Simulacrum
added
the
C-feature-request
label
Jul 27, 2017
quodlibetor
added a commit
to quodlibetor/rust-chrono
that referenced
this issue
Mar 28, 2018
quodlibetor
added a commit
to quodlibetor/rust-chrono
that referenced
this issue
Mar 28, 2018
quodlibetor
added a commit
to quodlibetor/rust-chrono
that referenced
this issue
Apr 1, 2018
comex
referenced this issue
Apr 11, 2018
Closed
RFC: DynSized without ?DynSized — Lint against use of `extern type` in `size_of_val`, and more #2310
gnzlbg
referenced this issue
May 29, 2018
Closed
Tracking issue for the GlobalAlloc trait and related APIs #49668
This was referenced Jun 26, 2018
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Do we want to support stability on trait impls or not? I remember this being discussed elsewhere but I don't remember the conclusion. |
This comment has been minimized.
This comment has been minimized.
|
It'd be nice yeah! At this point everyone just assumes it doesn't work, so there's likely lots of misannotated impls or unintended fallout from a "bugfix" change like this, but it'd be good to implement if possible! |
This comment has been minimized.
This comment has been minimized.
|
I still think we should at least make this a compiler error until we can make it work. I disagree with the "everyone assumes it doesn't work" take, I think folks do assume it works, and never verify if their users are receiving a warning or not. |
mzabaluev
referenced this issue
Nov 26, 2018
Open
impls of PartialEq<str> etc. violate Hash consistency #230
This comment has been minimized.
This comment has been minimized.
A warning would be a gentler option. I agree that it's not good to let people put the deprecation attribute on and assume it will work. |
sgrif commentedFeb 18, 2017
•
edited
Given the following two crates:
I would expect the second crate to see a deprecation warning on the use of
Foo.into_bar(). Instead, both crates compile successfully with no errors. I think that allowing deprecations on impls is a useful option to provide to authors (one that I was looking to do, and found this while seeing if it would work). However, if we do not wish to provide that ability to library authors, placing the#[deprecated]attribute on an impl should result in a compiler error.