diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-04-14 10:34:41 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2023-04-14 10:34:41 +0200 |
| commit | 9fb1b04826ef8058dc57e36b67d086e7bbd3fa7e (patch) | |
| tree | 1b3f12a7943c9098f76a93700512e9fc368f6043 /crates/proc-macro-api/src/msg.rs | |
| parent | 3c7b6716d1ab458664a8b372b79347b9a9cacb98 (diff) | |
| download | rust-9fb1b04826ef8058dc57e36b67d086e7bbd3fa7e.tar.gz rust-9fb1b04826ef8058dc57e36b67d086e7bbd3fa7e.zip | |
Encode closing delimiter span in FlatTrees
Diffstat (limited to 'crates/proc-macro-api/src/msg.rs')
| -rw-r--r-- | crates/proc-macro-api/src/msg.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/proc-macro-api/src/msg.rs b/crates/proc-macro-api/src/msg.rs index 4040efe93f0..4b01643c2a2 100644 --- a/crates/proc-macro-api/src/msg.rs +++ b/crates/proc-macro-api/src/msg.rs @@ -12,8 +12,12 @@ use crate::ProcMacroKind; pub use crate::msg::flat::FlatTree; +// The versions of the server protocol pub const NO_VERSION_CHECK_VERSION: u32 = 0; -pub const CURRENT_API_VERSION: u32 = 1; +pub const VERSION_CHECK_VERSION: u32 = 1; +pub const ENCODE_CLOSE_SPAN_VERSION: u32 = 2; + +pub const CURRENT_API_VERSION: u32 = ENCODE_CLOSE_SPAN_VERSION; #[derive(Debug, Serialize, Deserialize)] pub enum Request { @@ -146,7 +150,7 @@ mod tests { fn test_proc_macro_rpc_works() { let tt = fixture_token_tree(); let task = ExpandMacro { - macro_body: FlatTree::new(&tt), + macro_body: FlatTree::new(&tt, CURRENT_API_VERSION), macro_name: Default::default(), attributes: None, lib: std::env::current_dir().unwrap(), @@ -158,6 +162,6 @@ mod tests { // println!("{}", json); let back: ExpandMacro = serde_json::from_str(&json).unwrap(); - assert_eq!(tt, back.macro_body.to_subtree()); + assert_eq!(tt, back.macro_body.to_subtree(CURRENT_API_VERSION)); } } |
