From 15eaf78083ecff62b7669091da1a1c8b4f60ebf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Tue, 12 Sep 2023 02:11:16 +0200 Subject: [PATCH] Disallow block_in_place and Handle::block_on (#5101) ## Problem `block_in_place` is a quite expensive operation, and if it is used, we should explicitly have to opt into it by allowing the `clippy::disallowed_methods` lint. For more, see https://github.com/neondatabase/neon/pull/5023#discussion_r1304194495. Similar arguments exist for `Handle::block_on`, but we don't do this yet as there is still usages. ## Summary of changes Adds a clippy.toml file, configuring the [`disallowed_methods` lint](https://rust-lang.github.io/rust-clippy/master/#/disallowed_method). --- clippy.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 clippy.toml diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000000..d788afc84d --- /dev/null +++ b/clippy.toml @@ -0,0 +1,5 @@ +disallowed-methods = [ + "tokio::task::block_in_place", + # Allow this for now, to deny it later once we stop using Handle::block_on completely + # "tokio::runtime::Handle::block_on", +]