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

Using items from a deprecated module does not warn #47237

Open
sgrif opened this issue Jan 6, 2018 · 1 comment
Open

Using items from a deprecated module does not warn #47237

sgrif opened this issue Jan 6, 2018 · 1 comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name resolution 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

Attempting to use deprecated_module; or use deprecated_module::*; fails, but doing use deprecated_module::SpecificItem; compiles with no error. Right now in Diesel I'm actually seeing an even more confusing error:

use of deprecated item 'types::__test_reexports'

Even though there is nothing in the project with that name. However, I'm unable to reproduce that issue outside of Diesel.

Regardless, the following code compiles without warnings, but should warn.

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

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

petrochenkov commented Jan 6, 2018

Duplicate of #15702.
Similarly to #47236 should be fixable by moving stability/deprecation checking to name resolution stage.

@pietroalbini pietroalbini added 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
@jonas-schievink jonas-schievink added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name resolution labels Apr 11, 2020
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. A-resolve Area: Name resolution 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