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

clippy::unimplemented doesn't detect unimplemented!() with message #3528

Closed
ExoticMatter opened this issue Dec 10, 2018 · 5 comments
Closed
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@ExoticMatter
Copy link

When a message is given to unimplemented!() (rust-lang/rust@f517719), the unimplemented lint doesn't detect it.

#[allow(unreachable_code)]
#[warn(clippy::unimplemented)]
fn main() {
    unimplemented!("a()"); // case 1, not detected
    unimplemented!();      // case 2
}
warning: `unimplemented` should not be present in production code
 --> src/main.rs:5:5
  |
5 |     unimplemented!();      // case 2
  |     ^^^^^^^^^^^^^^^^^
  |
note: lint level defined here
 --> src/main.rs:2:8
  |
2 | #[warn(clippy::unimplemented)]
  |        ^^^^^^^^^^^^^^^^^^^^^
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unimplemented

clippy: 29bf75c (2018-12-05)

@oli-obk
Copy link
Contributor

oli-obk commented Dec 11, 2018

We should move

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
to a PreExpansionPass and just check for calls to macros named unimplemented

@phansch phansch added the C-bug Category: Clippy is not doing the correct thing label Dec 11, 2018
@maxencefrenette
Copy link
Contributor

I'd like to try this one !

@phansch
Copy link
Member

phansch commented Dec 12, 2018

@maxencefrenette awesome! Feel free to post here or open a work-in-progress PR if you have any questions.

@maxencefrenette
Copy link
Contributor

Opened a WIP PR #4186 . I need some guidance.

@ebroto
Copy link
Member

ebroto commented Aug 26, 2020

Fixed in #5811

@ebroto ebroto closed this as completed Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants