You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bstrie opened this issue
Feb 15, 2021
· 2 comments
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.T-libsRelevant to the library team, which will review and decide on the PR/issue.
#82080 laid undetected for years due to the silent inability of #[rustc_deprecated] to apply properly to re-exports. For now people simply have to remember not to use it with re-exports, but it would be nice if it either 1) worked as expected, or at least 2) caused a compiler error so that it couldn't pass silently.
Open question: should the chosen behavior extend to the stable #[deprecated] attribute as well? If made to work on re-exports this will be a slight increase to the API surface area, but if made into an error it could potentially be a breaking change (although easily understood and justified as a bugfix).
Test case for #[deprecated]:
mod foo {#[deprecated]pubusecrate::bar::Bar;}mod bar {pubstructBar;}fnmain(){let _ = foo::Bar;// should warnlet _ = bar::Bar;// should not warn}
Once (if) this is fixed, then we should go through the stdlib and use this to replace all of the wrapper functions/type aliases that are currently used to trigger deprecated lints (e.g. the items in #82122 ). Better to have a deprecated path than a full-fledged item and symbol.
The text was updated successfully, but these errors were encountered:
bstrie
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
labels
Feb 15, 2021
bstrie
changed the title
Make #[rustc_deprecated] on re-exports either work properly or cause a compiler error
Make #[rustc_deprecated] (and #[deprecated]) on re-exports either work properly or cause a compiler error
Feb 15, 2021
jyn514
added
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
labels
Feb 15, 2021
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.T-libsRelevant to the library team, which will review and decide on the PR/issue.
#82080 laid undetected for years due to the silent inability of
#[rustc_deprecated]
to apply properly to re-exports. For now people simply have to remember not to use it with re-exports, but it would be nice if it either 1) worked as expected, or at least 2) caused a compiler error so that it couldn't pass silently.Open question: should the chosen behavior extend to the stable
#[deprecated]
attribute as well? If made to work on re-exports this will be a slight increase to the API surface area, but if made into an error it could potentially be a breaking change (although easily understood and justified as a bugfix).Test case for
#[deprecated]
:Once (if) this is fixed, then we should go through the stdlib and use this to replace all of the wrapper functions/type aliases that are currently used to trigger deprecated lints (e.g. the items in #82122 ). Better to have a deprecated path than a full-fledged item and symbol.
The text was updated successfully, but these errors were encountered: