]> git.lizzy.rs Git - rust.git/blobdiff - src/fn_call.rs
Fix some clippy lints
[rust.git] / src / fn_call.rs
index 1c3998a4f022fa3585cf091beb59be85c0929bf2..d2149ee5dbe7d3ee75280440acf226f16237b25f 100644 (file)
@@ -268,7 +268,7 @@ fn call_c_abi(
                 )?;
                 let mut args = self.frame().mir.args_iter();
 
-                let arg_local = args.next().ok_or(
+                let arg_local = args.next().ok_or_else(||
                     EvalErrorKind::AbiViolation(
                         "Argument to __rust_maybe_catch_panic does not take enough arguments."
                             .to_owned(),
@@ -504,7 +504,7 @@ fn call_c_abi(
 
                 // Figure out how large a pthread TLS key actually is. This is libc::pthread_key_t.
                 let key_type = args[0].ty.builtin_deref(true)
-                                   .ok_or(EvalErrorKind::AbiViolation("Wrong signature used for pthread_key_create: First argument must be a raw pointer.".to_owned()))?.ty;
+                                   .ok_or_else(|| EvalErrorKind::AbiViolation("Wrong signature used for pthread_key_create: First argument must be a raw pointer.".to_owned()))?.ty;
                 let key_size = self.layout_of(key_type)?.size;
 
                 // Create key and write it into the memory where key_ptr wants it
@@ -747,7 +747,7 @@ fn call_missing_fn(
         // current frame.
         self.dump_local(dest);
         self.goto_block(dest_block);
-        return Ok(());
+        Ok(())
     }
 
     fn write_null(&mut self, dest: Place, dest_ty: Ty<'tcx>) -> EvalResult<'tcx> {