From 62e748d95a1b519f718a2a3ed0684f3e9488f2e5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 28 Feb 2024 20:20:39 -0800 Subject: [PATCH] Soft deprecate `client`, `mock`, and `server` modules Summary: This is the start of the codemod for https://fb.workplace.com/groups/rust.language/posts/25780668961555042. It follows the same approach as {D53374511} by adding a comment above the re-exports to identify the correct Buck target to use instead. This way I can codemod all uses by locally changing the comment into a real `#[deprecated = "..."]` attribute, compiling all Rust targets with `-Awarnings -Wdeprecated` in rustflags, parsing the deprecation warnings, and programmatically applying the correct fix. Note that the deprecation needs to be on a `pub mod` rather than a `pub use` because deprecation on re-exports is not supported by Rust. Reviewed By: zertosh Differential Revision: D54332814 fbshipit-source-id: 16358f211032a7b1a701c08d909078b86b53d65f --- fb303/thrift/clients/thrift_build.rs | 2 +- fb303/thrift/services/thrift_build.rs | 2 +- fb303/thrift/thrift_build.rs | 2 +- fb303/thrift/types/thrift_build.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fb303/thrift/clients/thrift_build.rs b/fb303/thrift/clients/thrift_build.rs index a142f0d90..7d769cbb3 100644 --- a/fb303/thrift/clients/thrift_build.rs +++ b/fb303/thrift/clients/thrift_build.rs @@ -15,7 +15,7 @@ fn main() { let out_dir: &Path = out_dir.as_ref(); fs::write( out_dir.join("cratemap"), - "fb303_core crate", + "fb303_core crate //fb303/thrift:fb303_core-rust", ).expect("Failed to write cratemap"); let conf = { diff --git a/fb303/thrift/services/thrift_build.rs b/fb303/thrift/services/thrift_build.rs index 4d04135c0..62159344c 100644 --- a/fb303/thrift/services/thrift_build.rs +++ b/fb303/thrift/services/thrift_build.rs @@ -15,7 +15,7 @@ fn main() { let out_dir: &Path = out_dir.as_ref(); fs::write( out_dir.join("cratemap"), - "fb303_core crate", + "fb303_core crate //fb303/thrift:fb303_core-rust", ).expect("Failed to write cratemap"); let conf = { diff --git a/fb303/thrift/thrift_build.rs b/fb303/thrift/thrift_build.rs index ce551e720..9869f67bc 100644 --- a/fb303/thrift/thrift_build.rs +++ b/fb303/thrift/thrift_build.rs @@ -15,7 +15,7 @@ fn main() { let out_dir: &Path = out_dir.as_ref(); fs::write( out_dir.join("cratemap"), - "fb303_core crate", + "fb303_core crate //fb303/thrift:fb303_core-rust", ).expect("Failed to write cratemap"); let conf = { diff --git a/fb303/thrift/types/thrift_build.rs b/fb303/thrift/types/thrift_build.rs index 141348a48..6565fb3c4 100644 --- a/fb303/thrift/types/thrift_build.rs +++ b/fb303/thrift/types/thrift_build.rs @@ -15,7 +15,7 @@ fn main() { let out_dir: &Path = out_dir.as_ref(); fs::write( out_dir.join("cratemap"), - "fb303_core crate", + "fb303_core crate //fb303/thrift:fb303_core-rust", ).expect("Failed to write cratemap"); let conf = {