False negative on mem_replace_option_with_none #9824
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
I was going trough the Learning Rust with entirely too many linked lists tutorial. I have my editor set to give me warnings from clippy. In section 3.1 the tutorial has you replacing a type with an Option, and then changing a couple of of mem::replace instances with the take() method on Option. I thought to myself "huh, that's always better, that should be a lint". So I googled, and turns out it is a lint, but for some reason the lint doesn't trigger on the code in the tutorial.
Lint Name
mem_replace_option_with_none
Reproducer
This is the code from the tutorial, but with the irrelevant parts cut out:
To reproduce create a new with cargo library crate, paste into lib.rs, and run cargo clippy.
The lint is not triggered for the mem::replace on line 15.
Version
The text was updated successfully, but these errors were encountered: