about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 15:53:14 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 20:41:03 +0100
commitd8d2004c6ffb8b66eac90e75aa23012130adf9f9 (patch)
tree3f827a8f9ab5363f24cc85cecc91a8318551cbf3 /src/librustc_mir/interpret
parent38f5db72681289f6ebbcb3c89081f021aa6fdc63 (diff)
downloadrust-d8d2004c6ffb8b66eac90e75aa23012130adf9f9.tar.gz
rust-d8d2004c6ffb8b66eac90e75aa23012130adf9f9.zip
Don't use "if let" bindings to only check a value and not actually bind anything.
For example:  `if let Some(_) = foo() {}`	can be reduced to	`if foo().is_some() {}`   (clippy::redundant_pattern_matching)
Diffstat (limited to 'src/librustc_mir/interpret')
-rw-r--r--src/librustc_mir/interpret/memory.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs
index 6517ae5d0f3..3c4a1857f96 100644
--- a/src/librustc_mir/interpret/memory.rs
+++ b/src/librustc_mir/interpret/memory.rs
@@ -565,7 +565,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
 
         // # Function pointers
         // (both global from `alloc_map` and local from `extra_fn_ptr_map`)
-        if let Some(_) = self.get_fn_alloc(id) {
+        if self.get_fn_alloc(id).is_some() {
             return if let AllocCheck::Dereferenceable = liveness {
                 // The caller requested no function pointers.
                 throw_unsup!(DerefFunctionPointer)