diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-12-20 11:07:05 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-12-20 11:55:02 +0100 |
| commit | 23e2f8aa8662daee809dce4f8eef6932628d3836 (patch) | |
| tree | b2488d98e66ce7d989376a57bc94f2ad8e82fe69 /src/tools/rust-analyzer/crates/proc-macro-api | |
| parent | 4aa34abe649f0521dc361b71004cf3dfa3e2addc (diff) | |
internal: Split serde derive feature into `serde_derive` usage
Ideally we'd not have any dependency pull in the derive feature for faster build times, once that is the case this change would have an actual effect. See https://github.com/matklad/macro-dep-test/blob/master/README.md for context.
Diffstat (limited to 'src/tools/rust-analyzer/crates/proc-macro-api')
3 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml b/src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml index 911301e22b4..dac8e094357 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml +++ b/src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml @@ -14,6 +14,7 @@ doctest = false [dependencies] serde.workspace = true +serde_derive.workspace = true serde_json = { workspace = true, features = ["unbounded_depth"] } tracing.workspace = true rustc-hash.workspace = true diff --git a/src/tools/rust-analyzer/crates/proc-macro-api/src/msg.rs b/src/tools/rust-analyzer/crates/proc-macro-api/src/msg.rs index 883528558d9..bbd9f582df9 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-api/src/msg.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-api/src/msg.rs @@ -4,7 +4,8 @@ pub(crate) mod flat; use std::io::{self, BufRead, Write}; use paths::Utf8PathBuf; -use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde::de::DeserializeOwned; +use serde_derive::{Deserialize, Serialize}; use crate::ProcMacroKind; @@ -123,7 +124,7 @@ impl ExpnGlobals { } } -pub trait Message: Serialize + DeserializeOwned { +pub trait Message: serde::Serialize + DeserializeOwned { fn read<R: BufRead>( from_proto: ProtocolRead<R>, inp: &mut R, diff --git a/src/tools/rust-analyzer/crates/proc-macro-api/src/msg/flat.rs b/src/tools/rust-analyzer/crates/proc-macro-api/src/msg/flat.rs index af3412e90e4..5de1e59f280 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-api/src/msg/flat.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-api/src/msg/flat.rs @@ -39,7 +39,7 @@ use std::collections::VecDeque; use intern::Symbol; use rustc_hash::FxHashMap; -use serde::{Deserialize, Serialize}; +use serde_derive::{Deserialize, Serialize}; use span::{EditionedFileId, ErasedFileAstId, Span, SpanAnchor, SyntaxContextId, TextRange}; use crate::msg::EXTENDED_LEAF_DATA; |
