Skip to content
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

Deprecated re-exports are ignored #47236

Closed
sgrif opened this issue Jan 6, 2018 · 3 comments
Closed

Deprecated re-exports are ignored #47236

sgrif opened this issue Jan 6, 2018 · 3 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sgrif
Copy link
Contributor

sgrif commented Jan 6, 2018

The following code compiles with no warnings, even though it should emit a deprecation warning. Both Diesel and Futures have mistakenly used this to deprecate items moved to a new location, without realizing that users would never see a deprecation warning.

pub mod foo {
    #[deprecated(since = "0.1.0")]
    pub use std::option::Option;
}

mod bar {
    use foo::Option;
}
@petrochenkov
Copy link
Contributor

Duplicate of #23937 (except it's about the user-facing deprecated attribute and #23937 is about internal stability attributes in the standard library, but the mechanism is the same).

@petrochenkov
Copy link
Contributor

Also similar to #15728, both can be fixed by moving stability/deprecation checking to name resolution stage.

@pietroalbini pietroalbini added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Feb 6, 2018
coriolinus added a commit to paritytech/polkadot that referenced this issue Mar 5, 2020
Resolving the circular dependency was relatively simple: just move
a bunch of parachain-specific stuff from the parachain package into
the primitives package, then fix up the Cargo manifests. Then,
publicly import all the stuff which was moved so that we don't break
any external packages which depend on parachain.

We have a deprecation notice on that `pub use` statement because
downstream consumers should depend on items in the right place.
Unfortunately, it doesn't actually do anything due to
rust-lang/rust#47236. Still, we'll
leave it in against the day that bug gets fixed.

Adding current_relay_block to ValidationParams is only part of the
work, of course: we now need to go back to where that struct is
instantiated, and insert it there, tracing it back until we get to
some kind of relay chain instance from which we can get the actual
current value and insert it appropriately.
jplatte added a commit to ruma/ruma that referenced this issue Jul 26, 2020
@dtolnay
Copy link
Member

dtolnay commented Jan 5, 2021

Closing as a duplicate of #30827, which has some discussion from compiler team members on how to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants