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

Unused imports sometimes reports used imports #6935

Closed
msullivan opened this issue Jun 4, 2013 · 1 comment
Closed

Unused imports sometimes reports used imports #6935

msullivan opened this issue Jun 4, 2013 · 1 comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@msullivan
Copy link
Contributor

One example, minimized from something in rustpkg:

extern mod extra(name = "extra");

use extra::getopts::groups::getopts;
use extra::getopts;

fn main() { getopts([], []); }

It reports that the first import is unused. If that import is removed, compilation fails. It is actually the second import that is unused.

@alexcrichton
Copy link
Member

Closed by #7038

flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 25, 2021
needless_question_mark: don't lint if Some(..) is inside a macro def and the ? is not.

The suggestion would fail to apply.

Fixes rust-lang#6921

changelog: needless_question_mark: don't lint if Some(..) is inside a macro def and the ? is not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

2 participants