From 4aa7d01303964678b7a3c365c6b288f0ece3fdb8 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 29 Oct 2025 14:16:39 -0700 Subject: [PATCH 01/25] split_ffi_entry_points: initial commit; comment-preserving TokenStream printer --- tools/split_ffi_entry_points/Cargo.lock | 46 ++++ tools/split_ffi_entry_points/Cargo.toml | 8 + tools/split_ffi_entry_points/src/main.rs | 265 +++++++++++++++++++++++ 3 files changed, 319 insertions(+) create mode 100644 tools/split_ffi_entry_points/Cargo.lock create mode 100644 tools/split_ffi_entry_points/Cargo.toml create mode 100644 tools/split_ffi_entry_points/src/main.rs diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock new file mode 100644 index 0000000000..63131a1a9f --- /dev/null +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -0,0 +1,46 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "split_ffi_entry_points" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml new file mode 100644 index 0000000000..5c6a45979b --- /dev/null +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "split_ffi_entry_points" +version = "0.1.0" +edition = "2024" + +[dependencies] +syn = { version = "2.0.108", features = ["full"] } +proc-macro2 = { version = "1", features = ["span-locations"] } diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs new file mode 100644 index 0000000000..4571878f16 --- /dev/null +++ b/tools/split_ffi_entry_points/src/main.rs @@ -0,0 +1,265 @@ +use std::collections::{HashSet, BTreeSet}; +use std::env; +use std::fmt::Write as _; +use std::fs; +use std::path::Path; +use std::str::FromStr; +use proc_macro2::{TokenStream, TokenTree, Delimiter, Punct, Spacing, Span}; +use syn; + + +struct FlatTokens { + stack: Vec<(proc_macro2::token_stream::IntoIter, Delimiter, Span)>, +} + +impl FlatTokens { + pub fn new(ts: TokenStream) -> FlatTokens { + FlatTokens { + stack: vec![(ts.into_iter(), Delimiter::None, Span::call_site())], + } + } +} + +impl Iterator for FlatTokens { + type Item = Token; + fn next(&mut self) -> Option { + while let Some(&mut (ref mut it, delim, span_close)) = self.stack.last_mut() { + match it.next() { + Some(TokenTree::Group(g)) => { + // Return the open delimiter and continue with the contents of the group. + self.stack.push((g.stream().into_iter(), g.delimiter(), g.span_close())); + let open_ch = match g.delimiter() { + Delimiter::Parenthesis => '(', + Delimiter::Bracket => '[', + Delimiter::Brace => '{', + // Skip over `Delimiter::None`, and `continue` to try the next available + // token. + Delimiter::None => continue, + }; + let range = g.span_open().byte_range(); + return Some(Token { + text: open_ch.to_string().into(), + spacing: Spacing::Alone, + span: (range.start, range.end), + }); + }, + Some(tt@TokenTree::Ident(_)) | + Some(tt@TokenTree::Punct(_)) | + Some(tt@TokenTree::Literal(_)) => return Some(Token::from_token_tree(tt)), + None => { + // Pop the now-empty group and return the close delimiter. + self.stack.pop(); + let close_ch = match delim { + Delimiter::Parenthesis => ')', + Delimiter::Bracket => ']', + Delimiter::Brace => '}', + // Skip over `Delimiter::None`, and `continue` to try the next available + // token. + Delimiter::None => continue, + }; + let range = span_close.byte_range(); + return Some(Token { + text: close_ch.to_string().into(), + spacing: Spacing::Alone, + span: (range.start, range.end), + }); + }, + } + } + None + } +} + + +#[derive(Clone, PartialEq, Eq, Debug)] +struct Token { + text: Box, + /// Spacing, for punctuation tokens. This is `Spacing::Alone` for all non-`Punct` tokens. + spacing: Spacing, + span: (usize, usize), +} + +impl Token { + pub fn from_token_tree(tt: TokenTree) -> Token { + let text = tt.to_string().into_boxed_str(); + let spacing = match tt { + TokenTree::Punct(ref p) => p.spacing(), + _ => Spacing::Alone, + }; + let range = tt.span().byte_range(); + let start = range.start; + let end = range.end; + Token { text, spacing, span: (start, end) } + } +} + + +struct TokenIndex<'a> { + tokens: &'a [Token], + /// Multi-map mapping `(start, end)` to indexes in `tokens` that have that span. + index: BTreeSet<((usize, usize), usize)>, +} + +impl<'a> TokenIndex<'a> { + pub fn new(tokens: &'a [Token]) -> TokenIndex<'a> { + let mut index = BTreeSet::new(); + for (i, t) in tokens.iter().enumerate() { + index.insert((t.span, i)); + } + TokenIndex { tokens, index } + } + + pub fn find<'b>(&'b self, t: &Token) -> Option { + let (start, end) = t.span; + let lo = ((start, end), 0); + let hi = ((start, end), usize::MAX); + let mut found = None; + for &(_, i) in self.index.range(lo ..= hi) { + if self.tokens[i] == *t { + if found.is_none() { + found = Some(i); + } else { + // Found multiple identical tokens. This is ambiguous. + return None; + } + } + } + found + } +} + + +struct OutputBuffer { + s: String, + /// Whether the most recently emitted chunk had `Spacing::Joint`. + prev_was_joint: bool, + /// Index in `s` of the start of the most recent line. + prev_bol: usize, +} + +impl OutputBuffer { + pub fn new() -> OutputBuffer { + OutputBuffer { + s: String::new(), + prev_was_joint: true, + prev_bol: 0, + } + } + + /// Emit a token or a group of tokens. + /// + /// This assumes that the start of `chunk` is the start of a token (not whitespace or a non-doc + /// comment) and that the end of `chunk` is the end of a token. + pub fn emit(&mut self, chunk: &str, spacing: Spacing) { + let cur_line = &self.s[self.prev_bol..]; + if self.prev_was_joint { + // No whitespace is allowed between a `Joint` token and the subsequent token. + } else { + if cur_line.contains("//") { + // Note this can throw false positives, such as if `//` appears inside a string + // literal. But it's legal to replace any `' '` with `'\n'`; `rustfmt` will fix it + // if needed. + self.s.push('\n'); + self.prev_bol = self.s.len(); + } else { + self.s.push(' '); + } + } + + // If `chunk` contains a newline, update the beginning-of-line position. + if let Some(i) = chunk.bytes().rposition(|b| b == b'\n') { + self.prev_bol = self.s.len() + i + 1; + } + + self.s.push_str(chunk); + self.prev_was_joint = matches!(spacing, Spacing::Joint); + } + + pub fn finish(self) -> String { + self.s + } +} + +fn render_output( + orig: &str, + orig_tokens: &[Token], + ti: &TokenIndex, + ts: TokenStream, + buf: &mut OutputBuffer, +) { + if let Some(t) = orig_tokens.get(0) { + let (start_pos, _) = t.span; + buf.emit(&orig[0 .. start_pos], Spacing::Joint); + } + + struct Run { + /// Byte offset of the start of the first token in the run. + start_pos: usize, + /// Index in `orig_tokens` of the last token in the run. + end_idx: usize, + } + let mut current_run: Option = None; + for t in FlatTokens::new(ts) { + // Try to continue the current run. + if let Some(ref mut run) = current_run { + if orig_tokens.get(run.end_idx + 1) == Some(&t) { + run.end_idx += 1; + continue; + } else { + // End the current run. + let end_token = &orig_tokens[run.end_idx]; + let start_pos = run.start_pos; + let (_, end_pos) = end_token.span; + buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + current_run = None; + } + } + + // Try to start a new run. + debug_assert!(current_run.is_none()); + if let Some(idx) = ti.find(&t) { + let (start_pos, _) = t.span; + current_run = Some(Run { start_pos, end_idx: idx }); + continue; + } + + // This token is not part of a run. Emit it directly. + buf.emit(&t.text, t.spacing); + } + + if let Some(run) = current_run { + let end_token = &orig_tokens[run.end_idx]; + let start_pos = run.start_pos; + let (_, end_pos) = end_token.span; + buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + } + + if let Some(t) = orig_tokens.last() { + let (_, end_pos) = t.span; + buf.emit(&orig[end_pos .. orig.len()], Spacing::Joint); + } +} + + +fn main() { + let path = env::args().nth(1).unwrap(); + eprintln!("reading {path:?}"); + let code = fs::read_to_string(&path).unwrap(); + + let ts = TokenStream::from_str(&code).unwrap(); + let orig_tokens = FlatTokens::new(ts.clone()).collect::>(); + let mut ti = TokenIndex::new(&orig_tokens); + + let new_ts = ts.into_iter().map(|tt| match tt { + TokenTree::Ident(i) => TokenTree::Ident(proc_macro2::Ident::new( + &i.to_string().to_lowercase(), + i.span(), + )), + tt => tt, + }).collect::(); + + let mut buf = OutputBuffer::new(); + render_output(&code, &orig_tokens, &ti, new_ts, &mut buf); + println!("{}", buf.s); + //println!("{}", new_ts.to_string()); +} From cc34964dfd426ae51088e04120c515a28ccd64a5 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Fri, 31 Oct 2025 13:50:33 -0700 Subject: [PATCH 02/25] split_ffi: working implementation --- tools/split_ffi_entry_points/Cargo.lock | 3427 +++++++++++++++++++++- tools/split_ffi_entry_points/Cargo.toml | 13 +- tools/split_ffi_entry_points/src/main.rs | 451 ++- 3 files changed, 3858 insertions(+), 33 deletions(-) diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock index 63131a1a9f..e2fadff8e2 100644 --- a/tools/split_ffi_entry_points/Cargo.lock +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -2,45 +2,3446 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "borsh" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +dependencies = [ + "cfg_aliases", +] + +[[package]] +name = "boxcar" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" + +[[package]] +name = "camino" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84982c6c0ae343635a3a4ee6dedef965513735c8b183caa7289fa6e27399ebd4" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-util-schemas" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dc1a6f7b5651af85774ae5a34b4e8be397d9cf4bc063b7e6dbd99a841837830" +dependencies = [ + "semver", + "serde", + "serde-untagged", + "serde-value", + "thiserror 2.0.17", + "toml", + "unicode-xid", + "url", +] + +[[package]] +name = "cargo_metadata" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868" +dependencies = [ + "camino", + "cargo-platform", + "cargo-util-schemas", + "semver", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chalk-derive" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb4899682de915ca7c0b025bdd0a3d34c75fe12184122fda6805a7baddaa293c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "chalk-ir" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90a37d2ab99352b4caca135061e7b4ac67024b648c28ed0b787feec4bea4caed" +dependencies = [ + "bitflags 2.10.0", + "chalk-derive", +] + +[[package]] +name = "chalk-recursive" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c855be60e646664bc37c2496d3dc81ca5ef60520930e5e0f0057a0575aff6c19" +dependencies = [ + "chalk-derive", + "chalk-ir", + "chalk-solve", + "rustc-hash 1.1.0", + "tracing", +] + +[[package]] +name = "chalk-solve" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "477ac6cdfd2013e9f93b09b036c2b607a67b2e728f4777b8422d55a79e9e3a34" +dependencies = [ + "chalk-derive", + "chalk-ir", + "ena", + "indexmap", + "itertools 0.12.1", + "petgraph 0.6.5", + "rustc-hash 1.1.0", + "tracing", +] + +[[package]] +name = "countme" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" + +[[package]] +name = "cov-mark" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90863d8442510cddf7f46618c4f92413774635771a3e80830c8b30d183420b14" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive-where" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dissimilar" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921" + +[[package]] +name = "dot" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a74b6c4d4a1cff5f454164363c16b72fa12463ca6b31f4b5f2035a65fa3d5906" + +[[package]] +name = "drop_bomb" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "fst" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +dependencies = [ + "equivalent", + "hashbrown 0.16.0", + "serde", + "serde_core", +] + +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.10.0", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + +[[package]] +name = "inventory" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" +dependencies = [ + "rustversion", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jod-thread" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a037eddb7d28de1d0fc42411f501b53b75838d313908078d6698d064f3029b24" + +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + +[[package]] +name = "la-arena" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3752f229dcc5a481d60f385fa479ff46818033d881d2d801aa27dffcfb5e8306" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "libredox" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +dependencies = [ + "bitflags 2.10.0", + "libc", +] + +[[package]] +name = "line-index" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e27e0ed5a392a7f5ba0b3808a2afccff16c64933312c84b57618b49d1209bd2" +dependencies = [ + "nohash-hasher", + "text-size", +] + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "lsp-server" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6ada348dbc2703cbe7637b2dda05cff84d3da2819c24abcb305dd613e0ba2e" +dependencies = [ + "crossbeam-channel", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "lsp-types" +version = "0.95.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158c1911354ef73e8fe42da6b10c0484cb65c7f1007f28022e847706c1ab6984" +dependencies = [ + "bitflags 1.3.2", + "serde", + "serde_json", + "serde_repr", + "url", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mio" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "miow" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.10.0", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-types" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "papaya" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92dd0b07c53a0a0c764db2ace8c541dc47320dad97c2200c2a637ab9dd2328f" +dependencies = [ + "equivalent", + "seize", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "perf-event" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5396562cd2eaa828445d6d34258ae21ee1eb9d40fe626ca7f51c8dccb4af9d66" +dependencies = [ + "libc", + "perf-event-open-sys", +] + +[[package]] +name = "perf-event-open-sys" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce9bedf5da2c234fdf2391ede2b90fabf585355f33100689bc364a3ea558561a" +dependencies = [ + "libc", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset 0.4.2", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset 0.5.7", + "hashbrown 0.15.5", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro2" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "process-wrap" +version = "8.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ef4f2f0422f23a82ec9f628ea2acd12871c81a9362b02c43c1aa86acfc3ba1" +dependencies = [ + "indexmap", + "nix", + "tracing", + "windows", +] + +[[package]] +name = "protobuf" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror 1.0.69", +] + +[[package]] +name = "protobuf-support" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" +dependencies = [ + "thiserror 1.0.69", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +dependencies = [ + "bitflags 2.10.0", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "10.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0194e6e1966c23cc5fd988714f85b18d548d773e81965413555d96569931833d" +dependencies = [ + "pulldown-cmark", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ra-ap-rustc_abi" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18c877575c259d127072e9bfc41d985202262fb4d6bfdae3d1252147c2562c2" +dependencies = [ + "bitflags 2.10.0", + "ra-ap-rustc_hashes 0.123.0", + "ra-ap-rustc_index 0.123.0", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_abi" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ce5c9ea794353e02beae390c4674f74ffb23a2ad9de763469fdcef5c1026ef" +dependencies = [ + "bitflags 2.10.0", + "ra-ap-rustc_hashes 0.137.0", + "ra-ap-rustc_index 0.137.0", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_ast_ir" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1696b77af9bbfe1fcc7a09c907561061c6ef4c8bd6d5f1675b927bc62d349103" + +[[package]] +name = "ra-ap-rustc_hashes" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439ed1df3472443133b66949f81080dff88089b42f825761455463709ee1cad" +dependencies = [ + "rustc-stable-hash", +] + +[[package]] +name = "ra-ap-rustc_hashes" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c055d8b0d8a592d8cf9547495189f52c1ee5c691d28df1628253a816214e8521" +dependencies = [ + "rustc-stable-hash", +] + +[[package]] +name = "ra-ap-rustc_index" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a24fe0be21be1f8ebc21dcb40129214fb4cefb0f2753f3d46b6dbe656a1a45" +dependencies = [ + "ra-ap-rustc_index_macros 0.123.0", + "smallvec", +] + +[[package]] +name = "ra-ap-rustc_index" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08a03e3d4a452144b68f48130eda3a2894d4d79e99ddb44bdb4e0ab8c384e10" +dependencies = [ + "ra-ap-rustc_index_macros 0.137.0", + "smallvec", +] + +[[package]] +name = "ra-ap-rustc_index_macros" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844a27ddcad0116facae2df8e741fd788662cf93dc13029cd864f2b8013b81f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra-ap-rustc_index_macros" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e0446b4d65a8ce19d8fd12826c4bf2365ffa4b8fe0ee94daf5968fe36e920c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22944e31fb91e9b3e75bcbc91e37d958b8c0825a6160927f2856831d2ce83b36" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b734cfcb577d09877799a22742f1bd398be6c00bc428d9de56d48d11ece5771" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac80365383a3c749f38af567fdcfaeff3fa6ea5df3846852abbce73e943921b9" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + +[[package]] +name = "ra-ap-rustc_next_trait_solver" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39b419d2d6f7fdec7e0981b7fb7d5beb5dda7140064f1199704ec9dadbb6f73" +dependencies = [ + "derive-where", + "ra-ap-rustc_index 0.137.0", + "ra-ap-rustc_type_ir", + "ra-ap-rustc_type_ir_macros", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_parse_format" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81057891bc2063ad9e353f29462fbc47a0f5072560af34428ae9313aaa5e9d97" +dependencies = [ + "ra-ap-rustc_lexer 0.121.0", + "rustc-literal-escaper 0.0.4", +] + +[[package]] +name = "ra-ap-rustc_parse_format" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b743b0c8f795842e41b1720bbc5af6e896129fb9acf04e9785774bfb0dc5947c" +dependencies = [ + "ra-ap-rustc_lexer 0.137.0", + "rustc-literal-escaper 0.0.5", +] + +[[package]] +name = "ra-ap-rustc_pattern_analysis" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b0ee1f059b9dea0818c6c7267478926eee95ba4c7dcf89c8db32fa165d3904" +dependencies = [ + "ra-ap-rustc_index 0.123.0", + "rustc-hash 2.1.1", + "rustc_apfloat", + "smallvec", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_pattern_analysis" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf944dce80137195528f89a576f70153c2060a6f8ca49c3fa9f55f9da14ab937" +dependencies = [ + "ra-ap-rustc_index 0.137.0", + "rustc-hash 2.1.1", + "rustc_apfloat", + "smallvec", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_type_ir" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfe2722b20bc889a9d7711bd3a1f4f7b082940491241615aa643c17e0deffec" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "derive-where", + "ena", + "indexmap", + "ra-ap-rustc_ast_ir", + "ra-ap-rustc_index 0.137.0", + "ra-ap-rustc_type_ir_macros", + "rustc-hash 2.1.1", + "smallvec", + "thin-vec", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_type_ir_macros" +version = "0.137.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fad1527df26aaa77367393fae86f42818b33e02b3737a19f3846d1c7671e7f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "ra_ap_base_db" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e876bb2c3e52a8d4e6684526a2d4e81f9d028b939ee4dc5dc775fe10deb44d59" +dependencies = [ + "dashmap", + "indexmap", + "la-arena", + "ra_ap_cfg 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_query-group-macro 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_vfs 0.0.301", + "rustc-hash 2.1.1", + "salsa 0.23.0", + "salsa-macros 0.23.0", + "semver", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_base_db" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26cc7a0624b461c0c8268d8ad5f06ce56b195d4b6267250e441908778d6fe35" +dependencies = [ + "dashmap", + "indexmap", + "la-arena", + "ra_ap_cfg 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_query-group-macro 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_vfs 0.0.303", + "rustc-hash 2.1.1", + "salsa 0.24.0", + "salsa-macros 0.24.0", + "semver", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_cfg" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0b56eb4536ce6d2431932c4d337aeeaf7bb22c9249b38cbe80677b5881228f" +dependencies = [ + "ra_ap_intern 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_cfg" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418e9458bef65b4acbc521c8f5469d324a20b581df6ac0c4a26204b658021436" +dependencies = [ + "ra_ap_intern 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_edition" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bdc6cbe42c63ca78611bae82bfc8db24864f33dccc813697c5fde43a0907285" + +[[package]] +name = "ra_ap_edition" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1d9d0ab2dd4a8d8e61eec64040279e4ed259d25fecb7f41ffde3739128df85" + +[[package]] +name = "ra_ap_hir" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebffdc134eccabc17209d7760cfff7fd12ed18ab6e21188c5e084b97aa38504c" +dependencies = [ + "arrayvec", + "either", + "indexmap", + "itertools 0.14.0", + "ra_ap_base_db 0.0.301", + "ra_ap_cfg 0.0.301", + "ra_ap_hir_def 0.0.301", + "ra_ap_hir_expand 0.0.301", + "ra_ap_hir_ty 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562a7bf5b77a199cc033b2e7723e403f562ff09c1ecbb8d1e243c23655f63313" +dependencies = [ + "arrayvec", + "either", + "indexmap", + "itertools 0.14.0", + "ra-ap-rustc_type_ir", + "ra_ap_base_db 0.0.303", + "ra_ap_cfg 0.0.303", + "ra_ap_hir_def 0.0.303", + "ra_ap_hir_expand 0.0.303", + "ra_ap_hir_ty 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_def" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81d2337ef59550392d42aa997aa1105a3d6d1c2b3a583c777786bc4a0a074fd5" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "drop_bomb", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "la-arena", + "ra-ap-rustc_abi 0.123.0", + "ra-ap-rustc_parse_format 0.121.0", + "ra_ap_base_db 0.0.301", + "ra_ap_cfg 0.0.301", + "ra_ap_hir_expand 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_mbe 0.0.301", + "ra_ap_query-group-macro 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa 0.23.0", + "salsa-macros 0.23.0", + "smallvec", + "text-size", + "thin-vec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_def" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5f725eb770107597b8469abff6aa94c23a5f9e8939fe2d1aa8490f1417bc438" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "drop_bomb", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "la-arena", + "ra-ap-rustc_abi 0.137.0", + "ra-ap-rustc_parse_format 0.137.0", + "ra_ap_base_db 0.0.303", + "ra_ap_cfg 0.0.303", + "ra_ap_hir_expand 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_mbe 0.0.303", + "ra_ap_query-group-macro 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa 0.24.0", + "salsa-macros 0.24.0", + "smallvec", + "text-size", + "thin-vec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_expand" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf8ececb2743a819d8299a408e17f164dd1a1004d65936b3d5493b55330326" +dependencies = [ + "cov-mark", + "either", + "itertools 0.14.0", + "ra_ap_base_db 0.0.301", + "ra_ap_cfg 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_mbe 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_query-group-macro 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_syntax-bridge 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "salsa 0.23.0", + "salsa-macros 0.23.0", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_expand" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6180bfc6ac40309111dac062acf2aed36cfb918fcfa105b355c127b296ef23" +dependencies = [ + "cov-mark", + "either", + "itertools 0.14.0", + "ra_ap_base_db 0.0.303", + "ra_ap_cfg 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_mbe 0.0.303", + "ra_ap_parser 0.0.303", + "ra_ap_query-group-macro 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_syntax-bridge 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "salsa 0.24.0", + "salsa-macros 0.24.0", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_ty" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc004e1099ba766a61500c27d34eb5cd336430d0a89a9620315a90d7a202a73a" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "chalk-derive", + "chalk-ir", + "chalk-recursive", + "chalk-solve", + "cov-mark", + "either", + "ena", + "indexmap", + "itertools 0.14.0", + "la-arena", + "oorandom", + "ra-ap-rustc_abi 0.123.0", + "ra-ap-rustc_index 0.123.0", + "ra-ap-rustc_pattern_analysis 0.123.0", + "ra_ap_base_db 0.0.301", + "ra_ap_hir_def 0.0.301", + "ra_ap_hir_expand 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_query-group-macro 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa 0.23.0", + "salsa-macros 0.23.0", + "scoped-tls", + "smallvec", + "tracing", + "triomphe", + "typed-arena", +] + +[[package]] +name = "ra_ap_hir_ty" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9375925321b74040bff60dee1866facdabea1cd33fb2bea24ad419e8392b1d" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "either", + "ena", + "indexmap", + "itertools 0.14.0", + "la-arena", + "oorandom", + "petgraph 0.8.3", + "ra-ap-rustc_abi 0.137.0", + "ra-ap-rustc_ast_ir", + "ra-ap-rustc_index 0.137.0", + "ra-ap-rustc_next_trait_solver", + "ra-ap-rustc_pattern_analysis 0.137.0", + "ra-ap-rustc_type_ir", + "ra_ap_base_db 0.0.303", + "ra_ap_hir_def 0.0.303", + "ra_ap_hir_expand 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_macros", + "ra_ap_query-group-macro 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa 0.24.0", + "salsa-macros 0.24.0", + "scoped-tls", + "smallvec", + "tracing", + "tracing-subscriber", + "tracing-tree", + "triomphe", + "typed-arena", +] + +[[package]] +name = "ra_ap_ide" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb3d866d218464f69fcd3b897c5f72e80920c7307fdce68b5fe447b2ccec8d6" +dependencies = [ + "arrayvec", + "cov-mark", + "dot", + "either", + "itertools 0.14.0", + "nohash-hasher", + "oorandom", + "pulldown-cmark", + "pulldown-cmark-to-cmark", + "ra_ap_cfg 0.0.301", + "ra_ap_hir 0.0.301", + "ra_ap_ide_assists", + "ra_ap_ide_completion", + "ra_ap_ide_db 0.0.301", + "ra_ap_ide_diagnostics", + "ra_ap_ide_ssr", + "ra_ap_profile 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_toolchain 0.0.301", + "rustc_apfloat", + "smallvec", + "tracing", + "triomphe", + "url", +] + +[[package]] +name = "ra_ap_ide_assists" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd12346ac54c6c723966b034ac658984f845eb71386e1939db759df3f8e3a803" +dependencies = [ + "cov-mark", + "either", + "itertools 0.14.0", + "ra_ap_hir 0.0.301", + "ra_ap_ide_db 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "smallvec", + "tracing", +] + +[[package]] +name = "ra_ap_ide_completion" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "737d5176342463e795fe0015d924d784720ea8c3c9573c289b836063d28885dd" +dependencies = [ + "cov-mark", + "itertools 0.14.0", + "ra_ap_base_db 0.0.301", + "ra_ap_hir 0.0.301", + "ra_ap_ide_db 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "smallvec", + "tracing", +] + +[[package]] +name = "ra_ap_ide_db" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2acb572d6dbeb1c96d0339890ba91298b8f5f0ab22648da4ee2b4ab77dbc3fe" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "crossbeam-channel", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "line-index", + "memchr", + "nohash-hasher", + "ra_ap_base_db 0.0.301", + "ra_ap_hir 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_profile 0.0.301", + "ra_ap_query-group-macro 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_vfs 0.0.301", + "rayon", + "rustc-hash 2.1.1", + "salsa 0.23.0", + "salsa-macros 0.23.0", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_ide_db" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8cfe40da7fba5649834b57f78d73a82312e879df0ab92e9db2f7ddde4a2fd5" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "crossbeam-channel", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "line-index", + "memchr", + "nohash-hasher", + "ra_ap_base_db 0.0.303", + "ra_ap_hir 0.0.303", + "ra_ap_macros", + "ra_ap_parser 0.0.303", + "ra_ap_profile 0.0.303", + "ra_ap_query-group-macro 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_test_fixture", + "ra_ap_test_utils", + "ra_ap_vfs 0.0.303", + "rayon", + "rustc-hash 2.1.1", + "salsa 0.24.0", + "salsa-macros 0.24.0", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_ide_diagnostics" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "010f0d861cd2d8b523ce7f4c7f4f063caa1bf9e73c18884f279b457f3c148fa6" +dependencies = [ + "cov-mark", + "either", + "itertools 0.14.0", + "ra_ap_cfg 0.0.301", + "ra_ap_hir 0.0.301", + "ra_ap_ide_db 0.0.301", + "ra_ap_paths 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "serde_json", + "tracing", +] + +[[package]] +name = "ra_ap_ide_ssr" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e618b35c692c50288810ff2097cc89d628bff0b2c1c83a76353775b6dfa3a21f" +dependencies = [ + "cov-mark", + "itertools 0.14.0", + "ra_ap_hir 0.0.301", + "ra_ap_ide_db 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_syntax 0.0.301", +] + +[[package]] +name = "ra_ap_intern" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14586c2c4781b69fdd0c505972d9bff8c162a8740537a3ee506faff686d9a20d" +dependencies = [ + "dashmap", + "hashbrown 0.14.5", + "rustc-hash 2.1.1", + "triomphe", +] + +[[package]] +name = "ra_ap_intern" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a0094489d0a903d31629c573a9ae58a71667266a641d8b0ba2028fc528685d" +dependencies = [ + "dashmap", + "hashbrown 0.14.5", + "rustc-hash 2.1.1", + "triomphe", +] + +[[package]] +name = "ra_ap_load-cargo" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ce5546b3e3414507ab4d12348d0a28748062e33a1448895c68466d0b015503" +dependencies = [ + "anyhow", + "crossbeam-channel", + "itertools 0.14.0", + "ra_ap_hir_expand 0.0.301", + "ra_ap_ide_db 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_proc_macro_api 0.0.301", + "ra_ap_project_model 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_tt 0.0.301", + "ra_ap_vfs 0.0.301", + "ra_ap_vfs-notify 0.0.301", + "tracing", +] + +[[package]] +name = "ra_ap_load-cargo" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cca051acb758aeb728244aa6d0afd9144f3f9f3cff499546ec87c26df32af38" +dependencies = [ + "anyhow", + "crossbeam-channel", + "itertools 0.14.0", + "ra_ap_hir_expand 0.0.303", + "ra_ap_ide_db 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_proc_macro_api 0.0.303", + "ra_ap_project_model 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_tt 0.0.303", + "ra_ap_vfs 0.0.303", + "ra_ap_vfs-notify 0.0.303", + "tracing", +] + +[[package]] +name = "ra_ap_macros" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8536504d15fa9ac51bda8db57254420ea76428134c1f45e92948d1ba7b39b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "ra_ap_mbe" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67333c6405797cb64aafb994b9a179157b30beeda2352e203e800be2b184a22d" +dependencies = [ + "arrayvec", + "cov-mark", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_intern 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax-bridge 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "smallvec", +] + +[[package]] +name = "ra_ap_mbe" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e18d72ff55ba4916f0d5a80efb8b2f97f70f205fcea06432e20ba6544e01c77f" +dependencies = [ + "arrayvec", + "cov-mark", + "ra-ap-rustc_lexer 0.137.0", + "ra_ap_intern 0.0.303", + "ra_ap_parser 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax-bridge 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "smallvec", +] + +[[package]] +name = "ra_ap_parser" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b92b8b147c0826b83e70ad44e3c98e94201fc93e1f09396c43b4d7958c22a" +dependencies = [ + "drop_bomb", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_edition 0.0.301", + "rustc-literal-escaper 0.0.4", + "tracing", +] + +[[package]] +name = "ra_ap_parser" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f9431e009f6d234d72dc7497ae403df552a04390fa21ceec16086de2b077a6" +dependencies = [ + "drop_bomb", + "ra-ap-rustc_lexer 0.137.0", + "ra_ap_edition 0.0.303", + "rustc-literal-escaper 0.0.4", + "tracing", + "winnow", +] + +[[package]] +name = "ra_ap_paths" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4991f3d57fac0def7822bebfeb159c8d7b58c824bf82044b765c54f2c0971e2" +dependencies = [ + "camino", +] + +[[package]] +name = "ra_ap_paths" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1daa4fe55c2e5dd51b5e1a8dcb4b2a9017ac6f6c8b79db1676f45502dfb0" +dependencies = [ + "camino", +] + +[[package]] +name = "ra_ap_proc_macro_api" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45db9e2df587d56f0738afa89fb2c100ff7c1e9cbe49e07f6a8b62342832211b" +dependencies = [ + "indexmap", + "ra_ap_intern 0.0.301", + "ra_ap_paths 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", + "serde", + "serde_derive", + "serde_json", + "tracing", +] + +[[package]] +name = "ra_ap_proc_macro_api" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ecf05a97bba2b780f33f62e475bae2dedcb0f5ffdfd572a5da1ec249ffc79ed" +dependencies = [ + "indexmap", + "ra_ap_intern 0.0.303", + "ra_ap_paths 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "serde", + "serde_derive", + "serde_json", + "tracing", +] + +[[package]] +name = "ra_ap_profile" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19981637b8ee4160e228c815a7fef3944b5c0555d6af41a931be92d68978bc6c" +dependencies = [ + "cfg-if", + "libc", + "perf-event", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_profile" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "407d68afa51ca70cb48b4c5ca1a5a890d47aeacd8b24940ead8513fe3c4509cb" +dependencies = [ + "cfg-if", + "libc", + "perf-event", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_project_model" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bda0769fd6ca949fdd5917acb68ddc2c143745614ddd94ef38b376838611cf8" +dependencies = [ + "anyhow", + "cargo_metadata", + "itertools 0.14.0", + "la-arena", + "ra_ap_base_db 0.0.301", + "ra_ap_cfg 0.0.301", + "ra_ap_intern 0.0.301", + "ra_ap_paths 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_toolchain 0.0.301", + "rustc-hash 2.1.1", + "semver", + "serde", + "serde_derive", + "serde_json", + "temp-dir", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_project_model" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e4a306ddd78ba11e740b7b07d58cae31f2705b9f3eca8ea644536646babef2" +dependencies = [ + "anyhow", + "cargo_metadata", + "itertools 0.14.0", + "la-arena", + "ra_ap_base_db 0.0.303", + "ra_ap_cfg 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_paths 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_toolchain 0.0.303", + "rustc-hash 2.1.1", + "semver", + "serde", + "serde_derive", + "serde_json", + "temp-dir", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_query-group-macro" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f182a4b05f004eabaa83250a5de7ea3a13a92c88f3cbe98bfa1880cd9fbce0a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra_ap_query-group-macro" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56edf902b8934c7b35ce329b2e32febe9fba579df826b099627c23c77bf3bf4b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra_ap_rust-analyzer" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff9fabbc05c2f4b884293715ec4cc05101f942da71a5be3935145742eba2b399" +dependencies = [ + "anyhow", + "base64", + "cargo_metadata", + "crossbeam-channel", + "dirs", + "dissimilar", + "indexmap", + "itertools 0.14.0", + "lsp-server", + "lsp-types", + "memchr", + "nohash-hasher", + "num_cpus", + "oorandom", + "parking_lot", + "process-wrap", + "ra_ap_cfg 0.0.301", + "ra_ap_hir 0.0.301", + "ra_ap_hir_def 0.0.301", + "ra_ap_hir_ty 0.0.301", + "ra_ap_ide", + "ra_ap_ide_completion", + "ra_ap_ide_db 0.0.301", + "ra_ap_ide_ssr", + "ra_ap_intern 0.0.301", + "ra_ap_load-cargo 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_paths 0.0.301", + "ra_ap_proc_macro_api 0.0.301", + "ra_ap_profile 0.0.301", + "ra_ap_project_model 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_toolchain 0.0.301", + "ra_ap_vfs 0.0.301", + "ra_ap_vfs-notify 0.0.301", + "rayon", + "rustc-hash 2.1.1", + "scip", + "semver", + "serde", + "serde_derive", + "serde_json", + "tenthash", + "toml", + "tracing", + "tracing-subscriber", + "tracing-tree", + "triomphe", + "walkdir", + "windows-sys 0.60.2", + "xflags", +] + +[[package]] +name = "ra_ap_span" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6f9fa2de07f5cccf431674b90e82c1fe1ea2339db3b3869eec44d135de09a4" +dependencies = [ + "hashbrown 0.14.5", + "la-arena", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_vfs 0.0.301", + "rustc-hash 2.1.1", + "salsa 0.23.0", + "text-size", +] + +[[package]] +name = "ra_ap_span" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cbb509f1df4ad6a106d4a1027c7d9f278772b0a60bab99352680b7c483ed6f" +dependencies = [ + "hashbrown 0.14.5", + "la-arena", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_vfs 0.0.303", + "rustc-hash 2.1.1", + "salsa 0.24.0", + "text-size", +] + +[[package]] +name = "ra_ap_stdx" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa770adb32896fcba934b464ac3bd179163ba2b0766e275eed5b4e262e08492b" +dependencies = [ + "crossbeam-channel", + "crossbeam-utils", + "itertools 0.14.0", + "jod-thread", + "libc", + "miow", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_stdx" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c0eafb9310f5803041cdc548d62135a22d16e7e90b307b4f8c24089353926e" +dependencies = [ + "crossbeam-channel", + "crossbeam-utils", + "itertools 0.14.0", + "jod-thread", + "libc", + "miow", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_syntax" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9e1393281ad5c635239d353ed3cfbf28c8d0af03d0c61a3b24b31d1143b17f" +dependencies = [ + "either", + "itertools 0.14.0", + "ra_ap_parser 0.0.301", + "ra_ap_stdx 0.0.301", + "rowan", + "rustc-hash 2.1.1", + "rustc-literal-escaper 0.0.4", + "smol_str", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_syntax" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2661f741e413aa41fdeacf5a2954467991a25bcd26a706d42065b98c7ce75" +dependencies = [ + "either", + "itertools 0.14.0", + "ra_ap_parser 0.0.303", + "ra_ap_stdx 0.0.303", + "rowan", + "rustc-hash 2.1.1", + "rustc-literal-escaper 0.0.4", + "smol_str", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_syntax-bridge" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684e6ff1008ee5340335888f0453d94bb38950f110059a51f1818c7f6a56a807" +dependencies = [ + "ra_ap_intern 0.0.301", + "ra_ap_parser 0.0.301", + "ra_ap_span 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_syntax 0.0.301", + "ra_ap_tt 0.0.301", + "rustc-hash 2.1.1", +] + +[[package]] +name = "ra_ap_syntax-bridge" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61cb0c073d97a59126c8cd134a73ffef559527f817ca7fb7d56ab18371ae0a47" +dependencies = [ + "ra_ap_intern 0.0.303", + "ra_ap_parser 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_syntax 0.0.303", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", +] + +[[package]] +name = "ra_ap_test_fixture" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0908ed6fafd88a3890cba99ae95e09958f5b8b90bccb6a0beb62660ae4a21e2b" +dependencies = [ + "ra_ap_base_db 0.0.303", + "ra_ap_cfg 0.0.303", + "ra_ap_hir_expand 0.0.303", + "ra_ap_intern 0.0.303", + "ra_ap_paths 0.0.303", + "ra_ap_span 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_test_utils", + "ra_ap_tt 0.0.303", + "rustc-hash 2.1.1", + "triomphe", +] + +[[package]] +name = "ra_ap_test_utils" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c957dcd3436b781a4971ac45238b1570a9755b76b275b1b4c1154d4fd6f96e" +dependencies = [ + "dissimilar", + "ra_ap_paths 0.0.303", + "ra_ap_profile 0.0.303", + "ra_ap_stdx 0.0.303", + "rustc-hash 2.1.1", + "text-size", +] + +[[package]] +name = "ra_ap_toolchain" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61969c5f72af03a9837e077c2d939d87a5c863623725c461777c352664a3bb03" +dependencies = [ + "camino", + "home", +] + +[[package]] +name = "ra_ap_toolchain" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82391f18d374e96604fd62ba2bb7c492ebc1cc50ec42d3c3fe7dbaecc6fbcd79" +dependencies = [ + "camino", + "home", +] + +[[package]] +name = "ra_ap_tt" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb87c7b35572c18a580ea811e970b94875fad5ac7cfa8644266a59081044f959" +dependencies = [ + "arrayvec", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_intern 0.0.301", + "ra_ap_stdx 0.0.301", + "text-size", +] + +[[package]] +name = "ra_ap_tt" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1823b5d2253aad16edd250db04221ef41a85bbf5fee1e2a658ccf2d8f6db3e33" +dependencies = [ + "arrayvec", + "ra-ap-rustc_lexer 0.137.0", + "ra_ap_intern 0.0.303", + "ra_ap_stdx 0.0.303", + "text-size", +] + +[[package]] +name = "ra_ap_vfs" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c174d6b9b7a7f54687df7e00c3e75ed6f082a7943a9afb1d54f33c0c12773de" +dependencies = [ + "crossbeam-channel", + "fst", + "indexmap", + "nohash-hasher", + "ra_ap_paths 0.0.301", + "ra_ap_stdx 0.0.301", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_vfs" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ec71023aa4b47ecfa2b71fc47a8738acfc92794f059c6ffcc67a13fd310237" +dependencies = [ + "crossbeam-channel", + "fst", + "indexmap", + "nohash-hasher", + "ra_ap_paths 0.0.303", + "ra_ap_stdx 0.0.303", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_vfs-notify" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f6fce8d47c7ce9b8f2cd0e5a55f8fc4878d6043e61f46cde4391d3a5c6086f" +dependencies = [ + "crossbeam-channel", + "notify", + "ra_ap_paths 0.0.301", + "ra_ap_stdx 0.0.301", + "ra_ap_vfs 0.0.301", + "rayon", + "rustc-hash 2.1.1", + "tracing", + "walkdir", +] + +[[package]] +name = "ra_ap_vfs-notify" +version = "0.0.303" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7ae4eaed5bc7604327f8d3a359f197a780e58f413de9a3cc23dac68aac02e7" +dependencies = [ + "crossbeam-channel", + "notify", + "ra_ap_paths 0.0.303", + "ra_ap_stdx 0.0.303", + "ra_ap_vfs 0.0.303", + "rayon", + "rustc-hash 2.1.1", + "tracing", + "walkdir", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom", + "libredox", + "thiserror 2.0.17", +] + +[[package]] +name = "rowan" +version = "0.15.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a58fa8a7ccff2aec4f39cc45bf5f985cec7125ab271cf681c279fd00192b49" +dependencies = [ + "countme", + "hashbrown 0.14.5", + "memoffset", + "rustc-hash 1.1.0", + "text-size", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-literal-escaper" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" + +[[package]] +name = "rustc-literal-escaper" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b" + +[[package]] +name = "rustc-stable-hash" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781442f29170c5c93b7185ad559492601acdc71d5bb0706f5868094f45cfcd08" + +[[package]] +name = "rustc_apfloat" +version = "0.2.3+llvm-462a31f5a5ab" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486c2179b4796f65bfe2ee33679acf0927ac83ecf583ad6c91c3b4570911b9ad" +dependencies = [ + "bitflags 2.10.0", + "smallvec", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "salsa" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e235afdb8e510f38a07138fbe5a0b64691894358a9c0cbd813b1aade110efc9" +dependencies = [ + "boxcar", + "crossbeam-queue", + "crossbeam-utils", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "intrusive-collections", + "papaya", + "parking_lot", + "portable-atomic", + "rayon", + "rustc-hash 2.1.1", + "salsa-macro-rules 0.23.0", + "salsa-macros 0.23.0", + "smallvec", + "thin-vec", + "tracing", +] + +[[package]] +name = "salsa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27956164373aeec733ac24ff1736de8541234e3a8e7e6f916b28175b5752af3b" +dependencies = [ + "boxcar", + "crossbeam-queue", + "crossbeam-utils", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "intrusive-collections", + "inventory", + "parking_lot", + "portable-atomic", + "rayon", + "rustc-hash 2.1.1", + "salsa-macro-rules 0.24.0", + "salsa-macros 0.24.0", + "smallvec", + "thin-vec", + "tracing", +] + +[[package]] +name = "salsa-macro-rules" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2edb86a7e9c91f6d30c9ce054312721dbe773a162db27bbfae834d16177b30ce" + +[[package]] +name = "salsa-macro-rules" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca3b9d6e47c08b5de4b218e0c5f7ec910b51bce6314e651c8e7b9d154d174da" + +[[package]] +name = "salsa-macros" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0778d6e209051bc4e75acfe83bcd7848601ec3dbe9c3dbb982829020e9128af" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "salsa-macros" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6337b62f2968be6b8afa30017d7564ecbde6832ada47ed2261fb14d0fd402ff4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scip" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2b449a5e4660ce817676a0871cd1b4e2ff1023e33a1ac046670fa594b543a2" +dependencies = [ + "protobuf", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seize" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "indexmap", + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smol_str" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3498b0a27f93ef1402f20eefacfaa1691272ac4eca1cdc8c596cb0a245d6cbf5" +dependencies = [ + "borsh", + "serde_core", +] + +[[package]] +name = "split_ffi_entry_points" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "ra_ap_hir 0.0.303", + "ra_ap_hir_ty 0.0.303", + "ra_ap_ide_db 0.0.303", + "ra_ap_load-cargo 0.0.303", + "ra_ap_project_model 0.0.303", + "ra_ap_rust-analyzer", + "ra_ap_syntax 0.0.303", + "ra_ap_vfs 0.0.303", + "syn", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "syn" +version = "2.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "temp-dir" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83176759e9416cf81ee66cb6508dbfe9c96f20b8b56265a39917551c23c70964" + +[[package]] +name = "tenthash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c4bcc0a4fa333239f43662d15fbf995f384b2aeaf89c4ab4c83353d6cbb952" + +[[package]] +name = "text-size" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" + +[[package]] +name = "thin-vec" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" + +[[package]] +name = "time-macros" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ - "unicode-ident", + "num-conv", + "time-core", ] [[package]] -name = "quote" -version = "1.0.40" +name = "tinystr" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", + "quote", + "syn", ] [[package]] -name = "split_ffi_entry_points" +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "sharded-slab", + "thread_local", + "time", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "tracing-tree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac87aa03b6a4d5a7e4810d1a80c19601dbe0f8a837e9177f23af721c7ba7beec" +dependencies = [ + "nu-ansi-term", + "tracing-core", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "triomphe" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd69c5aa8f924c7519d6372789a74eac5b94fb0f8fcf0d4a97eb0bfc3e785f39" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-threading" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "xflags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9e15fbb3de55454b0106e314b28e671279009b363e6f1d8e39fdc3bf048944" +dependencies = [ + "xflags-macros", +] + +[[package]] +name = "xflags-macros" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "672423d4fea7ffa2f6c25ba60031ea13dc6258070556f125cc4d790007d4a155" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", + "quote", "syn", + "synstructure", ] [[package]] -name = "syn" -version = "2.0.108" +name = "zerofrom" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", + "synstructure", ] [[package]] -name = "unicode-ident" -version = "1.0.19" +name = "zerotrie" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index 5c6a45979b..7215389cc8 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -4,5 +4,16 @@ version = "0.1.0" edition = "2024" [dependencies] -syn = { version = "2.0.108", features = ["full"] } +syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } +quote = "1" + +ra_ap_rust-analyzer = "=0.0.301" +# Cargo will pick versions of the remaining deps to match ra_ap_rust-analyzer. +ra_ap_hir = "*" +ra_ap_hir_ty = "*" +ra_ap_ide_db = "*" +ra_ap_load-cargo = "*" +ra_ap_project_model = "*" +ra_ap_syntax = "*" +ra_ap_vfs = "*" diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index 4571878f16..311191c29f 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -2,10 +2,24 @@ use std::collections::{HashSet, BTreeSet}; use std::env; use std::fmt::Write as _; use std::fs; +use std::mem; use std::path::Path; use std::str::FromStr; use proc_macro2::{TokenStream, TokenTree, Delimiter, Punct, Spacing, Span}; +use quote::ToTokens; +use ra_ap_hir::{Semantics, ModuleDef, HasAttrs, HirFileId}; +use ra_ap_hir::sym; +//use ra_ap_hir_ty::HirDatabase; +use ra_ap_ide_db::RootDatabase; +use ra_ap_ide_db::source_change::SourceChangeBuilder; +use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; +use ra_ap_project_model::CargoConfig; +use ra_ap_syntax::{AstNode, SyntaxNode, SyntaxKind, TextRange, TextSize}; +use ra_ap_syntax::ast::{self, HasAttrs as _}; +use ra_ap_syntax::syntax_editor::{SyntaxEditor, Position}; use syn; +use syn::spanned::Spanned; +use syn::visit_mut::{self, VisitMut}; struct FlatTokens { @@ -241,25 +255,424 @@ fn render_output( } +struct AddDerivedItemVisitor(F); + +impl Option> AddDerivedItemVisitor { + fn visit_items(&mut self, items: &mut Vec) { + eprintln!("parent has {} items", items.len()); + let new_items = Vec::with_capacity(items.len()); + let old_items = mem::replace(items, new_items); + for mut item in old_items { + let derived_item = (self.0)(&mut item); + items.push(item); + if let Some(derived_item) = derived_item { + items.push(derived_item); + } + } + } +} + +impl Option> VisitMut for AddDerivedItemVisitor { + fn visit_item_mod_mut(&mut self, im: &mut syn::ItemMod) { + eprintln!("visit mod"); + let items = match im.content { + Some((_, ref mut x)) => x, + None => return, + }; + self.visit_items(items); + visit_mut::visit_item_mod_mut(self, im); + } + + fn visit_file_mut(&mut self, f: &mut syn::File) { + eprintln!("visit file"); + self.visit_items(&mut f.items); + visit_mut::visit_file_mut(self, f); + } +} + +fn add_ffi_wrapper( + db: &RootDatabase, + sema: &Semantics, + root: SyntaxNode, + item: &mut syn::Item, +) -> Option { + let fn_item = match *item { + syn::Item::Fn(ref mut x) => x, + _ => return None, + }; + let fn_name = fn_item.sig.ident.to_string(); + + // Example of gathering semantic information from rust-analyzer: + /* + let range = span_to_text_range(fn_item.span()); + let cover = root.covering_element(range); + // If this assert fails, we might need to look for a `FN` ancestor of `cover` instead. + debug_assert_eq!(cover.kind(), SyntaxKind::FN); + let cover = cover.into_node().unwrap(); + let f_ast = ast::Fn::cast(cover).unwrap(); + eprintln!("f_ast = {f_ast:?}"); + + let f = sema.to_fn_def(&f_ast).unwrap(); + eprintln!("f = {f:?}"); + + let attrs = f.attrs(db); + // etc... + */ + + // Walk over the attributes of `fn_item`, sorting them into attrs that should remain on the + // inner function and ones that should be moved or copied onto the newly-generated wrapper. + let mut inner_attrs = Vec::with_capacity(fn_item.attrs.len()); + let mut wrapper_attrs = Vec::new(); + let mut need_wrapper = false; + + for mut attr in mem::take(&mut fn_item.attrs) { + eprintln!("old meta = {}", attr.meta.to_token_stream()); + let mut pm = ParsedMeta::from(attr.meta); + match pm { + ParsedMeta::Meta(..) => eprintln!("got meta"), + ParsedMeta::Unsafe(..) => eprintln!("got unsafe"), + ParsedMeta::CfgAttr(..) => eprintln!("got cfg_attr"), + ParsedMeta::NoMangle(..) => eprintln!("got no_mangle"), + ParsedMeta::ExportName(..) => eprintln!("got export_name"), + } + + let mut move_to_wrapper = false; + pm.with_innermost_mut(&mut |pm| { + match pm { + ParsedMeta::NoMangle(..) => { + move_to_wrapper = true; + *pm = ParsedMeta::ExportName(ParsedMetaExportName { + ident: syn::Ident::new("export_name", Span::call_site()), + eq: syn::Token![=](Span::call_site()), + name: syn::LitStr::new(&fn_name, Span::call_site()), + }); + }, + ParsedMeta::ExportName(..) => { + move_to_wrapper = true; + }, + _ => {}, + } + }); + + attr.meta = pm.into(); + eprintln!("new meta = {}", attr.meta.to_token_stream()); + eprintln!(" moved = {move_to_wrapper}"); + + if move_to_wrapper { + wrapper_attrs.push(attr); + need_wrapper = true; + } else { + inner_attrs.push(attr); + } + } + + fn_item.attrs = inner_attrs; + + if !need_wrapper { + return None; + } + + let wrapper_name = format!("{fn_name}_ffi"); + let mut fn_wrapper = syn::ItemFn { + attrs: wrapper_attrs, + vis: fn_item.vis.clone(), + sig: fn_item.sig.clone(), + block: Box::new(syn::Block { + brace_token: syn::token::Brace::default(), + stmts: Vec::new(), + }), + }; + fn_wrapper.sig.ident = syn::Ident::new(&wrapper_name, Span::call_site()); + + let mut arg_exprs = Vec::new(); + for (i, arg) in fn_wrapper.sig.inputs.iter_mut().enumerate() { + let ident = match *arg { + syn::FnArg::Receiver(_) => syn::Ident::new("self", Span::call_site()), + syn::FnArg::Typed(ref mut pt) => { + match *pt.pat { + syn::Pat::Ident(ref pi) => pi.ident.clone(), + _ => { + let ident = syn::Ident::new(&format!("arg{i}"), Span::call_site()); + *pt.pat = syn::Pat::Ident(syn::PatIdent { + attrs: Vec::new(), + by_ref: None, + mutability: None, + ident: ident.clone(), + subpat: None, + }); + ident + }, + } + }, + }; + let expr = syn::Expr::Path(syn::ExprPath { + attrs: Vec::new(), + qself: None, + path: syn::Path::from(ident), + }); + arg_exprs.push(expr); + } + + let wrapper_expr = syn::Expr::Call(syn::ExprCall { + attrs: Vec::new(), + func: Box::new(syn::Expr::Path(syn::ExprPath { + attrs: Vec::new(), + qself: None, + path: syn::Path::from(syn::Ident::new(&fn_name, Span::call_site())), + })), + paren_token: syn::token::Paren::default(), + args: arg_exprs.into_iter().collect(), + }); + let wrapper_stmt = syn::Stmt::Expr(wrapper_expr, None); + fn_wrapper.block.stmts.push(wrapper_stmt); + + Some(fn_wrapper.into()) +} + +/* +fn span_to_text_range(span: Span) -> TextRange { + let span_range = span.byte_range(); + let lo = TextSize::try_from(span_range.start).unwrap(); + let hi = TextSize::try_from(span_range.end).unwrap(); + TextRange::new(lo, hi) +} +*/ + + +// Helpers for dealing with nested meta items in attrs, like `#[unsafe(no_mangle)]` + +#[derive(Clone)] +enum ParsedMeta { + Meta(syn::Meta), + Unsafe(Box), + CfgAttr(Box), + NoMangle(ParsedMetaNoMangle), + ExportName(ParsedMetaExportName), +} + +#[derive(Clone)] +struct ParsedMetaUnsafe { + ident: syn::Ident, + paren: syn::token::Paren, + inner: ParsedMeta, +} + +#[derive(Clone)] +struct ParsedMetaCfgAttr { + ident: syn::Ident, + paren: syn::token::Paren, + cond: syn::Meta, + comma: syn::Token![,], + inner: ParsedMeta, +} + +#[derive(Clone)] +struct ParsedMetaNoMangle { + ident: syn::Ident, +} + +#[derive(Clone)] +struct ParsedMetaExportName { + ident: syn::Ident, + eq: syn::Token![=], + name: syn::LitStr, +} + +impl ParsedMeta { + pub fn parse(meta: &syn::Meta) -> syn::Result { + let ident = meta.path().require_ident()?; + let ident_str = ident.to_string(); + match ident_str.as_str() { + "unsafe" => { + let ml = meta.require_list()?; + let ident = ml.path.require_ident()?.clone(); + let paren = match ml.delimiter { + syn::MacroDelimiter::Paren(p) => p, + _ => return Err( + syn::Error::new(ml.delimiter.span().open(), "expected parens")), + }; + let meta: syn::Meta = syn::parse2(ml.tokens.clone())?; + let inner = ParsedMeta::from(meta); + Ok(ParsedMeta::Unsafe(Box::new(ParsedMetaUnsafe { ident, paren, inner }))) + }, + "no_mangle" => { + let _ = meta.require_path_only()?; + let ident = ident.clone(); + Ok(ParsedMeta::NoMangle(ParsedMetaNoMangle { ident })) + }, + "export_name" => { + let mnv = meta.require_name_value()?; + let ident = mnv.path.require_ident()?.clone(); + let eq = mnv.eq_token; + let expr_lit = match mnv.value { + syn::Expr::Lit(ref el) => el, + _ => return Err(syn::Error::new(mnv.value.span(), "expected Lit")), + }; + let syn::ExprLit { ref attrs, ref lit } = *expr_lit; + if attrs.len() > 0 { + return Err(syn::Error::new(expr_lit.span(), "name must not have attrs")); + } + let name = match *lit { + syn::Lit::Str(ref ls) => ls.clone(), + _ => return Err(syn::Error::new(lit.span(), "expected Str")), + }; + Ok(ParsedMeta::ExportName(ParsedMetaExportName { ident, eq, name })) + }, + _ => Ok(ParsedMeta::Meta(meta.clone())), + } + } + + pub fn with_innermost_mut(&mut self, f: &mut impl FnMut(&mut ParsedMeta)) { + match *self { + ParsedMeta::Meta(..) | + ParsedMeta::NoMangle(..) | + ParsedMeta::ExportName(..) => f(self), + ParsedMeta::CfgAttr(ref mut pmca) => pmca.inner.with_innermost_mut(f), + ParsedMeta::Unsafe(ref mut pmu) => pmu.inner.with_innermost_mut(f), + } + } +} + +impl From for ParsedMeta { + fn from(meta: syn::Meta) -> ParsedMeta { + match Self::parse(&meta) { + Ok(x) => x, + Err(e) => { + eprintln!("warning: failed to parse `{}`: {e}", meta.to_token_stream()); + ParsedMeta::Meta(meta) + }, + } + } +} + +impl From for syn::Meta { + fn from(pm: ParsedMeta) -> syn::Meta { + syn::parse2(pm.into_token_stream()).unwrap() + } +} + +impl ToTokens for ParsedMeta { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + ParsedMeta::Meta(ref x) => x.to_tokens(tokens), + ParsedMeta::Unsafe(ref x) => x.to_tokens(tokens), + ParsedMeta::CfgAttr(ref x) => x.to_tokens(tokens), + ParsedMeta::NoMangle(ref x) => x.to_tokens(tokens), + ParsedMeta::ExportName(ref x) => x.to_tokens(tokens), + } + } +} + +impl ToTokens for ParsedMetaUnsafe { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.paren.surround(tokens, |tokens| { + self.inner.to_tokens(tokens); + }); + } +} + +impl ToTokens for ParsedMetaCfgAttr { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.paren.surround(tokens, |tokens| { + self.cond.to_tokens(tokens); + self.comma.to_tokens(tokens); + self.inner.to_tokens(tokens); + }); + } +} + +impl ToTokens for ParsedMetaNoMangle { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + } +} + +impl ToTokens for ParsedMetaExportName { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.eq.to_tokens(tokens); + self.name.to_tokens(tokens); + } +} + + fn main() { let path = env::args().nth(1).unwrap(); - eprintln!("reading {path:?}"); - let code = fs::read_to_string(&path).unwrap(); - - let ts = TokenStream::from_str(&code).unwrap(); - let orig_tokens = FlatTokens::new(ts.clone()).collect::>(); - let mut ti = TokenIndex::new(&orig_tokens); - - let new_ts = ts.into_iter().map(|tt| match tt { - TokenTree::Ident(i) => TokenTree::Ident(proc_macro2::Ident::new( - &i.to_string().to_lowercase(), - i.span(), - )), - tt => tt, - }).collect::(); - - let mut buf = OutputBuffer::new(); - render_output(&code, &orig_tokens, &ti, new_ts, &mut buf); - println!("{}", buf.s); - //println!("{}", new_ts.to_string()); + + let cargo_config = CargoConfig::default(); + + let load_cargo_config: LoadCargoConfig = LoadCargoConfig { + load_out_dirs_from_check: true, + with_proc_macro_server: ProcMacroServerChoice::Sysroot, + prefill_caches: false, + }; + + let (db, vfs, proc_macro_client) = ra_ap_load_cargo::load_workspace_at( + Path::new(&path), + &cargo_config, + &load_cargo_config, + &|msg| eprintln!("progress: {msg}"), + ).unwrap(); + eprintln!("finished loading workspace\n"); + + for (id, path) in vfs.iter() { + eprintln!("vfs: {id:?}, {path:?}"); + } + + // Assume the first file in `vfs` is the crate root. + let (first_file_id, _) = vfs.iter().next().unwrap(); + + eprintln!("build Semantics..."); + let sema = Semantics::new(&db); + eprintln!("done building Semantics"); + + let krate = sema.first_crate(first_file_id).unwrap(); + eprintln!("{:?}", krate.origin(&db)); + + let src = krate.root_module().definition_source(&db); + eprintln!("{src:?}"); + let node = src.value.node(); + eprintln!("{node:?}"); + eprintln!("{node}"); + + let mut files = Vec::new(); + for m in krate.modules(&db) { + let src = m.definition_source(&db); + let node = src.value.node(); + eprintln!("module source = {src:?}"); + eprintln!(" module node = {node:?}"); + if let Some(editioned_file_id) = m.as_source_file_id(&db) { + sema.parse(editioned_file_id); + let file_id = editioned_file_id.file_id(&db); + let vfs_path = vfs.file_path(file_id); + if let Some(path) = vfs_path.as_path() { + eprintln!(" module path = {path:?}"); + files.push((path.to_path_buf(), node)); + } + } + } + + for (path, root) in files { + let code = fs::read_to_string(&path).unwrap(); + eprintln!("{path:?}: read {} bytes", code.len()); + + let ts = TokenStream::from_str(&code).unwrap(); + let orig_tokens = FlatTokens::new(ts.clone()).collect::>(); + let mut ti = TokenIndex::new(&orig_tokens); + + let mut ast: syn::File = syn::parse2(ts.clone()).unwrap(); + let mut v = AddDerivedItemVisitor(|i: &mut syn::Item| -> Option { + eprintln!("visit item"); + add_ffi_wrapper(&db, &sema, root.clone(), i) + }); + v.visit_file_mut(&mut ast); + + let new_ts = ast.into_token_stream(); + + let mut buf = OutputBuffer::new(); + render_output(&code, &orig_tokens, &ti, new_ts, &mut buf); + println!("{}", buf.s); + } } From b3345e3e3f934ff7affe516ec8fc985eb86d6ecf Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Fri, 31 Oct 2025 13:57:57 -0700 Subject: [PATCH 03/25] split_ffi: fix warnings --- tools/split_ffi_entry_points/src/main.rs | 87 ++++-------------------- 1 file changed, 15 insertions(+), 72 deletions(-) diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index 311191c29f..96f2fc3c44 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -1,22 +1,16 @@ -use std::collections::{HashSet, BTreeSet}; +use std::collections::BTreeSet; use std::env; -use std::fmt::Write as _; use std::fs; use std::mem; use std::path::Path; use std::str::FromStr; -use proc_macro2::{TokenStream, TokenTree, Delimiter, Punct, Spacing, Span}; +use proc_macro2::{TokenStream, TokenTree, Delimiter, Spacing, Span}; use quote::ToTokens; -use ra_ap_hir::{Semantics, ModuleDef, HasAttrs, HirFileId}; -use ra_ap_hir::sym; -//use ra_ap_hir_ty::HirDatabase; +use ra_ap_hir::Semantics; use ra_ap_ide_db::RootDatabase; -use ra_ap_ide_db::source_change::SourceChangeBuilder; use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; use ra_ap_project_model::CargoConfig; -use ra_ap_syntax::{AstNode, SyntaxNode, SyntaxKind, TextRange, TextSize}; -use ra_ap_syntax::ast::{self, HasAttrs as _}; -use ra_ap_syntax::syntax_editor::{SyntaxEditor, Position}; +use ra_ap_syntax::SyntaxNode; use syn; use syn::spanned::Spanned; use syn::visit_mut::{self, VisitMut}; @@ -259,7 +253,6 @@ struct AddDerivedItemVisitor(F); impl Option> AddDerivedItemVisitor { fn visit_items(&mut self, items: &mut Vec) { - eprintln!("parent has {} items", items.len()); let new_items = Vec::with_capacity(items.len()); let old_items = mem::replace(items, new_items); for mut item in old_items { @@ -274,7 +267,6 @@ impl Option> AddDerivedItemVisitor { impl Option> VisitMut for AddDerivedItemVisitor { fn visit_item_mod_mut(&mut self, im: &mut syn::ItemMod) { - eprintln!("visit mod"); let items = match im.content { Some((_, ref mut x)) => x, None => return, @@ -284,16 +276,15 @@ impl Option> VisitMut for AddDerivedItemV } fn visit_file_mut(&mut self, f: &mut syn::File) { - eprintln!("visit file"); self.visit_items(&mut f.items); visit_mut::visit_file_mut(self, f); } } fn add_ffi_wrapper( - db: &RootDatabase, - sema: &Semantics, - root: SyntaxNode, + _db: &RootDatabase, + _sema: &Semantics, + _root: SyntaxNode, item: &mut syn::Item, ) -> Option { let fn_item = match *item { @@ -326,15 +317,7 @@ fn add_ffi_wrapper( let mut need_wrapper = false; for mut attr in mem::take(&mut fn_item.attrs) { - eprintln!("old meta = {}", attr.meta.to_token_stream()); let mut pm = ParsedMeta::from(attr.meta); - match pm { - ParsedMeta::Meta(..) => eprintln!("got meta"), - ParsedMeta::Unsafe(..) => eprintln!("got unsafe"), - ParsedMeta::CfgAttr(..) => eprintln!("got cfg_attr"), - ParsedMeta::NoMangle(..) => eprintln!("got no_mangle"), - ParsedMeta::ExportName(..) => eprintln!("got export_name"), - } let mut move_to_wrapper = false; pm.with_innermost_mut(&mut |pm| { @@ -355,8 +338,6 @@ fn add_ffi_wrapper( }); attr.meta = pm.into(); - eprintln!("new meta = {}", attr.meta.to_token_stream()); - eprintln!(" moved = {move_to_wrapper}"); if move_to_wrapper { wrapper_attrs.push(attr); @@ -445,7 +426,6 @@ fn span_to_text_range(span: Span) -> TextRange { enum ParsedMeta { Meta(syn::Meta), Unsafe(Box), - CfgAttr(Box), NoMangle(ParsedMetaNoMangle), ExportName(ParsedMetaExportName), } @@ -457,15 +437,6 @@ struct ParsedMetaUnsafe { inner: ParsedMeta, } -#[derive(Clone)] -struct ParsedMetaCfgAttr { - ident: syn::Ident, - paren: syn::token::Paren, - cond: syn::Meta, - comma: syn::Token![,], - inner: ParsedMeta, -} - #[derive(Clone)] struct ParsedMetaNoMangle { ident: syn::Ident, @@ -527,7 +498,6 @@ impl ParsedMeta { ParsedMeta::Meta(..) | ParsedMeta::NoMangle(..) | ParsedMeta::ExportName(..) => f(self), - ParsedMeta::CfgAttr(ref mut pmca) => pmca.inner.with_innermost_mut(f), ParsedMeta::Unsafe(ref mut pmu) => pmu.inner.with_innermost_mut(f), } } @@ -556,7 +526,6 @@ impl ToTokens for ParsedMeta { match *self { ParsedMeta::Meta(ref x) => x.to_tokens(tokens), ParsedMeta::Unsafe(ref x) => x.to_tokens(tokens), - ParsedMeta::CfgAttr(ref x) => x.to_tokens(tokens), ParsedMeta::NoMangle(ref x) => x.to_tokens(tokens), ParsedMeta::ExportName(ref x) => x.to_tokens(tokens), } @@ -572,17 +541,6 @@ impl ToTokens for ParsedMetaUnsafe { } } -impl ToTokens for ParsedMetaCfgAttr { - fn to_tokens(&self, tokens: &mut TokenStream) { - self.ident.to_tokens(tokens); - self.paren.surround(tokens, |tokens| { - self.cond.to_tokens(tokens); - self.comma.to_tokens(tokens); - self.inner.to_tokens(tokens); - }); - } -} - impl ToTokens for ParsedMetaNoMangle { fn to_tokens(&self, tokens: &mut TokenStream) { self.ident.to_tokens(tokens); @@ -609,46 +567,31 @@ fn main() { prefill_caches: false, }; - let (db, vfs, proc_macro_client) = ra_ap_load_cargo::load_workspace_at( + let (db, vfs, _proc_macro_client) = ra_ap_load_cargo::load_workspace_at( Path::new(&path), &cargo_config, &load_cargo_config, - &|msg| eprintln!("progress: {msg}"), + &|_msg| {}, ).unwrap(); - eprintln!("finished loading workspace\n"); - - for (id, path) in vfs.iter() { - eprintln!("vfs: {id:?}, {path:?}"); - } // Assume the first file in `vfs` is the crate root. let (first_file_id, _) = vfs.iter().next().unwrap(); - eprintln!("build Semantics..."); let sema = Semantics::new(&db); - eprintln!("done building Semantics"); - let krate = sema.first_crate(first_file_id).unwrap(); - eprintln!("{:?}", krate.origin(&db)); - let src = krate.root_module().definition_source(&db); - eprintln!("{src:?}"); - let node = src.value.node(); - eprintln!("{node:?}"); - eprintln!("{node}"); + eprintln!("processing crate..."); + let krate = sema.first_crate(first_file_id).unwrap(); let mut files = Vec::new(); for m in krate.modules(&db) { let src = m.definition_source(&db); let node = src.value.node(); - eprintln!("module source = {src:?}"); - eprintln!(" module node = {node:?}"); if let Some(editioned_file_id) = m.as_source_file_id(&db) { sema.parse(editioned_file_id); let file_id = editioned_file_id.file_id(&db); let vfs_path = vfs.file_path(file_id); if let Some(path) = vfs_path.as_path() { - eprintln!(" module path = {path:?}"); files.push((path.to_path_buf(), node)); } } @@ -656,15 +599,13 @@ fn main() { for (path, root) in files { let code = fs::read_to_string(&path).unwrap(); - eprintln!("{path:?}: read {} bytes", code.len()); let ts = TokenStream::from_str(&code).unwrap(); let orig_tokens = FlatTokens::new(ts.clone()).collect::>(); - let mut ti = TokenIndex::new(&orig_tokens); + let ti = TokenIndex::new(&orig_tokens); let mut ast: syn::File = syn::parse2(ts.clone()).unwrap(); let mut v = AddDerivedItemVisitor(|i: &mut syn::Item| -> Option { - eprintln!("visit item"); add_ffi_wrapper(&db, &sema, root.clone(), i) }); v.visit_file_mut(&mut ast); @@ -673,6 +614,8 @@ fn main() { let mut buf = OutputBuffer::new(); render_output(&code, &orig_tokens, &ti, new_ts, &mut buf); - println!("{}", buf.s); + let s = buf.finish(); + fs::write(&path, &s).unwrap(); + eprintln!("wrote {:?}", path); } } From dfdf319eebdde6df1aea821c159bdd517aba5403 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Fri, 31 Oct 2025 13:59:08 -0700 Subject: [PATCH 04/25] split_ffi: fix rust-analyzer version in cargo.toml --- tools/split_ffi_entry_points/Cargo.lock | 1736 ++-------------------- tools/split_ffi_entry_points/Cargo.toml | 14 +- tools/split_ffi_entry_points/src/main.rs | 1 - 3 files changed, 168 insertions(+), 1583 deletions(-) diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock index e2fadff8e2..f5a71a4fbe 100644 --- a/tools/split_ffi_entry_points/Cargo.lock +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -26,12 +26,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "bitflags" version = "1.3.2" @@ -87,7 +81,7 @@ dependencies = [ "serde", "serde-untagged", "serde-value", - "thiserror 2.0.17", + "thiserror", "toml", "unicode-xid", "url", @@ -105,7 +99,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror", ] [[package]] @@ -166,7 +160,7 @@ dependencies = [ "ena", "indexmap", "itertools 0.12.1", - "petgraph 0.6.5", + "petgraph", "rustc-hash 1.1.0", "tracing", ] @@ -240,47 +234,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "deranged" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derive-where" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.61.2", -] - [[package]] name = "displaydoc" version = "0.2.5" @@ -292,18 +245,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dissimilar" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921" - -[[package]] -name = "dot" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74b6c4d4a1cff5f454164363c16b72fa12463ca6b31f4b5f2035a65fa3d5906" - [[package]] name = "drop_bomb" version = "0.1.5" @@ -348,12 +289,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - [[package]] name = "foldhash" version = "0.1.5" @@ -384,17 +319,6 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -427,12 +351,6 @@ dependencies = [ "hashbrown 0.15.5", ] -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - [[package]] name = "home" version = "0.5.12" @@ -585,15 +503,6 @@ dependencies = [ "memoffset", ] -[[package]] -name = "inventory" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" -dependencies = [ - "rustversion", -] - [[package]] name = "itertools" version = "0.12.1" @@ -650,28 +559,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3752f229dcc5a481d60f385fa479ff46818033d881d2d801aa27dffcfb5e8306" -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" -[[package]] -name = "libredox" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" -dependencies = [ - "bitflags 2.10.0", - "libc", -] - [[package]] name = "line-index" version = "0.1.2" @@ -703,32 +596,6 @@ version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" -[[package]] -name = "lsp-server" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6ada348dbc2703cbe7637b2dda05cff84d3da2819c24abcb305dd613e0ba2e" -dependencies = [ - "crossbeam-channel", - "log", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "lsp-types" -version = "0.95.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158c1911354ef73e8fe42da6b10c0484cb65c7f1007f28022e847706c1ab6984" -dependencies = [ - "bitflags 1.3.2", - "serde", - "serde_json", - "serde_repr", - "url", -] - [[package]] name = "memchr" version = "2.7.6" @@ -765,18 +632,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.10.0", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -807,21 +662,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" -[[package]] -name = "nu-ansi-term" -version = "0.50.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" version = "0.2.19" @@ -831,25 +671,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -862,12 +683,6 @@ version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "ordered-float" version = "2.10.1" @@ -907,7 +722,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -941,18 +756,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset 0.4.2", - "indexmap", -] - -[[package]] -name = "petgraph" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" -dependencies = [ - "fixedbitset 0.5.7", - "hashbrown 0.15.5", + "fixedbitset", "indexmap", ] @@ -977,12 +781,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "proc-macro2" version = "1.0.101" @@ -992,58 +790,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "process-wrap" -version = "8.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ef4f2f0422f23a82ec9f628ea2acd12871c81a9362b02c43c1aa86acfc3ba1" -dependencies = [ - "indexmap", - "nix", - "tracing", - "windows", -] - -[[package]] -name = "protobuf" -version = "3.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72" -dependencies = [ - "once_cell", - "protobuf-support", - "thiserror 1.0.69", -] - -[[package]] -name = "protobuf-support" -version = "3.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" -dependencies = [ - "thiserror 1.0.69", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.10.0", - "memchr", - "unicase", -] - -[[package]] -name = "pulldown-cmark-to-cmark" -version = "10.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0194e6e1966c23cc5fd988714f85b18d548d773e81965413555d96569931833d" -dependencies = [ - "pulldown-cmark", -] - [[package]] name = "quote" version = "1.0.40" @@ -1060,29 +806,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f18c877575c259d127072e9bfc41d985202262fb4d6bfdae3d1252147c2562c2" dependencies = [ "bitflags 2.10.0", - "ra-ap-rustc_hashes 0.123.0", - "ra-ap-rustc_index 0.123.0", - "tracing", -] - -[[package]] -name = "ra-ap-rustc_abi" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4ce5c9ea794353e02beae390c4674f74ffb23a2ad9de763469fdcef5c1026ef" -dependencies = [ - "bitflags 2.10.0", - "ra-ap-rustc_hashes 0.137.0", - "ra-ap-rustc_index 0.137.0", + "ra-ap-rustc_hashes", + "ra-ap-rustc_index", "tracing", ] -[[package]] -name = "ra-ap-rustc_ast_ir" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1696b77af9bbfe1fcc7a09c907561061c6ef4c8bd6d5f1675b927bc62d349103" - [[package]] name = "ra-ap-rustc_hashes" version = "0.123.0" @@ -1092,32 +820,13 @@ dependencies = [ "rustc-stable-hash", ] -[[package]] -name = "ra-ap-rustc_hashes" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c055d8b0d8a592d8cf9547495189f52c1ee5c691d28df1628253a816214e8521" -dependencies = [ - "rustc-stable-hash", -] - [[package]] name = "ra-ap-rustc_index" version = "0.123.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a24fe0be21be1f8ebc21dcb40129214fb4cefb0f2753f3d46b6dbe656a1a45" dependencies = [ - "ra-ap-rustc_index_macros 0.123.0", - "smallvec", -] - -[[package]] -name = "ra-ap-rustc_index" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08a03e3d4a452144b68f48130eda3a2894d4d79e99ddb44bdb4e0ab8c384e10" -dependencies = [ - "ra-ap-rustc_index_macros 0.137.0", + "ra-ap-rustc_index_macros", "smallvec", ] @@ -1132,17 +841,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ra-ap-rustc_index_macros" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e0446b4d65a8ce19d8fd12826c4bf2365ffa4b8fe0ee94daf5968fe36e920c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ra-ap-rustc_lexer" version = "0.121.0" @@ -1165,30 +863,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "ra-ap-rustc_lexer" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac80365383a3c749f38af567fdcfaeff3fa6ea5df3846852abbce73e943921b9" -dependencies = [ - "memchr", - "unicode-properties", - "unicode-xid", -] - -[[package]] -name = "ra-ap-rustc_next_trait_solver" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39b419d2d6f7fdec7e0981b7fb7d5beb5dda7140064f1199704ec9dadbb6f73" -dependencies = [ - "derive-where", - "ra-ap-rustc_index 0.137.0", - "ra-ap-rustc_type_ir", - "ra-ap-rustc_type_ir_macros", - "tracing", -] - [[package]] name = "ra-ap-rustc_parse_format" version = "0.121.0" @@ -1196,17 +870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81057891bc2063ad9e353f29462fbc47a0f5072560af34428ae9313aaa5e9d97" dependencies = [ "ra-ap-rustc_lexer 0.121.0", - "rustc-literal-escaper 0.0.4", -] - -[[package]] -name = "ra-ap-rustc_parse_format" -version = "0.137.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b743b0c8f795842e41b1720bbc5af6e896129fb9acf04e9785774bfb0dc5947c" -dependencies = [ - "ra-ap-rustc_lexer 0.137.0", - "rustc-literal-escaper 0.0.5", + "rustc-literal-escaper", ] [[package]] @@ -1215,7 +879,7 @@ version = "0.123.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b0ee1f059b9dea0818c6c7267478926eee95ba4c7dcf89c8db32fa165d3904" dependencies = [ - "ra-ap-rustc_index 0.123.0", + "ra-ap-rustc_index", "rustc-hash 2.1.1", "rustc_apfloat", "smallvec", @@ -1223,179 +887,66 @@ dependencies = [ ] [[package]] -name = "ra-ap-rustc_pattern_analysis" -version = "0.137.0" +name = "ra_ap_base_db" +version = "0.0.301" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf944dce80137195528f89a576f70153c2060a6f8ca49c3fa9f55f9da14ab937" +checksum = "e876bb2c3e52a8d4e6684526a2d4e81f9d028b939ee4dc5dc775fe10deb44d59" dependencies = [ - "ra-ap-rustc_index 0.137.0", + "dashmap", + "indexmap", + "la-arena", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_syntax", + "ra_ap_vfs", "rustc-hash 2.1.1", - "rustc_apfloat", - "smallvec", + "salsa", + "salsa-macros", + "semver", "tracing", + "triomphe", ] [[package]] -name = "ra-ap-rustc_type_ir" -version = "0.137.0" +name = "ra_ap_cfg" +version = "0.0.301" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfe2722b20bc889a9d7711bd3a1f4f7b082940491241615aa643c17e0deffec" +checksum = "3a0b56eb4536ce6d2431932c4d337aeeaf7bb22c9249b38cbe80677b5881228f" dependencies = [ - "arrayvec", - "bitflags 2.10.0", - "derive-where", - "ena", - "indexmap", - "ra-ap-rustc_ast_ir", - "ra-ap-rustc_index 0.137.0", - "ra-ap-rustc_type_ir_macros", + "ra_ap_intern", + "ra_ap_tt", "rustc-hash 2.1.1", - "smallvec", - "thin-vec", "tracing", ] [[package]] -name = "ra-ap-rustc_type_ir_macros" -version = "0.137.0" +name = "ra_ap_edition" +version = "0.0.301" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fad1527df26aaa77367393fae86f42818b33e02b3737a19f3846d1c7671e7f9" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] +checksum = "1bdc6cbe42c63ca78611bae82bfc8db24864f33dccc813697c5fde43a0907285" [[package]] -name = "ra_ap_base_db" +name = "ra_ap_hir" version = "0.0.301" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e876bb2c3e52a8d4e6684526a2d4e81f9d028b939ee4dc5dc775fe10deb44d59" +checksum = "ebffdc134eccabc17209d7760cfff7fd12ed18ab6e21188c5e084b97aa38504c" dependencies = [ - "dashmap", + "arrayvec", + "either", "indexmap", - "la-arena", - "ra_ap_cfg 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_query-group-macro 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_vfs 0.0.301", - "rustc-hash 2.1.1", - "salsa 0.23.0", - "salsa-macros 0.23.0", - "semver", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_base_db" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26cc7a0624b461c0c8268d8ad5f06ce56b195d4b6267250e441908778d6fe35" -dependencies = [ - "dashmap", - "indexmap", - "la-arena", - "ra_ap_cfg 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_query-group-macro 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_vfs 0.0.303", - "rustc-hash 2.1.1", - "salsa 0.24.0", - "salsa-macros 0.24.0", - "semver", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_cfg" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0b56eb4536ce6d2431932c4d337aeeaf7bb22c9249b38cbe80677b5881228f" -dependencies = [ - "ra_ap_intern 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", - "tracing", -] - -[[package]] -name = "ra_ap_cfg" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418e9458bef65b4acbc521c8f5469d324a20b581df6ac0c4a26204b658021436" -dependencies = [ - "ra_ap_intern 0.0.303", - "ra_ap_tt 0.0.303", - "rustc-hash 2.1.1", - "tracing", -] - -[[package]] -name = "ra_ap_edition" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bdc6cbe42c63ca78611bae82bfc8db24864f33dccc813697c5fde43a0907285" - -[[package]] -name = "ra_ap_edition" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1d9d0ab2dd4a8d8e61eec64040279e4ed259d25fecb7f41ffde3739128df85" - -[[package]] -name = "ra_ap_hir" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebffdc134eccabc17209d7760cfff7fd12ed18ab6e21188c5e084b97aa38504c" -dependencies = [ - "arrayvec", - "either", - "indexmap", - "itertools 0.14.0", - "ra_ap_base_db 0.0.301", - "ra_ap_cfg 0.0.301", - "ra_ap_hir_def 0.0.301", - "ra_ap_hir_expand 0.0.301", - "ra_ap_hir_ty 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", - "smallvec", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_hir" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562a7bf5b77a199cc033b2e7723e403f562ff09c1ecbb8d1e243c23655f63313" -dependencies = [ - "arrayvec", - "either", - "indexmap", - "itertools 0.14.0", - "ra-ap-rustc_type_ir", - "ra_ap_base_db 0.0.303", - "ra_ap_cfg 0.0.303", - "ra_ap_hir_def 0.0.303", - "ra_ap_hir_expand 0.0.303", - "ra_ap_hir_ty 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_tt 0.0.303", + "itertools 0.14.0", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_hir_def", + "ra_ap_hir_expand", + "ra_ap_hir_ty", + "ra_ap_intern", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", "rustc-hash 2.1.1", "smallvec", "tracing", @@ -1417,60 +968,22 @@ dependencies = [ "indexmap", "itertools 0.14.0", "la-arena", - "ra-ap-rustc_abi 0.123.0", - "ra-ap-rustc_parse_format 0.121.0", - "ra_ap_base_db 0.0.301", - "ra_ap_cfg 0.0.301", - "ra_ap_hir_expand 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_mbe 0.0.301", - "ra_ap_query-group-macro 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", - "rustc_apfloat", - "salsa 0.23.0", - "salsa-macros 0.23.0", - "smallvec", - "text-size", - "thin-vec", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_hir_def" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f725eb770107597b8469abff6aa94c23a5f9e8939fe2d1aa8490f1417bc438" -dependencies = [ - "arrayvec", - "bitflags 2.10.0", - "cov-mark", - "drop_bomb", - "either", - "fst", - "indexmap", - "itertools 0.14.0", - "la-arena", - "ra-ap-rustc_abi 0.137.0", - "ra-ap-rustc_parse_format 0.137.0", - "ra_ap_base_db 0.0.303", - "ra_ap_cfg 0.0.303", - "ra_ap_hir_expand 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_mbe 0.0.303", - "ra_ap_query-group-macro 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_tt 0.0.303", + "ra-ap-rustc_abi", + "ra-ap-rustc_parse_format", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_hir_expand", + "ra_ap_intern", + "ra_ap_mbe", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", "rustc-hash 2.1.1", "rustc_apfloat", - "salsa 0.24.0", - "salsa-macros 0.24.0", + "salsa", + "salsa-macros", "smallvec", "text-size", "thin-vec", @@ -1487,48 +1000,20 @@ dependencies = [ "cov-mark", "either", "itertools 0.14.0", - "ra_ap_base_db 0.0.301", - "ra_ap_cfg 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_mbe 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_query-group-macro 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_syntax-bridge 0.0.301", - "ra_ap_tt 0.0.301", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_mbe", + "ra_ap_parser", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_syntax-bridge", + "ra_ap_tt", "rustc-hash 2.1.1", - "salsa 0.23.0", - "salsa-macros 0.23.0", - "smallvec", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_hir_expand" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6180bfc6ac40309111dac062acf2aed36cfb918fcfa105b355c127b296ef23" -dependencies = [ - "cov-mark", - "either", - "itertools 0.14.0", - "ra_ap_base_db 0.0.303", - "ra_ap_cfg 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_mbe 0.0.303", - "ra_ap_parser 0.0.303", - "ra_ap_query-group-macro 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_syntax-bridge 0.0.303", - "ra_ap_tt 0.0.303", - "rustc-hash 2.1.1", - "salsa 0.24.0", - "salsa-macros 0.24.0", + "salsa", + "salsa-macros", "smallvec", "tracing", "triomphe", @@ -1553,140 +1038,28 @@ dependencies = [ "itertools 0.14.0", "la-arena", "oorandom", - "ra-ap-rustc_abi 0.123.0", - "ra-ap-rustc_index 0.123.0", - "ra-ap-rustc_pattern_analysis 0.123.0", - "ra_ap_base_db 0.0.301", - "ra_ap_hir_def 0.0.301", - "ra_ap_hir_expand 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_query-group-macro 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "rustc-hash 2.1.1", - "rustc_apfloat", - "salsa 0.23.0", - "salsa-macros 0.23.0", - "scoped-tls", - "smallvec", - "tracing", - "triomphe", - "typed-arena", -] - -[[package]] -name = "ra_ap_hir_ty" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9375925321b74040bff60dee1866facdabea1cd33fb2bea24ad419e8392b1d" -dependencies = [ - "arrayvec", - "bitflags 2.10.0", - "cov-mark", - "either", - "ena", - "indexmap", - "itertools 0.14.0", - "la-arena", - "oorandom", - "petgraph 0.8.3", - "ra-ap-rustc_abi 0.137.0", - "ra-ap-rustc_ast_ir", - "ra-ap-rustc_index 0.137.0", - "ra-ap-rustc_next_trait_solver", - "ra-ap-rustc_pattern_analysis 0.137.0", - "ra-ap-rustc_type_ir", - "ra_ap_base_db 0.0.303", - "ra_ap_hir_def 0.0.303", - "ra_ap_hir_expand 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_macros", - "ra_ap_query-group-macro 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", + "ra-ap-rustc_abi", + "ra-ap-rustc_index", + "ra-ap-rustc_pattern_analysis", + "ra_ap_base_db", + "ra_ap_hir_def", + "ra_ap_hir_expand", + "ra_ap_intern", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", "rustc-hash 2.1.1", "rustc_apfloat", - "salsa 0.24.0", - "salsa-macros 0.24.0", + "salsa", + "salsa-macros", "scoped-tls", "smallvec", "tracing", - "tracing-subscriber", - "tracing-tree", "triomphe", "typed-arena", ] -[[package]] -name = "ra_ap_ide" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb3d866d218464f69fcd3b897c5f72e80920c7307fdce68b5fe447b2ccec8d6" -dependencies = [ - "arrayvec", - "cov-mark", - "dot", - "either", - "itertools 0.14.0", - "nohash-hasher", - "oorandom", - "pulldown-cmark", - "pulldown-cmark-to-cmark", - "ra_ap_cfg 0.0.301", - "ra_ap_hir 0.0.301", - "ra_ap_ide_assists", - "ra_ap_ide_completion", - "ra_ap_ide_db 0.0.301", - "ra_ap_ide_diagnostics", - "ra_ap_ide_ssr", - "ra_ap_profile 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_toolchain 0.0.301", - "rustc_apfloat", - "smallvec", - "tracing", - "triomphe", - "url", -] - -[[package]] -name = "ra_ap_ide_assists" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd12346ac54c6c723966b034ac658984f845eb71386e1939db759df3f8e3a803" -dependencies = [ - "cov-mark", - "either", - "itertools 0.14.0", - "ra_ap_hir 0.0.301", - "ra_ap_ide_db 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "smallvec", - "tracing", -] - -[[package]] -name = "ra_ap_ide_completion" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "737d5176342463e795fe0015d924d784720ea8c3c9573c289b836063d28885dd" -dependencies = [ - "cov-mark", - "itertools 0.14.0", - "ra_ap_base_db 0.0.301", - "ra_ap_hir 0.0.301", - "ra_ap_ide_db 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "smallvec", - "tracing", -] - [[package]] name = "ra_ap_ide_db" version = "0.0.301" @@ -1704,94 +1077,23 @@ dependencies = [ "line-index", "memchr", "nohash-hasher", - "ra_ap_base_db 0.0.301", - "ra_ap_hir 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_profile 0.0.301", - "ra_ap_query-group-macro 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_vfs 0.0.301", + "ra_ap_base_db", + "ra_ap_hir", + "ra_ap_parser", + "ra_ap_profile", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_vfs", "rayon", "rustc-hash 2.1.1", - "salsa 0.23.0", - "salsa-macros 0.23.0", + "salsa", + "salsa-macros", "tracing", "triomphe", ] -[[package]] -name = "ra_ap_ide_db" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8cfe40da7fba5649834b57f78d73a82312e879df0ab92e9db2f7ddde4a2fd5" -dependencies = [ - "arrayvec", - "bitflags 2.10.0", - "cov-mark", - "crossbeam-channel", - "either", - "fst", - "indexmap", - "itertools 0.14.0", - "line-index", - "memchr", - "nohash-hasher", - "ra_ap_base_db 0.0.303", - "ra_ap_hir 0.0.303", - "ra_ap_macros", - "ra_ap_parser 0.0.303", - "ra_ap_profile 0.0.303", - "ra_ap_query-group-macro 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_test_fixture", - "ra_ap_test_utils", - "ra_ap_vfs 0.0.303", - "rayon", - "rustc-hash 2.1.1", - "salsa 0.24.0", - "salsa-macros 0.24.0", - "smallvec", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_ide_diagnostics" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "010f0d861cd2d8b523ce7f4c7f4f063caa1bf9e73c18884f279b457f3c148fa6" -dependencies = [ - "cov-mark", - "either", - "itertools 0.14.0", - "ra_ap_cfg 0.0.301", - "ra_ap_hir 0.0.301", - "ra_ap_ide_db 0.0.301", - "ra_ap_paths 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "serde_json", - "tracing", -] - -[[package]] -name = "ra_ap_ide_ssr" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e618b35c692c50288810ff2097cc89d628bff0b2c1c83a76353775b6dfa3a21f" -dependencies = [ - "cov-mark", - "itertools 0.14.0", - "ra_ap_hir 0.0.301", - "ra_ap_ide_db 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_syntax 0.0.301", -] - [[package]] name = "ra_ap_intern" version = "0.0.301" @@ -1804,18 +1106,6 @@ dependencies = [ "triomphe", ] -[[package]] -name = "ra_ap_intern" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a0094489d0a903d31629c573a9ae58a71667266a641d8b0ba2028fc528685d" -dependencies = [ - "dashmap", - "hashbrown 0.14.5", - "rustc-hash 2.1.1", - "triomphe", -] - [[package]] name = "ra_ap_load-cargo" version = "0.0.301" @@ -1825,51 +1115,18 @@ dependencies = [ "anyhow", "crossbeam-channel", "itertools 0.14.0", - "ra_ap_hir_expand 0.0.301", - "ra_ap_ide_db 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_proc_macro_api 0.0.301", - "ra_ap_project_model 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_tt 0.0.301", - "ra_ap_vfs 0.0.301", - "ra_ap_vfs-notify 0.0.301", - "tracing", -] - -[[package]] -name = "ra_ap_load-cargo" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cca051acb758aeb728244aa6d0afd9144f3f9f3cff499546ec87c26df32af38" -dependencies = [ - "anyhow", - "crossbeam-channel", - "itertools 0.14.0", - "ra_ap_hir_expand 0.0.303", - "ra_ap_ide_db 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_proc_macro_api 0.0.303", - "ra_ap_project_model 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_tt 0.0.303", - "ra_ap_vfs 0.0.303", - "ra_ap_vfs-notify 0.0.303", + "ra_ap_hir_expand", + "ra_ap_ide_db", + "ra_ap_intern", + "ra_ap_proc_macro_api", + "ra_ap_project_model", + "ra_ap_span", + "ra_ap_tt", + "ra_ap_vfs", + "ra_ap_vfs-notify", "tracing", ] -[[package]] -name = "ra_ap_macros" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8536504d15fa9ac51bda8db57254420ea76428134c1f45e92948d1ba7b39b7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "ra_ap_mbe" version = "0.0.301" @@ -1879,31 +1136,12 @@ dependencies = [ "arrayvec", "cov-mark", "ra-ap-rustc_lexer 0.123.0", - "ra_ap_intern 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax-bridge 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", - "smallvec", -] - -[[package]] -name = "ra_ap_mbe" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e18d72ff55ba4916f0d5a80efb8b2f97f70f205fcea06432e20ba6544e01c77f" -dependencies = [ - "arrayvec", - "cov-mark", - "ra-ap-rustc_lexer 0.137.0", - "ra_ap_intern 0.0.303", - "ra_ap_parser 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax-bridge 0.0.303", - "ra_ap_tt 0.0.303", + "ra_ap_intern", + "ra_ap_parser", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax-bridge", + "ra_ap_tt", "rustc-hash 2.1.1", "smallvec", ] @@ -1916,23 +1154,9 @@ checksum = "3a3b92b8b147c0826b83e70ad44e3c98e94201fc93e1f09396c43b4d7958c22a" dependencies = [ "drop_bomb", "ra-ap-rustc_lexer 0.123.0", - "ra_ap_edition 0.0.301", - "rustc-literal-escaper 0.0.4", - "tracing", -] - -[[package]] -name = "ra_ap_parser" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f9431e009f6d234d72dc7497ae403df552a04390fa21ceec16086de2b077a6" -dependencies = [ - "drop_bomb", - "ra-ap-rustc_lexer 0.137.0", - "ra_ap_edition 0.0.303", - "rustc-literal-escaper 0.0.4", + "ra_ap_edition", + "rustc-literal-escaper", "tracing", - "winnow", ] [[package]] @@ -1944,15 +1168,6 @@ dependencies = [ "camino", ] -[[package]] -name = "ra_ap_paths" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1daa4fe55c2e5dd51b5e1a8dcb4b2a9017ac6f6c8b79db1676f45502dfb0" -dependencies = [ - "camino", -] - [[package]] name = "ra_ap_proc_macro_api" version = "0.0.301" @@ -1960,30 +1175,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45db9e2df587d56f0738afa89fb2c100ff7c1e9cbe49e07f6a8b62342832211b" dependencies = [ "indexmap", - "ra_ap_intern 0.0.301", - "ra_ap_paths 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", - "serde", - "serde_derive", - "serde_json", - "tracing", -] - -[[package]] -name = "ra_ap_proc_macro_api" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ecf05a97bba2b780f33f62e475bae2dedcb0f5ffdfd572a5da1ec249ffc79ed" -dependencies = [ - "indexmap", - "ra_ap_intern 0.0.303", - "ra_ap_paths 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_tt 0.0.303", + "ra_ap_intern", + "ra_ap_paths", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_tt", "rustc-hash 2.1.1", "serde", "serde_derive", @@ -2003,18 +1199,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "ra_ap_profile" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "407d68afa51ca70cb48b4c5ca1a5a890d47aeacd8b24940ead8513fe3c4509cb" -dependencies = [ - "cfg-if", - "libc", - "perf-event", - "windows-sys 0.60.2", -] - [[package]] name = "ra_ap_project_model" version = "0.0.301" @@ -2025,40 +1209,13 @@ dependencies = [ "cargo_metadata", "itertools 0.14.0", "la-arena", - "ra_ap_base_db 0.0.301", - "ra_ap_cfg 0.0.301", - "ra_ap_intern 0.0.301", - "ra_ap_paths 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_toolchain 0.0.301", - "rustc-hash 2.1.1", - "semver", - "serde", - "serde_derive", - "serde_json", - "temp-dir", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_project_model" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e4a306ddd78ba11e740b7b07d58cae31f2705b9f3eca8ea644536646babef2" -dependencies = [ - "anyhow", - "cargo_metadata", - "itertools 0.14.0", - "la-arena", - "ra_ap_base_db 0.0.303", - "ra_ap_cfg 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_paths 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_toolchain 0.0.303", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_paths", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_toolchain", "rustc-hash 2.1.1", "semver", "serde", @@ -2080,77 +1237,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ra_ap_query-group-macro" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56edf902b8934c7b35ce329b2e32febe9fba579df826b099627c23c77bf3bf4b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ra_ap_rust-analyzer" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9fabbc05c2f4b884293715ec4cc05101f942da71a5be3935145742eba2b399" -dependencies = [ - "anyhow", - "base64", - "cargo_metadata", - "crossbeam-channel", - "dirs", - "dissimilar", - "indexmap", - "itertools 0.14.0", - "lsp-server", - "lsp-types", - "memchr", - "nohash-hasher", - "num_cpus", - "oorandom", - "parking_lot", - "process-wrap", - "ra_ap_cfg 0.0.301", - "ra_ap_hir 0.0.301", - "ra_ap_hir_def 0.0.301", - "ra_ap_hir_ty 0.0.301", - "ra_ap_ide", - "ra_ap_ide_completion", - "ra_ap_ide_db 0.0.301", - "ra_ap_ide_ssr", - "ra_ap_intern 0.0.301", - "ra_ap_load-cargo 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_paths 0.0.301", - "ra_ap_proc_macro_api 0.0.301", - "ra_ap_profile 0.0.301", - "ra_ap_project_model 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_toolchain 0.0.301", - "ra_ap_vfs 0.0.301", - "ra_ap_vfs-notify 0.0.301", - "rayon", - "rustc-hash 2.1.1", - "scip", - "semver", - "serde", - "serde_derive", - "serde_json", - "tenthash", - "toml", - "tracing", - "tracing-subscriber", - "tracing-tree", - "triomphe", - "walkdir", - "windows-sys 0.60.2", - "xflags", -] - [[package]] name = "ra_ap_span" version = "0.0.301" @@ -2159,27 +1245,11 @@ checksum = "ca6f9fa2de07f5cccf431674b90e82c1fe1ea2339db3b3869eec44d135de09a4" dependencies = [ "hashbrown 0.14.5", "la-arena", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_vfs 0.0.301", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_vfs", "rustc-hash 2.1.1", - "salsa 0.23.0", - "text-size", -] - -[[package]] -name = "ra_ap_span" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cbb509f1df4ad6a106d4a1027c7d9f278772b0a60bab99352680b7c483ed6f" -dependencies = [ - "hashbrown 0.14.5", - "la-arena", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_vfs 0.0.303", - "rustc-hash 2.1.1", - "salsa 0.24.0", + "salsa", "text-size", ] @@ -2199,22 +1269,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "ra_ap_stdx" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c0eafb9310f5803041cdc548d62135a22d16e7e90b307b4f8c24089353926e" -dependencies = [ - "crossbeam-channel", - "crossbeam-utils", - "itertools 0.14.0", - "jod-thread", - "libc", - "miow", - "tracing", - "windows-sys 0.60.2", -] - [[package]] name = "ra_ap_syntax" version = "0.0.301" @@ -2223,95 +1277,29 @@ checksum = "6e9e1393281ad5c635239d353ed3cfbf28c8d0af03d0c61a3b24b31d1143b17f" dependencies = [ "either", "itertools 0.14.0", - "ra_ap_parser 0.0.301", - "ra_ap_stdx 0.0.301", - "rowan", - "rustc-hash 2.1.1", - "rustc-literal-escaper 0.0.4", - "smol_str", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_syntax" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2661f741e413aa41fdeacf5a2954467991a25bcd26a706d42065b98c7ce75" -dependencies = [ - "either", - "itertools 0.14.0", - "ra_ap_parser 0.0.303", - "ra_ap_stdx 0.0.303", + "ra_ap_parser", + "ra_ap_stdx", "rowan", "rustc-hash 2.1.1", - "rustc-literal-escaper 0.0.4", + "rustc-literal-escaper", "smol_str", - "tracing", - "triomphe", -] - -[[package]] -name = "ra_ap_syntax-bridge" -version = "0.0.301" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684e6ff1008ee5340335888f0453d94bb38950f110059a51f1818c7f6a56a807" -dependencies = [ - "ra_ap_intern 0.0.301", - "ra_ap_parser 0.0.301", - "ra_ap_span 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_syntax 0.0.301", - "ra_ap_tt 0.0.301", - "rustc-hash 2.1.1", -] - -[[package]] -name = "ra_ap_syntax-bridge" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61cb0c073d97a59126c8cd134a73ffef559527f817ca7fb7d56ab18371ae0a47" -dependencies = [ - "ra_ap_intern 0.0.303", - "ra_ap_parser 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_syntax 0.0.303", - "ra_ap_tt 0.0.303", - "rustc-hash 2.1.1", -] - -[[package]] -name = "ra_ap_test_fixture" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0908ed6fafd88a3890cba99ae95e09958f5b8b90bccb6a0beb62660ae4a21e2b" -dependencies = [ - "ra_ap_base_db 0.0.303", - "ra_ap_cfg 0.0.303", - "ra_ap_hir_expand 0.0.303", - "ra_ap_intern 0.0.303", - "ra_ap_paths 0.0.303", - "ra_ap_span 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_test_utils", - "ra_ap_tt 0.0.303", - "rustc-hash 2.1.1", + "tracing", "triomphe", ] [[package]] -name = "ra_ap_test_utils" -version = "0.0.303" +name = "ra_ap_syntax-bridge" +version = "0.0.301" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c957dcd3436b781a4971ac45238b1570a9755b76b275b1b4c1154d4fd6f96e" +checksum = "684e6ff1008ee5340335888f0453d94bb38950f110059a51f1818c7f6a56a807" dependencies = [ - "dissimilar", - "ra_ap_paths 0.0.303", - "ra_ap_profile 0.0.303", - "ra_ap_stdx 0.0.303", + "ra_ap_intern", + "ra_ap_parser", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", "rustc-hash 2.1.1", - "text-size", ] [[package]] @@ -2324,16 +1312,6 @@ dependencies = [ "home", ] -[[package]] -name = "ra_ap_toolchain" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82391f18d374e96604fd62ba2bb7c492ebc1cc50ec42d3c3fe7dbaecc6fbcd79" -dependencies = [ - "camino", - "home", -] - [[package]] name = "ra_ap_tt" version = "0.0.301" @@ -2342,21 +1320,8 @@ checksum = "fb87c7b35572c18a580ea811e970b94875fad5ac7cfa8644266a59081044f959" dependencies = [ "arrayvec", "ra-ap-rustc_lexer 0.123.0", - "ra_ap_intern 0.0.301", - "ra_ap_stdx 0.0.301", - "text-size", -] - -[[package]] -name = "ra_ap_tt" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1823b5d2253aad16edd250db04221ef41a85bbf5fee1e2a658ccf2d8f6db3e33" -dependencies = [ - "arrayvec", - "ra-ap-rustc_lexer 0.137.0", - "ra_ap_intern 0.0.303", - "ra_ap_stdx 0.0.303", + "ra_ap_intern", + "ra_ap_stdx", "text-size", ] @@ -2370,24 +1335,8 @@ dependencies = [ "fst", "indexmap", "nohash-hasher", - "ra_ap_paths 0.0.301", - "ra_ap_stdx 0.0.301", - "rustc-hash 2.1.1", - "tracing", -] - -[[package]] -name = "ra_ap_vfs" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ec71023aa4b47ecfa2b71fc47a8738acfc92794f059c6ffcc67a13fd310237" -dependencies = [ - "crossbeam-channel", - "fst", - "indexmap", - "nohash-hasher", - "ra_ap_paths 0.0.303", - "ra_ap_stdx 0.0.303", + "ra_ap_paths", + "ra_ap_stdx", "rustc-hash 2.1.1", "tracing", ] @@ -2400,26 +1349,9 @@ checksum = "04f6fce8d47c7ce9b8f2cd0e5a55f8fc4878d6043e61f46cde4391d3a5c6086f" dependencies = [ "crossbeam-channel", "notify", - "ra_ap_paths 0.0.301", - "ra_ap_stdx 0.0.301", - "ra_ap_vfs 0.0.301", - "rayon", - "rustc-hash 2.1.1", - "tracing", - "walkdir", -] - -[[package]] -name = "ra_ap_vfs-notify" -version = "0.0.303" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7ae4eaed5bc7604327f8d3a359f197a780e58f413de9a3cc23dac68aac02e7" -dependencies = [ - "crossbeam-channel", - "notify", - "ra_ap_paths 0.0.303", - "ra_ap_stdx 0.0.303", - "ra_ap_vfs 0.0.303", + "ra_ap_paths", + "ra_ap_stdx", + "ra_ap_vfs", "rayon", "rustc-hash 2.1.1", "tracing", @@ -2455,17 +1387,6 @@ dependencies = [ "bitflags 2.10.0", ] -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom", - "libredox", - "thiserror 2.0.17", -] - [[package]] name = "rowan" version = "0.15.15" @@ -2497,12 +1418,6 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" -[[package]] -name = "rustc-literal-escaper" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ee29da77c5a54f42697493cd4c9b9f31b74df666a6c04dfc4fde77abe0438b" - [[package]] name = "rustc-stable-hash" version = "0.1.2" @@ -2519,12 +1434,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - [[package]] name = "ryu" version = "1.0.20" @@ -2549,33 +1458,8 @@ dependencies = [ "portable-atomic", "rayon", "rustc-hash 2.1.1", - "salsa-macro-rules 0.23.0", - "salsa-macros 0.23.0", - "smallvec", - "thin-vec", - "tracing", -] - -[[package]] -name = "salsa" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27956164373aeec733ac24ff1736de8541234e3a8e7e6f916b28175b5752af3b" -dependencies = [ - "boxcar", - "crossbeam-queue", - "crossbeam-utils", - "hashbrown 0.15.5", - "hashlink", - "indexmap", - "intrusive-collections", - "inventory", - "parking_lot", - "portable-atomic", - "rayon", - "rustc-hash 2.1.1", - "salsa-macro-rules 0.24.0", - "salsa-macros 0.24.0", + "salsa-macro-rules", + "salsa-macros", "smallvec", "thin-vec", "tracing", @@ -2587,12 +1471,6 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2edb86a7e9c91f6d30c9ce054312721dbe773a162db27bbfae834d16177b30ce" -[[package]] -name = "salsa-macro-rules" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca3b9d6e47c08b5de4b218e0c5f7ec910b51bce6314e651c8e7b9d154d174da" - [[package]] name = "salsa-macros" version = "0.23.0" @@ -2605,18 +1483,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "salsa-macros" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6337b62f2968be6b8afa30017d7564ecbde6832ada47ed2261fb14d0fd402ff4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "same-file" version = "1.0.6" @@ -2626,15 +1492,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scip" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2b449a5e4660ce817676a0871cd1b4e2ff1023e33a1ac046670fa594b543a2" -dependencies = [ - "protobuf", -] - [[package]] name = "scoped-tls" version = "1.0.1" @@ -2725,7 +1582,6 @@ version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ - "indexmap", "itoa", "memchr", "ryu", @@ -2733,17 +1589,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "serde_spanned" version = "0.6.9" @@ -2753,15 +1598,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "smallvec" version = "1.15.1" @@ -2784,14 +1620,11 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "ra_ap_hir 0.0.303", - "ra_ap_hir_ty 0.0.303", - "ra_ap_ide_db 0.0.303", - "ra_ap_load-cargo 0.0.303", - "ra_ap_project_model 0.0.303", - "ra_ap_rust-analyzer", - "ra_ap_syntax 0.0.303", - "ra_ap_vfs 0.0.303", + "ra_ap_hir", + "ra_ap_ide_db", + "ra_ap_load-cargo", + "ra_ap_project_model", + "ra_ap_syntax", "syn", ] @@ -2829,12 +1662,6 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83176759e9416cf81ee66cb6508dbfe9c96f20b8b56265a39917551c23c70964" -[[package]] -name = "tenthash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c4bcc0a4fa333239f43662d15fbf995f384b2aeaf89c4ab4c83353d6cbb952" - [[package]] name = "text-size" version = "1.1.1" @@ -2847,33 +1674,13 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.17", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "thiserror-impl", ] [[package]] @@ -2887,48 +1694,6 @@ dependencies = [ "syn", ] -[[package]] -name = "thread_local" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "time" -version = "0.3.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" - -[[package]] -name = "time-macros" -version = "0.2.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinystr" version = "0.8.2" @@ -3009,43 +1774,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" -dependencies = [ - "sharded-slab", - "thread_local", - "time", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "tracing-tree" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac87aa03b6a4d5a7e4810d1a80c19601dbe0f8a837e9177f23af721c7ba7beec" -dependencies = [ - "nu-ansi-term", - "tracing-core", - "tracing-log", - "tracing-subscriber", ] [[package]] @@ -3066,12 +1794,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" -[[package]] -name = "unicase" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" - [[package]] name = "unicode-ident" version = "1.0.19" @@ -3108,12 +1830,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - [[package]] name = "walkdir" version = "2.5.0" @@ -3139,114 +1855,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections", - "windows-core", - "windows-future", - "windows-link 0.1.3", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core", - "windows-link 0.1.3", - "windows-threading", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows-sys" version = "0.60.2" @@ -3262,7 +1876,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3271,7 +1885,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", @@ -3282,15 +1896,6 @@ dependencies = [ "windows_x86_64_msvc", ] -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.53.1" @@ -3354,21 +1959,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" -[[package]] -name = "xflags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9e15fbb3de55454b0106e314b28e671279009b363e6f1d8e39fdc3bf048944" -dependencies = [ - "xflags-macros", -] - -[[package]] -name = "xflags-macros" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672423d4fea7ffa2f6c25ba60031ea13dc6258070556f125cc4d790007d4a155" - [[package]] name = "yoke" version = "0.8.1" diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index 7215389cc8..c563f15e99 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -8,12 +8,8 @@ syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" -ra_ap_rust-analyzer = "=0.0.301" -# Cargo will pick versions of the remaining deps to match ra_ap_rust-analyzer. -ra_ap_hir = "*" -ra_ap_hir_ty = "*" -ra_ap_ide_db = "*" -ra_ap_load-cargo = "*" -ra_ap_project_model = "*" -ra_ap_syntax = "*" -ra_ap_vfs = "*" +ra_ap_hir = "=0.0.301" +ra_ap_ide_db = "=0.0.301" +ra_ap_load-cargo = "=0.0.301" +ra_ap_project_model = "=0.0.301" +ra_ap_syntax = "=0.0.301" diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index 96f2fc3c44..c0d80ded5e 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -579,7 +579,6 @@ fn main() { let sema = Semantics::new(&db); - eprintln!("processing crate..."); let krate = sema.first_crate(first_file_id).unwrap(); From ab34c14ba5b85814d4241cec503b79c6d29d7a9d Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Fri, 31 Oct 2025 15:31:25 -0700 Subject: [PATCH 05/25] split_ffi: refuse to rewrite files outside cargo dir --- tools/split_ffi_entry_points/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index c0d80ded5e..c230d4c068 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -1,6 +1,7 @@ use std::collections::BTreeSet; use std::env; use std::fs; +use std::iter; use std::mem; use std::path::Path; use std::str::FromStr; @@ -557,7 +558,8 @@ impl ToTokens for ParsedMetaExportName { fn main() { - let path = env::args().nth(1).unwrap(); + let cargo_dir_path = env::args().nth(1).unwrap(); + let cargo_dir_path = Path::new(&cargo_dir_path); let cargo_config = CargoConfig::default(); @@ -568,7 +570,7 @@ fn main() { }; let (db, vfs, _proc_macro_client) = ra_ap_load_cargo::load_workspace_at( - Path::new(&path), + cargo_dir_path, &cargo_config, &load_cargo_config, &|_msg| {}, @@ -597,6 +599,14 @@ fn main() { } for (path, root) in files { + // Only rewrite files that are inside the provided cargo dir. If our strategy for finding + // the main crate is wrong, this will keep us from overwriting files unexpectedly. + let mut ancestors = iter::successors(Some(path.as_path()), |p| p.parent()); + if !ancestors.any(|a| a == cargo_dir_path) { + eprintln!("skip {path:?}: outside cargo dir {cargo_dir_path:?}"); + continue; + } + let code = fs::read_to_string(&path).unwrap(); let ts = TokenStream::from_str(&code).unwrap(); From 155045d9fb91e4e68f952ac6ea914ce1edf00f36 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 5 Nov 2025 10:47:47 -0800 Subject: [PATCH 06/25] split_ffi: refactor: move TokenStream rewriting into new rewrite_util crate --- tools/rewrite_util/Cargo.lock | 25 +++ tools/rewrite_util/Cargo.toml | 7 + tools/rewrite_util/src/lib.rs | 235 ++++++++++++++++++++++ tools/split_ffi_entry_points/Cargo.lock | 8 + tools/split_ffi_entry_points/Cargo.toml | 2 + tools/split_ffi_entry_points/src/main.rs | 237 +---------------------- 6 files changed, 279 insertions(+), 235 deletions(-) create mode 100644 tools/rewrite_util/Cargo.lock create mode 100644 tools/rewrite_util/Cargo.toml create mode 100644 tools/rewrite_util/src/lib.rs diff --git a/tools/rewrite_util/Cargo.lock b/tools/rewrite_util/Cargo.lock new file mode 100644 index 0000000000..762c09d51b --- /dev/null +++ b/tools/rewrite_util/Cargo.lock @@ -0,0 +1,25 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "rewrite_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" diff --git a/tools/rewrite_util/Cargo.toml b/tools/rewrite_util/Cargo.toml new file mode 100644 index 0000000000..6f4a4d5e32 --- /dev/null +++ b/tools/rewrite_util/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "rewrite_util" +version = "0.1.0" +edition = "2024" + +[dependencies] +proc-macro2 = { version = "1", features = ["span-locations"] } diff --git a/tools/rewrite_util/src/lib.rs b/tools/rewrite_util/src/lib.rs new file mode 100644 index 0000000000..7abb45a7d5 --- /dev/null +++ b/tools/rewrite_util/src/lib.rs @@ -0,0 +1,235 @@ +use std::collections::BTreeSet; +use proc_macro2::{TokenStream, TokenTree, Delimiter, Spacing, Span}; + + +pub struct FlatTokens { + stack: Vec<(proc_macro2::token_stream::IntoIter, Delimiter, Span)>, +} + +impl FlatTokens { + pub fn new(ts: TokenStream) -> FlatTokens { + FlatTokens { + stack: vec![(ts.into_iter(), Delimiter::None, Span::call_site())], + } + } +} + +impl Iterator for FlatTokens { + type Item = Token; + fn next(&mut self) -> Option { + while let Some(&mut (ref mut it, delim, span_close)) = self.stack.last_mut() { + match it.next() { + Some(TokenTree::Group(g)) => { + // Return the open delimiter and continue with the contents of the group. + self.stack.push((g.stream().into_iter(), g.delimiter(), g.span_close())); + let open_ch = match g.delimiter() { + Delimiter::Parenthesis => '(', + Delimiter::Bracket => '[', + Delimiter::Brace => '{', + // Skip over `Delimiter::None`, and `continue` to try the next available + // token. + Delimiter::None => continue, + }; + let range = g.span_open().byte_range(); + return Some(Token { + text: open_ch.to_string().into(), + spacing: Spacing::Alone, + span: (range.start, range.end), + }); + }, + Some(tt@TokenTree::Ident(_)) | + Some(tt@TokenTree::Punct(_)) | + Some(tt@TokenTree::Literal(_)) => return Some(Token::from_token_tree(tt)), + None => { + // Pop the now-empty group and return the close delimiter. + self.stack.pop(); + let close_ch = match delim { + Delimiter::Parenthesis => ')', + Delimiter::Bracket => ']', + Delimiter::Brace => '}', + // Skip over `Delimiter::None`, and `continue` to try the next available + // token. + Delimiter::None => continue, + }; + let range = span_close.byte_range(); + return Some(Token { + text: close_ch.to_string().into(), + spacing: Spacing::Alone, + span: (range.start, range.end), + }); + }, + } + } + None + } +} + + +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct Token { + pub text: Box, + /// Spacing, for punctuation tokens. This is `Spacing::Alone` for all non-`Punct` tokens. + pub spacing: Spacing, + pub span: (usize, usize), +} + +impl Token { + pub fn from_token_tree(tt: TokenTree) -> Token { + let text = tt.to_string().into_boxed_str(); + let spacing = match tt { + TokenTree::Punct(ref p) => p.spacing(), + _ => Spacing::Alone, + }; + let range = tt.span().byte_range(); + let start = range.start; + let end = range.end; + Token { text, spacing, span: (start, end) } + } +} + + +pub struct TokenIndex<'a> { + tokens: &'a [Token], + /// Multi-map mapping `(start, end)` to indexes in `tokens` that have that span. + index: BTreeSet<((usize, usize), usize)>, +} + +impl<'a> TokenIndex<'a> { + pub fn new(tokens: &'a [Token]) -> TokenIndex<'a> { + let mut index = BTreeSet::new(); + for (i, t) in tokens.iter().enumerate() { + index.insert((t.span, i)); + } + TokenIndex { tokens, index } + } + + pub fn find<'b>(&'b self, t: &Token) -> Option { + let (start, end) = t.span; + let lo = ((start, end), 0); + let hi = ((start, end), usize::MAX); + let mut found = None; + for &(_, i) in self.index.range(lo ..= hi) { + if self.tokens[i] == *t { + if found.is_none() { + found = Some(i); + } else { + // Found multiple identical tokens. This is ambiguous. + return None; + } + } + } + found + } +} + + +pub struct OutputBuffer { + s: String, + /// Whether the most recently emitted chunk had `Spacing::Joint`. + prev_was_joint: bool, + /// Index in `s` of the start of the most recent line. + prev_bol: usize, +} + +impl OutputBuffer { + pub fn new() -> OutputBuffer { + OutputBuffer { + s: String::new(), + prev_was_joint: true, + prev_bol: 0, + } + } + + /// Emit a token or a group of tokens. + /// + /// This assumes that the start of `chunk` is the start of a token (not whitespace or a non-doc + /// comment) and that the end of `chunk` is the end of a token. + pub fn emit(&mut self, chunk: &str, spacing: Spacing) { + let cur_line = &self.s[self.prev_bol..]; + if self.prev_was_joint { + // No whitespace is allowed between a `Joint` token and the subsequent token. + } else { + if cur_line.contains("//") { + // Note this can throw false positives, such as if `//` appears inside a string + // literal. But it's legal to replace any `' '` with `'\n'`; `rustfmt` will fix it + // if needed. + self.s.push('\n'); + self.prev_bol = self.s.len(); + } else { + self.s.push(' '); + } + } + + // If `chunk` contains a newline, update the beginning-of-line position. + if let Some(i) = chunk.bytes().rposition(|b| b == b'\n') { + self.prev_bol = self.s.len() + i + 1; + } + + self.s.push_str(chunk); + self.prev_was_joint = matches!(spacing, Spacing::Joint); + } + + pub fn finish(self) -> String { + self.s + } +} + +pub fn render_output( + orig: &str, + orig_tokens: &[Token], + ti: &TokenIndex, + ts: TokenStream, + buf: &mut OutputBuffer, +) { + if let Some(t) = orig_tokens.get(0) { + let (start_pos, _) = t.span; + buf.emit(&orig[0 .. start_pos], Spacing::Joint); + } + + struct Run { + /// Byte offset of the start of the first token in the run. + start_pos: usize, + /// Index in `orig_tokens` of the last token in the run. + end_idx: usize, + } + let mut current_run: Option = None; + for t in FlatTokens::new(ts) { + // Try to continue the current run. + if let Some(ref mut run) = current_run { + if orig_tokens.get(run.end_idx + 1) == Some(&t) { + run.end_idx += 1; + continue; + } else { + // End the current run. + let end_token = &orig_tokens[run.end_idx]; + let start_pos = run.start_pos; + let (_, end_pos) = end_token.span; + buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + current_run = None; + } + } + + // Try to start a new run. + debug_assert!(current_run.is_none()); + if let Some(idx) = ti.find(&t) { + let (start_pos, _) = t.span; + current_run = Some(Run { start_pos, end_idx: idx }); + continue; + } + + // This token is not part of a run. Emit it directly. + buf.emit(&t.text, t.spacing); + } + + if let Some(run) = current_run { + let end_token = &orig_tokens[run.end_idx]; + let start_pos = run.start_pos; + let (_, end_pos) = end_token.span; + buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + } + + if let Some(t) = orig_tokens.last() { + let (_, end_pos) = t.span; + buf.emit(&orig[end_pos .. orig.len()], Spacing::Joint); + } +} diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock index f5a71a4fbe..99e5e4c556 100644 --- a/tools/split_ffi_entry_points/Cargo.lock +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -1387,6 +1387,13 @@ dependencies = [ "bitflags 2.10.0", ] +[[package]] +name = "rewrite_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", +] + [[package]] name = "rowan" version = "0.15.15" @@ -1625,6 +1632,7 @@ dependencies = [ "ra_ap_load-cargo", "ra_ap_project_model", "ra_ap_syntax", + "rewrite_util", "syn", ] diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index c563f15e99..2cc3bf845e 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -4,6 +4,8 @@ version = "0.1.0" edition = "2024" [dependencies] +rewrite_util = { path = "../rewrite_util" } + syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index c230d4c068..70502bb6e1 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -1,255 +1,22 @@ -use std::collections::BTreeSet; use std::env; use std::fs; use std::iter; use std::mem; use std::path::Path; use std::str::FromStr; -use proc_macro2::{TokenStream, TokenTree, Delimiter, Spacing, Span}; +use proc_macro2::{TokenStream, Span}; use quote::ToTokens; use ra_ap_hir::Semantics; use ra_ap_ide_db::RootDatabase; use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; use ra_ap_project_model::CargoConfig; use ra_ap_syntax::SyntaxNode; +use rewrite_util::{FlatTokens, TokenIndex, OutputBuffer, render_output}; use syn; use syn::spanned::Spanned; use syn::visit_mut::{self, VisitMut}; -struct FlatTokens { - stack: Vec<(proc_macro2::token_stream::IntoIter, Delimiter, Span)>, -} - -impl FlatTokens { - pub fn new(ts: TokenStream) -> FlatTokens { - FlatTokens { - stack: vec![(ts.into_iter(), Delimiter::None, Span::call_site())], - } - } -} - -impl Iterator for FlatTokens { - type Item = Token; - fn next(&mut self) -> Option { - while let Some(&mut (ref mut it, delim, span_close)) = self.stack.last_mut() { - match it.next() { - Some(TokenTree::Group(g)) => { - // Return the open delimiter and continue with the contents of the group. - self.stack.push((g.stream().into_iter(), g.delimiter(), g.span_close())); - let open_ch = match g.delimiter() { - Delimiter::Parenthesis => '(', - Delimiter::Bracket => '[', - Delimiter::Brace => '{', - // Skip over `Delimiter::None`, and `continue` to try the next available - // token. - Delimiter::None => continue, - }; - let range = g.span_open().byte_range(); - return Some(Token { - text: open_ch.to_string().into(), - spacing: Spacing::Alone, - span: (range.start, range.end), - }); - }, - Some(tt@TokenTree::Ident(_)) | - Some(tt@TokenTree::Punct(_)) | - Some(tt@TokenTree::Literal(_)) => return Some(Token::from_token_tree(tt)), - None => { - // Pop the now-empty group and return the close delimiter. - self.stack.pop(); - let close_ch = match delim { - Delimiter::Parenthesis => ')', - Delimiter::Bracket => ']', - Delimiter::Brace => '}', - // Skip over `Delimiter::None`, and `continue` to try the next available - // token. - Delimiter::None => continue, - }; - let range = span_close.byte_range(); - return Some(Token { - text: close_ch.to_string().into(), - spacing: Spacing::Alone, - span: (range.start, range.end), - }); - }, - } - } - None - } -} - - -#[derive(Clone, PartialEq, Eq, Debug)] -struct Token { - text: Box, - /// Spacing, for punctuation tokens. This is `Spacing::Alone` for all non-`Punct` tokens. - spacing: Spacing, - span: (usize, usize), -} - -impl Token { - pub fn from_token_tree(tt: TokenTree) -> Token { - let text = tt.to_string().into_boxed_str(); - let spacing = match tt { - TokenTree::Punct(ref p) => p.spacing(), - _ => Spacing::Alone, - }; - let range = tt.span().byte_range(); - let start = range.start; - let end = range.end; - Token { text, spacing, span: (start, end) } - } -} - - -struct TokenIndex<'a> { - tokens: &'a [Token], - /// Multi-map mapping `(start, end)` to indexes in `tokens` that have that span. - index: BTreeSet<((usize, usize), usize)>, -} - -impl<'a> TokenIndex<'a> { - pub fn new(tokens: &'a [Token]) -> TokenIndex<'a> { - let mut index = BTreeSet::new(); - for (i, t) in tokens.iter().enumerate() { - index.insert((t.span, i)); - } - TokenIndex { tokens, index } - } - - pub fn find<'b>(&'b self, t: &Token) -> Option { - let (start, end) = t.span; - let lo = ((start, end), 0); - let hi = ((start, end), usize::MAX); - let mut found = None; - for &(_, i) in self.index.range(lo ..= hi) { - if self.tokens[i] == *t { - if found.is_none() { - found = Some(i); - } else { - // Found multiple identical tokens. This is ambiguous. - return None; - } - } - } - found - } -} - - -struct OutputBuffer { - s: String, - /// Whether the most recently emitted chunk had `Spacing::Joint`. - prev_was_joint: bool, - /// Index in `s` of the start of the most recent line. - prev_bol: usize, -} - -impl OutputBuffer { - pub fn new() -> OutputBuffer { - OutputBuffer { - s: String::new(), - prev_was_joint: true, - prev_bol: 0, - } - } - - /// Emit a token or a group of tokens. - /// - /// This assumes that the start of `chunk` is the start of a token (not whitespace or a non-doc - /// comment) and that the end of `chunk` is the end of a token. - pub fn emit(&mut self, chunk: &str, spacing: Spacing) { - let cur_line = &self.s[self.prev_bol..]; - if self.prev_was_joint { - // No whitespace is allowed between a `Joint` token and the subsequent token. - } else { - if cur_line.contains("//") { - // Note this can throw false positives, such as if `//` appears inside a string - // literal. But it's legal to replace any `' '` with `'\n'`; `rustfmt` will fix it - // if needed. - self.s.push('\n'); - self.prev_bol = self.s.len(); - } else { - self.s.push(' '); - } - } - - // If `chunk` contains a newline, update the beginning-of-line position. - if let Some(i) = chunk.bytes().rposition(|b| b == b'\n') { - self.prev_bol = self.s.len() + i + 1; - } - - self.s.push_str(chunk); - self.prev_was_joint = matches!(spacing, Spacing::Joint); - } - - pub fn finish(self) -> String { - self.s - } -} - -fn render_output( - orig: &str, - orig_tokens: &[Token], - ti: &TokenIndex, - ts: TokenStream, - buf: &mut OutputBuffer, -) { - if let Some(t) = orig_tokens.get(0) { - let (start_pos, _) = t.span; - buf.emit(&orig[0 .. start_pos], Spacing::Joint); - } - - struct Run { - /// Byte offset of the start of the first token in the run. - start_pos: usize, - /// Index in `orig_tokens` of the last token in the run. - end_idx: usize, - } - let mut current_run: Option = None; - for t in FlatTokens::new(ts) { - // Try to continue the current run. - if let Some(ref mut run) = current_run { - if orig_tokens.get(run.end_idx + 1) == Some(&t) { - run.end_idx += 1; - continue; - } else { - // End the current run. - let end_token = &orig_tokens[run.end_idx]; - let start_pos = run.start_pos; - let (_, end_pos) = end_token.span; - buf.emit(&orig[start_pos .. end_pos], end_token.spacing); - current_run = None; - } - } - - // Try to start a new run. - debug_assert!(current_run.is_none()); - if let Some(idx) = ti.find(&t) { - let (start_pos, _) = t.span; - current_run = Some(Run { start_pos, end_idx: idx }); - continue; - } - - // This token is not part of a run. Emit it directly. - buf.emit(&t.text, t.spacing); - } - - if let Some(run) = current_run { - let end_token = &orig_tokens[run.end_idx]; - let start_pos = run.start_pos; - let (_, end_pos) = end_token.span; - buf.emit(&orig[start_pos .. end_pos], end_token.spacing); - } - - if let Some(t) = orig_tokens.last() { - let (_, end_pos) = t.span; - buf.emit(&orig[end_pos .. orig.len()], Spacing::Joint); - } -} - - struct AddDerivedItemVisitor(F); impl Option> AddDerivedItemVisitor { From 45cd82621534e7e423b8dc93cbd66f43bd497084 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Mon, 10 Nov 2025 11:41:36 -0800 Subject: [PATCH 07/25] rename rewrite_util -> rust_util::rewrite --- tools/{rewrite_util => rust_util}/Cargo.lock | 2 +- tools/{rewrite_util => rust_util}/Cargo.toml | 2 +- tools/rust_util/src/lib.rs | 1 + .../src/lib.rs => rust_util/src/rewrite.rs} | 0 tools/split_ffi_entry_points/Cargo.lock | 18 ++++++++++-------- tools/split_ffi_entry_points/Cargo.toml | 2 +- tools/split_ffi_entry_points/src/main.rs | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) rename tools/{rewrite_util => rust_util}/Cargo.lock (96%) rename tools/{rewrite_util => rust_util}/Cargo.toml (84%) create mode 100644 tools/rust_util/src/lib.rs rename tools/{rewrite_util/src/lib.rs => rust_util/src/rewrite.rs} (100%) diff --git a/tools/rewrite_util/Cargo.lock b/tools/rust_util/Cargo.lock similarity index 96% rename from tools/rewrite_util/Cargo.lock rename to tools/rust_util/Cargo.lock index 762c09d51b..174422f027 100644 --- a/tools/rewrite_util/Cargo.lock +++ b/tools/rust_util/Cargo.lock @@ -12,7 +12,7 @@ dependencies = [ ] [[package]] -name = "rewrite_util" +name = "rust_util" version = "0.1.0" dependencies = [ "proc-macro2", diff --git a/tools/rewrite_util/Cargo.toml b/tools/rust_util/Cargo.toml similarity index 84% rename from tools/rewrite_util/Cargo.toml rename to tools/rust_util/Cargo.toml index 6f4a4d5e32..cc636988bf 100644 --- a/tools/rewrite_util/Cargo.toml +++ b/tools/rust_util/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rewrite_util" +name = "rust_util" version = "0.1.0" edition = "2024" diff --git a/tools/rust_util/src/lib.rs b/tools/rust_util/src/lib.rs new file mode 100644 index 0000000000..e7dea9be4e --- /dev/null +++ b/tools/rust_util/src/lib.rs @@ -0,0 +1 @@ +pub mod rewrite; diff --git a/tools/rewrite_util/src/lib.rs b/tools/rust_util/src/rewrite.rs similarity index 100% rename from tools/rewrite_util/src/lib.rs rename to tools/rust_util/src/rewrite.rs diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock index 99e5e4c556..bee8145082 100644 --- a/tools/split_ffi_entry_points/Cargo.lock +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -1387,13 +1387,6 @@ dependencies = [ "bitflags 2.10.0", ] -[[package]] -name = "rewrite_util" -version = "0.1.0" -dependencies = [ - "proc-macro2", -] - [[package]] name = "rowan" version = "0.15.15" @@ -1407,6 +1400,15 @@ dependencies = [ "text-size", ] +[[package]] +name = "rust_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1632,7 +1634,7 @@ dependencies = [ "ra_ap_load-cargo", "ra_ap_project_model", "ra_ap_syntax", - "rewrite_util", + "rust_util", "syn", ] diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index 2cc3bf845e..b21e6d95e0 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2024" [dependencies] -rewrite_util = { path = "../rewrite_util" } +rust_util = { path = "../rust_util" } syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index 70502bb6e1..a3b6e04932 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -11,7 +11,7 @@ use ra_ap_ide_db::RootDatabase; use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; use ra_ap_project_model::CargoConfig; use ra_ap_syntax::SyntaxNode; -use rewrite_util::{FlatTokens, TokenIndex, OutputBuffer, render_output}; +use rust_util::rewrite::{FlatTokens, TokenIndex, OutputBuffer, render_output}; use syn; use syn::spanned::Spanned; use syn::visit_mut::{self, VisitMut}; From c994b35c5cb567560b6f2cb41a15ae0b9affb41f Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Mon, 10 Nov 2025 11:44:47 -0800 Subject: [PATCH 08/25] rust_util: add FileCollector --- tools/rust_util/Cargo.lock | 22 +++++++ tools/rust_util/Cargo.toml | 2 + tools/rust_util/src/collect.rs | 107 +++++++++++++++++++++++++++++++++ tools/rust_util/src/error.rs | 56 +++++++++++++++++ tools/rust_util/src/lib.rs | 2 + 5 files changed, 189 insertions(+) create mode 100644 tools/rust_util/src/collect.rs create mode 100644 tools/rust_util/src/error.rs diff --git a/tools/rust_util/Cargo.lock b/tools/rust_util/Cargo.lock index 174422f027..ea2628801a 100644 --- a/tools/rust_util/Cargo.lock +++ b/tools/rust_util/Cargo.lock @@ -11,11 +11,33 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + [[package]] name = "rust_util" version = "0.1.0" dependencies = [ "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] diff --git a/tools/rust_util/Cargo.toml b/tools/rust_util/Cargo.toml index cc636988bf..ae39291263 100644 --- a/tools/rust_util/Cargo.toml +++ b/tools/rust_util/Cargo.toml @@ -4,4 +4,6 @@ version = "0.1.0" edition = "2024" [dependencies] +syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } +quote = "1" diff --git a/tools/rust_util/src/collect.rs b/tools/rust_util/src/collect.rs new file mode 100644 index 0000000000..26585e9430 --- /dev/null +++ b/tools/rust_util/src/collect.rs @@ -0,0 +1,107 @@ +use std::collections::HashSet; +use std::fs; +use std::iter; +use std::path::{Path, PathBuf}; +use syn; +use crate::error::Error; + + +#[derive(Clone, Default)] +pub struct FileCollector { + pub files: Vec<(PathBuf, syn::File)>, + seen: HashSet, +} + +impl FileCollector { + pub fn parse( + &mut self, + path: impl AsRef, + is_root: bool, + ) -> Result<(), Error> { + let path = path.as_ref(); + if self.seen.contains(path) { + return Ok(()); + } + let src = fs::read_to_string(path) + .map_err(|e| Error::from(e).at(format_args!("reading {path:?}")))?; + let ast: syn::File = syn::parse_file(&src) + .map_err(|e| Error::from(e).at(format_args!("parsing {path:?}")))?; + // Set `seen` immediately, but don't add to `files` (and give up ownership) until we're + // done walking `ast`. + self.seen.insert(path.to_owned()); + let is_mod_rs = is_root || path.file_name().is_some_and(|n| n == "mod.rs"); + let base_path_storage; + let base_path = if is_mod_rs { + path.parent().ok_or_else(|| format!("mod.rs path {path:?} has no parent"))? + } else { + base_path_storage = path.with_extension(""); + &base_path_storage + }; + self.walk_items(&ast.items, base_path, &[])?; + self.files.push((path.to_owned(), ast)); + Ok(()) + } + + fn walk_items( + &mut self, + items: &[syn::Item], + base_path: &Path, + parent_module: &[&str], + ) -> Result<(), Error> { + for item in items { + let im = match *item { + syn::Item::Mod(ref im) => im, + _ => continue, + }; + if let Some((_, ref inline_items)) = im.content { + let name = path_attr_value(&im.attrs)? + .unwrap_or_else(|| im.ident.to_string()); + let module = parent_module.iter().copied().chain(iter::once(&name as &_)) + .collect::>(); + self.walk_items(inline_items, base_path, &module)?; + } else { + let mut path = base_path.to_owned(); + for &m in parent_module { + path.push(m); + } + if let Some(attr_path) = path_attr_value(&im.attrs)? { + path.push(attr_path); + self.parse(path, false)?; + } else { + let name = im.ident.to_string(); + // Try `foo/mod.rs` first; if it doesn't exist, try `foo.rs` instead. + path.push(name); + path.push("mod.rs"); + if !fs::exists(&path)? { + path.pop(); + path.set_extension("rs"); + } + self.parse(path, false)?; + } + } + } + Ok(()) + } +} + +fn path_attr_value(attrs: &[syn::Attribute]) -> Result, Error> { + for attr in attrs { + if !attr.meta.path().is_ident("path") { + continue; + } + let mnv = match attr.meta { + syn::Meta::NameValue(ref x) => x, + _ => return Err("expected `path` attribute to have a value".into()), + }; + let el = match mnv.value { + syn::Expr::Lit(ref x) => x, + _ => return Err("expected `path` attribute value to be a literal".into()), + }; + let ls = match el.lit { + syn::Lit::Str(ref x) => x, + _ => return Err("expected `path` attribute value to be a string literal".into()), + }; + return Ok(Some(ls.value())); + } + Ok(None) +} diff --git a/tools/rust_util/src/error.rs b/tools/rust_util/src/error.rs new file mode 100644 index 0000000000..0cf3382cef --- /dev/null +++ b/tools/rust_util/src/error.rs @@ -0,0 +1,56 @@ +use std::fmt::{self, Display}; +use std::io; +use syn; + + +#[derive(Debug)] +pub enum Error { + Io(io::Error), + Syn(syn::Error), + Str(String), + At(String, Box), +} + +impl From for Error { + fn from(x: io::Error) -> Error { Error::Io(x) } +} + +impl From for Error { + fn from(x: syn::Error) -> Error { Error::Syn(x) } +} + +impl From for Error { + fn from(x: String) -> Error { Error::Str(x) } +} + +impl From<&str> for Error { + fn from(x: &str) -> Error { Error::Str(x.to_owned()) } +} + +impl Error { + pub fn at(self, desc: impl Display) -> Error { + Error::At(desc.to_string(), Box::new(self)) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::Io(ref x) => Display::fmt(x, f), + Error::Syn(ref x) => Display::fmt(x, f), + Error::Str(ref x) => Display::fmt(x, f), + Error::At(ref desc, ref inner) => write!(f, "{desc}: {inner}"), + } + } +} + +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match *self { + Error::Io(ref x) => Some(x), + Error::Syn(ref x) => Some(x), + Error::Str(_) => None, + Error::At(_, ref x) => Some(x), + } + } +} diff --git a/tools/rust_util/src/lib.rs b/tools/rust_util/src/lib.rs index e7dea9be4e..27832f819d 100644 --- a/tools/rust_util/src/lib.rs +++ b/tools/rust_util/src/lib.rs @@ -1 +1,3 @@ +pub mod collect; +pub mod error; pub mod rewrite; From f740a77b2252433f3e32e53a87e9915831688e34 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Mon, 10 Nov 2025 12:07:24 -0800 Subject: [PATCH 09/25] tools/split_rust: initial commit --- tools/split_rust/Cargo.lock | 118 +++++++++++++++++++++++++++++++++++ tools/split_rust/Cargo.toml | 13 ++++ tools/split_rust/src/main.rs | 70 +++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 tools/split_rust/Cargo.lock create mode 100644 tools/split_rust/Cargo.toml create mode 100644 tools/split_rust/src/main.rs diff --git a/tools/split_rust/Cargo.lock b/tools/split_rust/Cargo.lock new file mode 100644 index 0000000000..611c6bddf9 --- /dev/null +++ b/tools/split_rust/Cargo.lock @@ -0,0 +1,118 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rust_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "split_rust" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "rust_util", + "serde_json", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" diff --git a/tools/split_rust/Cargo.toml b/tools/split_rust/Cargo.toml new file mode 100644 index 0000000000..21a4ddf5cf --- /dev/null +++ b/tools/split_rust/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "split_rust" +version = "0.1.0" +edition = "2024" + +[dependencies] +rust_util = { path = "../rust_util" } + +syn = { version = "2.0.108", features = ["full", "visit"] } +proc-macro2 = { version = "1", features = ["span-locations"] } +quote = "1" + +serde_json = "1" diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs new file mode 100644 index 0000000000..2851d26c31 --- /dev/null +++ b/tools/split_rust/src/main.rs @@ -0,0 +1,70 @@ +use std::env; +use std::path::Path; +use proc_macro2::Span; +use rust_util::collect::FileCollector; +use serde_json; +use syn; +use syn::spanned::Spanned; +use syn::visit::{self, Visit}; + +struct ItemSpanVisitor<'a> { + file_path: &'a Path, + cur_path: Vec, + item_spans: Vec<(Vec, &'a Path, usize, usize)>, +} + +impl<'a> ItemSpanVisitor<'a> { + pub fn new(file_path: &'a Path) -> ItemSpanVisitor<'a> { + ItemSpanVisitor { + file_path, + cur_path: Vec::new(), + item_spans: Vec::new(), + } + } + + fn _emit(&mut self, name: String, sp: Span) { + self.enter(name, sp, |_| {}); + } + + fn enter(&mut self, name: String, sp: Span, f: impl FnOnce(&mut Self) -> R) -> R { + self.cur_path.push(name); + + let range = sp.byte_range(); + self.item_spans.push((self.cur_path.clone(), self.file_path, range.start, range.end)); + let r = f(self); + + self.cur_path.pop(); + r + } +} + +impl Visit<'_> for ItemSpanVisitor<'_> { + fn visit_item(&mut self, item: &syn::Item) { + match *item { + syn::Item::Fn(ref ifn) => { + let name = ifn.sig.ident.to_string(); + self.enter(name, ifn.span(), |v| v.visit_item_fn(ifn)); + }, + syn::Item::Mod(ref im) => { + let name = im.ident.to_string(); + self.enter(name, im.span(), |v| v.visit_item_mod(im)); + }, + _ => { + visit::visit_item(self, item); + }, + } + } +} + +fn main() { + let mut fc = FileCollector::default(); + fc.parse(env::args().nth(1).unwrap(), true).unwrap(); + let mut out = Vec::new(); + for &(ref name, ref ast) in &fc.files { + eprintln!("visit {:?}", name); + let mut v = ItemSpanVisitor::new(name); + v.visit_file(ast); + out.extend(v.item_spans); + } + serde_json::to_writer(std::io::stdout(), &out).unwrap(); +} From f88e410c4d658de4038d5e851d72e0640cfdc7eb Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 12 Nov 2025 15:23:56 -0800 Subject: [PATCH 10/25] rust_util: track module path in FileCollector --- tools/rust_util/src/collect.rs | 37 +++++++++++++++++++--------------- tools/split_rust/src/main.rs | 10 ++++----- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tools/rust_util/src/collect.rs b/tools/rust_util/src/collect.rs index 26585e9430..a69cad854f 100644 --- a/tools/rust_util/src/collect.rs +++ b/tools/rust_util/src/collect.rs @@ -8,37 +8,39 @@ use crate::error::Error; #[derive(Clone, Default)] pub struct FileCollector { - pub files: Vec<(PathBuf, syn::File)>, + /// File path, module path, and AST for each file visited so far. + pub files: Vec<(PathBuf, Vec, syn::File)>, seen: HashSet, } impl FileCollector { pub fn parse( &mut self, - path: impl AsRef, + file_path: impl AsRef, + mod_path: Vec, is_root: bool, ) -> Result<(), Error> { - let path = path.as_ref(); - if self.seen.contains(path) { + let file_path = file_path.as_ref(); + if self.seen.contains(file_path) { return Ok(()); } - let src = fs::read_to_string(path) - .map_err(|e| Error::from(e).at(format_args!("reading {path:?}")))?; + let src = fs::read_to_string(file_path) + .map_err(|e| Error::from(e).at(format_args!("reading {file_path:?}")))?; let ast: syn::File = syn::parse_file(&src) - .map_err(|e| Error::from(e).at(format_args!("parsing {path:?}")))?; + .map_err(|e| Error::from(e).at(format_args!("parsing {file_path:?}")))?; // Set `seen` immediately, but don't add to `files` (and give up ownership) until we're // done walking `ast`. - self.seen.insert(path.to_owned()); - let is_mod_rs = is_root || path.file_name().is_some_and(|n| n == "mod.rs"); + self.seen.insert(file_path.to_owned()); + let is_mod_rs = is_root || file_path.file_name().is_some_and(|n| n == "mod.rs"); let base_path_storage; let base_path = if is_mod_rs { - path.parent().ok_or_else(|| format!("mod.rs path {path:?} has no parent"))? + file_path.parent().ok_or_else(|| format!("mod.rs path {file_path:?} has no parent"))? } else { - base_path_storage = path.with_extension(""); + base_path_storage = file_path.with_extension(""); &base_path_storage }; - self.walk_items(&ast.items, base_path, &[])?; - self.files.push((path.to_owned(), ast)); + self.walk_items(&ast.items, base_path, mod_path.clone(), &[])?; + self.files.push((file_path.to_owned(), mod_path, ast)); Ok(()) } @@ -46,6 +48,7 @@ impl FileCollector { &mut self, items: &[syn::Item], base_path: &Path, + mut mod_path: Vec, parent_module: &[&str], ) -> Result<(), Error> { for item in items { @@ -53,12 +56,13 @@ impl FileCollector { syn::Item::Mod(ref im) => im, _ => continue, }; + mod_path.push(im.ident.to_string()); if let Some((_, ref inline_items)) = im.content { let name = path_attr_value(&im.attrs)? .unwrap_or_else(|| im.ident.to_string()); let module = parent_module.iter().copied().chain(iter::once(&name as &_)) .collect::>(); - self.walk_items(inline_items, base_path, &module)?; + self.walk_items(inline_items, base_path, mod_path.clone(), &module)?; } else { let mut path = base_path.to_owned(); for &m in parent_module { @@ -66,7 +70,7 @@ impl FileCollector { } if let Some(attr_path) = path_attr_value(&im.attrs)? { path.push(attr_path); - self.parse(path, false)?; + self.parse(path, mod_path.clone(), false)?; } else { let name = im.ident.to_string(); // Try `foo/mod.rs` first; if it doesn't exist, try `foo.rs` instead. @@ -76,9 +80,10 @@ impl FileCollector { path.pop(); path.set_extension("rs"); } - self.parse(path, false)?; + self.parse(path, mod_path.clone(), false)?; } } + mod_path.pop(); } Ok(()) } diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index 2851d26c31..40c4446bb6 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -14,10 +14,10 @@ struct ItemSpanVisitor<'a> { } impl<'a> ItemSpanVisitor<'a> { - pub fn new(file_path: &'a Path) -> ItemSpanVisitor<'a> { + pub fn new(file_path: &'a Path, mod_path: Vec) -> ItemSpanVisitor<'a> { ItemSpanVisitor { file_path, - cur_path: Vec::new(), + cur_path: mod_path, item_spans: Vec::new(), } } @@ -58,11 +58,11 @@ impl Visit<'_> for ItemSpanVisitor<'_> { fn main() { let mut fc = FileCollector::default(); - fc.parse(env::args().nth(1).unwrap(), true).unwrap(); + fc.parse(env::args().nth(1).unwrap(), vec![], true).unwrap(); let mut out = Vec::new(); - for &(ref name, ref ast) in &fc.files { + for &(ref name, ref mod_path, ref ast) in &fc.files { eprintln!("visit {:?}", name); - let mut v = ItemSpanVisitor::new(name); + let mut v = ItemSpanVisitor::new(name, mod_path.to_owned()); v.visit_file(ast); out.extend(v.item_spans); } From bcc86c645335f62352eddfdb3d185dce0ad7cd8c Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 12 Nov 2025 16:01:46 -0800 Subject: [PATCH 11/25] split_rust: output code snippets instead of spans --- tools/split_rust/src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index 40c4446bb6..3b06b2be38 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -1,4 +1,6 @@ +use std::collections::HashMap; use std::env; +use std::fs; use std::path::Path; use proc_macro2::Span; use rust_util::collect::FileCollector; @@ -59,12 +61,17 @@ impl Visit<'_> for ItemSpanVisitor<'_> { fn main() { let mut fc = FileCollector::default(); fc.parse(env::args().nth(1).unwrap(), vec![], true).unwrap(); - let mut out = Vec::new(); + let mut out = HashMap::new(); for &(ref name, ref mod_path, ref ast) in &fc.files { eprintln!("visit {:?}", name); let mut v = ItemSpanVisitor::new(name, mod_path.to_owned()); v.visit_file(ast); - out.extend(v.item_spans); + + let src = fs::read_to_string(name).unwrap(); + for &(ref item_path, _, lo, hi) in &v.item_spans { + let snippet = &src[lo .. hi]; + out.insert(item_path.join("::"), snippet.to_owned()); + } } serde_json::to_writer(std::io::stdout(), &out).unwrap(); } From 1091e0425b0d65ac57b6ebfa27b3cd93db517770 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 12 Nov 2025 16:17:35 -0800 Subject: [PATCH 12/25] refactor: move ItemSpanVisitor from split_rust into rust_util --- tools/rust_util/src/item_span.rs | 60 ++++++++++++++++++++++++++++++++ tools/rust_util/src/lib.rs | 1 + tools/split_rust/src/main.rs | 60 ++------------------------------ 3 files changed, 63 insertions(+), 58 deletions(-) create mode 100644 tools/rust_util/src/item_span.rs diff --git a/tools/rust_util/src/item_span.rs b/tools/rust_util/src/item_span.rs new file mode 100644 index 0000000000..cbe812e3a7 --- /dev/null +++ b/tools/rust_util/src/item_span.rs @@ -0,0 +1,60 @@ +use proc_macro2::Span; +use syn; +use syn::spanned::Spanned; +use syn::visit::{self, Visit}; + +struct ItemSpanVisitor { + cur_path: Vec, + item_spans: Vec<(Vec, usize, usize)>, +} + +impl ItemSpanVisitor { + pub fn new(mod_path: Vec) -> ItemSpanVisitor { + ItemSpanVisitor { + cur_path: mod_path, + item_spans: Vec::new(), + } + } + + fn _emit(&mut self, name: String, sp: Span) { + self.enter(name, sp, |_| {}); + } + + fn enter(&mut self, name: String, sp: Span, f: impl FnOnce(&mut Self) -> R) -> R { + self.cur_path.push(name); + + let range = sp.byte_range(); + self.item_spans.push((self.cur_path.clone(), range.start, range.end)); + let r = f(self); + + self.cur_path.pop(); + r + } +} + +impl Visit<'_> for ItemSpanVisitor { + fn visit_item(&mut self, item: &syn::Item) { + match *item { + syn::Item::Fn(ref ifn) => { + let name = ifn.sig.ident.to_string(); + self.enter(name, ifn.span(), |v| v.visit_item_fn(ifn)); + }, + syn::Item::Mod(ref im) => { + let name = im.ident.to_string(); + self.enter(name, im.span(), |v| v.visit_item_mod(im)); + }, + // TODO: handle other items that can contain nested items. Note that any expr or type + // can contain items, e.g. `type T = [u8; { fn f(){} 10 }];` + _ => { + visit::visit_item(self, item); + }, + } + } +} + + +pub fn item_spans(mod_path: Vec, ast: &syn::File) -> Vec<(Vec, usize, usize)> { + let mut v = ItemSpanVisitor::new(mod_path); + v.visit_file(ast); + v.item_spans +} diff --git a/tools/rust_util/src/lib.rs b/tools/rust_util/src/lib.rs index 27832f819d..06ffc31b9e 100644 --- a/tools/rust_util/src/lib.rs +++ b/tools/rust_util/src/lib.rs @@ -1,3 +1,4 @@ pub mod collect; pub mod error; +pub mod item_span; pub mod rewrite; diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index 3b06b2be38..f1e77fcf13 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -1,62 +1,9 @@ use std::collections::HashMap; use std::env; use std::fs; -use std::path::Path; -use proc_macro2::Span; use rust_util::collect::FileCollector; +use rust_util::item_span::item_spans; use serde_json; -use syn; -use syn::spanned::Spanned; -use syn::visit::{self, Visit}; - -struct ItemSpanVisitor<'a> { - file_path: &'a Path, - cur_path: Vec, - item_spans: Vec<(Vec, &'a Path, usize, usize)>, -} - -impl<'a> ItemSpanVisitor<'a> { - pub fn new(file_path: &'a Path, mod_path: Vec) -> ItemSpanVisitor<'a> { - ItemSpanVisitor { - file_path, - cur_path: mod_path, - item_spans: Vec::new(), - } - } - - fn _emit(&mut self, name: String, sp: Span) { - self.enter(name, sp, |_| {}); - } - - fn enter(&mut self, name: String, sp: Span, f: impl FnOnce(&mut Self) -> R) -> R { - self.cur_path.push(name); - - let range = sp.byte_range(); - self.item_spans.push((self.cur_path.clone(), self.file_path, range.start, range.end)); - let r = f(self); - - self.cur_path.pop(); - r - } -} - -impl Visit<'_> for ItemSpanVisitor<'_> { - fn visit_item(&mut self, item: &syn::Item) { - match *item { - syn::Item::Fn(ref ifn) => { - let name = ifn.sig.ident.to_string(); - self.enter(name, ifn.span(), |v| v.visit_item_fn(ifn)); - }, - syn::Item::Mod(ref im) => { - let name = im.ident.to_string(); - self.enter(name, im.span(), |v| v.visit_item_mod(im)); - }, - _ => { - visit::visit_item(self, item); - }, - } - } -} fn main() { let mut fc = FileCollector::default(); @@ -64,11 +11,8 @@ fn main() { let mut out = HashMap::new(); for &(ref name, ref mod_path, ref ast) in &fc.files { eprintln!("visit {:?}", name); - let mut v = ItemSpanVisitor::new(name, mod_path.to_owned()); - v.visit_file(ast); - let src = fs::read_to_string(name).unwrap(); - for &(ref item_path, _, lo, hi) in &v.item_spans { + for (item_path, lo, hi) in item_spans(mod_path.to_owned(), ast) { let snippet = &src[lo .. hi]; out.insert(item_path.join("::"), snippet.to_owned()); } From 8e8456fee09ca44722d1984a8184a48751d11167 Mon Sep 17 00:00:00 2001 From: Stuart Pernsteiner Date: Wed, 12 Nov 2025 16:56:20 -0800 Subject: [PATCH 13/25] add tools/merge_rust/ --- tools/merge_rust/Cargo.lock | 118 +++++++++++++++++++++++++++++++++++ tools/merge_rust/Cargo.toml | 13 ++++ tools/merge_rust/src/main.rs | 54 ++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 tools/merge_rust/Cargo.lock create mode 100644 tools/merge_rust/Cargo.toml create mode 100644 tools/merge_rust/src/main.rs diff --git a/tools/merge_rust/Cargo.lock b/tools/merge_rust/Cargo.lock new file mode 100644 index 0000000000..7394bb940f --- /dev/null +++ b/tools/merge_rust/Cargo.lock @@ -0,0 +1,118 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "merge_rust" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "rust_util", + "serde_json", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rust_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "syn" +version = "2.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" diff --git a/tools/merge_rust/Cargo.toml b/tools/merge_rust/Cargo.toml new file mode 100644 index 0000000000..6f40c76ce3 --- /dev/null +++ b/tools/merge_rust/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "merge_rust" +version = "0.1.0" +edition = "2024" + +[dependencies] +rust_util = { path = "../rust_util" } + +syn = { version = "2.0.108", features = ["full", "visit"] } +proc-macro2 = { version = "1", features = ["span-locations"] } +quote = "1" + +serde_json = "1" diff --git a/tools/merge_rust/src/main.rs b/tools/merge_rust/src/main.rs new file mode 100644 index 0000000000..c8c02d2a45 --- /dev/null +++ b/tools/merge_rust/src/main.rs @@ -0,0 +1,54 @@ +use std::collections::HashMap; +use std::env; +use std::fs::{self, File}; +use rust_util::collect::FileCollector; +use rust_util::item_span::item_spans; +use serde_json; + +fn main() { + let src_root_path = env::args().nth(1).unwrap(); + let new_snippet_json_path = env::args().nth(2).unwrap(); + + let new_snippets_file = File::open(&new_snippet_json_path).unwrap(); + let new_snippets: HashMap = + serde_json::from_reader(new_snippets_file).unwrap(); + + let mut fc = FileCollector::default(); + fc.parse(&src_root_path, vec![], true).unwrap(); + for &(ref file_path, ref mod_path, ref ast) in &fc.files { + eprintln!("visit {:?}", file_path); + let old_src = fs::read_to_string(file_path).unwrap(); + + let mut rewrites = Vec::new(); + for (item_path, lo, hi) in item_spans(mod_path.to_owned(), ast) { + let old_snippet = &old_src[lo .. hi]; + let item_path_str = item_path.join("::"); + if let Some(new_snippet) = new_snippets.get(&item_path_str) { + if new_snippet != old_snippet { + rewrites.push((lo, hi, new_snippet)); + } + } + } + + if rewrites.len() == 0 { + continue; + } + + rewrites.sort_by_key(|&(lo, _, _)| lo); + let mut new_src = String::with_capacity(old_src.len()); + let mut pos = 0; + for &(lo, hi, new_snippet) in &rewrites { + assert!(lo >= pos, "overlapping rewrites: previous rewrite ended at {}, \ + but current rewrite covers {} .. {}", pos, lo, hi); + new_src.push_str(&old_src[pos .. lo]); + new_src.push_str(new_snippet); + pos = hi; + } + new_src.push_str(&old_src[pos..]); + + let tmp_path = file_path.with_extension(".new"); + fs::write(&tmp_path, &new_src).unwrap(); + fs::rename(&tmp_path, file_path).unwrap(); + eprintln!("applied {} rewrites to {:?}", rewrites.len(), file_path); + } +} From c4effc690d6e3d4e5cbae3ec17c850454163194e Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Sun, 23 Nov 2025 22:18:18 -0500 Subject: [PATCH 14/25] tools/merge_rust: use clap for arguments --- tools/merge_rust/Cargo.lock | 142 +++++++++++++++++++++++++++++++++++ tools/merge_rust/Cargo.toml | 1 + tools/merge_rust/src/main.rs | 17 ++++- 3 files changed, 157 insertions(+), 3 deletions(-) diff --git a/tools/merge_rust/Cargo.lock b/tools/merge_rust/Cargo.lock index 7394bb940f..ca20e777f6 100644 --- a/tools/merge_rust/Cargo.lock +++ b/tools/merge_rust/Cargo.lock @@ -2,6 +2,114 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "itoa" version = "1.0.15" @@ -18,6 +126,7 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" name = "merge_rust" version = "0.1.0" dependencies = [ + "clap", "proc-macro2", "quote", "rust_util", @@ -25,6 +134,12 @@ dependencies = [ "syn", ] +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "proc-macro2" version = "1.0.103" @@ -100,6 +215,12 @@ dependencies = [ "serde_core", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.110" @@ -116,3 +237,24 @@ name = "unicode-ident" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] diff --git a/tools/merge_rust/Cargo.toml b/tools/merge_rust/Cargo.toml index 6f40c76ce3..f6f241940d 100644 --- a/tools/merge_rust/Cargo.toml +++ b/tools/merge_rust/Cargo.toml @@ -8,6 +8,7 @@ rust_util = { path = "../rust_util" } syn = { version = "2.0.108", features = ["full", "visit"] } proc-macro2 = { version = "1", features = ["span-locations"] } +clap = { version = "4.5", features = ["derive"] } quote = "1" serde_json = "1" diff --git a/tools/merge_rust/src/main.rs b/tools/merge_rust/src/main.rs index c8c02d2a45..954fdb393e 100644 --- a/tools/merge_rust/src/main.rs +++ b/tools/merge_rust/src/main.rs @@ -1,13 +1,24 @@ use std::collections::HashMap; -use std::env; use std::fs::{self, File}; +use std::path::PathBuf; use rust_util::collect::FileCollector; use rust_util::item_span::item_spans; use serde_json; +use clap::Parser; + +#[derive(Parser)] +/// Merge updated item definitions into a Rust codebase. +struct Args { + /// Root Rust source file to update (`lib.rs` or `main.rs`). + src_root_path: PathBuf, + /// JSON file containing mapping from Rust item paths to desired new contents. + new_snippets_file: PathBuf, +} fn main() { - let src_root_path = env::args().nth(1).unwrap(); - let new_snippet_json_path = env::args().nth(2).unwrap(); + let args = Args::parse(); + let src_root_path = args.src_root_path; + let new_snippet_json_path = args.new_snippets_file; let new_snippets_file = File::open(&new_snippet_json_path).unwrap(); let new_snippets: HashMap = From 7dc2fb8b64a298f4f57e5f9a6b639a6ff32f9774 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Mon, 1 Dec 2025 09:23:06 -0500 Subject: [PATCH 15/25] tools/split_rust: use clap for arguments --- tools/split_rust/Cargo.lock | 142 +++++++++++++++++++++++++++++++++++ tools/split_rust/Cargo.toml | 1 + tools/split_rust/src/main.rs | 13 +++- 3 files changed, 154 insertions(+), 2 deletions(-) diff --git a/tools/split_rust/Cargo.lock b/tools/split_rust/Cargo.lock index 611c6bddf9..2cfed465c0 100644 --- a/tools/split_rust/Cargo.lock +++ b/tools/split_rust/Cargo.lock @@ -2,6 +2,114 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "itoa" version = "1.0.15" @@ -14,6 +122,12 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "proc-macro2" version = "1.0.103" @@ -93,6 +207,7 @@ dependencies = [ name = "split_rust" version = "0.1.0" dependencies = [ + "clap", "proc-macro2", "quote", "rust_util", @@ -100,6 +215,12 @@ dependencies = [ "syn", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.110" @@ -116,3 +237,24 @@ name = "unicode-ident" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] diff --git a/tools/split_rust/Cargo.toml b/tools/split_rust/Cargo.toml index 21a4ddf5cf..0d102961ea 100644 --- a/tools/split_rust/Cargo.toml +++ b/tools/split_rust/Cargo.toml @@ -9,5 +9,6 @@ rust_util = { path = "../rust_util" } syn = { version = "2.0.108", features = ["full", "visit"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" +clap = { version = "4.5", features = ["derive"] } serde_json = "1" diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index f1e77fcf13..9321d2871a 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -1,13 +1,22 @@ use std::collections::HashMap; -use std::env; use std::fs; +use std::path::PathBuf; use rust_util::collect::FileCollector; use rust_util::item_span::item_spans; use serde_json; +use clap::Parser; + +#[derive(Parser)] +/// Split a Rust codebase into a JSON map from item paths to their source text. +struct Args { + /// Root Rust source file to split (`lib.rs` or `main.rs`). + src_root_path: PathBuf, +} fn main() { + let args = Args::parse(); let mut fc = FileCollector::default(); - fc.parse(env::args().nth(1).unwrap(), vec![], true).unwrap(); + fc.parse(args.src_root_path, vec![], true).unwrap(); let mut out = HashMap::new(); for &(ref name, ref mod_path, ref ast) in &fc.files { eprintln!("visit {:?}", name); From 40f4a4d5b6f841031c788bc4cd0d0e768ffc2dad Mon Sep 17 00:00:00 2001 From: fw Date: Sat, 6 Dec 2025 10:21:57 -0500 Subject: [PATCH 16/25] tools/split_ffi_entry_points: use clap for arguments --- tools/split_ffi_entry_points/Cargo.lock | 127 +++++++++++++++++++++++ tools/split_ffi_entry_points/Cargo.toml | 1 + tools/split_ffi_entry_points/src/main.rs | 14 ++- 3 files changed, 138 insertions(+), 4 deletions(-) diff --git a/tools/split_ffi_entry_points/Cargo.lock b/tools/split_ffi_entry_points/Cargo.lock index bee8145082..d2ccfde983 100644 --- a/tools/split_ffi_entry_points/Cargo.lock +++ b/tools/split_ffi_entry_points/Cargo.lock @@ -8,6 +8,56 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + [[package]] name = "anyhow" version = "1.0.100" @@ -165,6 +215,52 @@ dependencies = [ "tracing", ] +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "countme" version = "3.0.1" @@ -351,6 +447,12 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "home" version = "0.5.12" @@ -503,6 +605,12 @@ dependencies = [ "memoffset", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + [[package]] name = "itertools" version = "0.12.1" @@ -677,6 +785,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "oorandom" version = "11.1.5" @@ -1627,6 +1741,7 @@ dependencies = [ name = "split_ffi_entry_points" version = "0.1.0" dependencies = [ + "clap", "proc-macro2", "quote", "ra_ap_hir", @@ -1644,6 +1759,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.108" @@ -1840,6 +1961,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "walkdir" version = "2.5.0" diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index b21e6d95e0..8b0abaa812 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -9,6 +9,7 @@ rust_util = { path = "../rust_util" } syn = { version = "2.0.108", features = ["full", "visit-mut"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" +clap = { version = "4.5", features = ["derive"] } ra_ap_hir = "=0.0.301" ra_ap_ide_db = "=0.0.301" diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index a3b6e04932..b36fd29142 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -1,9 +1,9 @@ -use std::env; use std::fs; use std::iter; use std::mem; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::str::FromStr; +use clap::Parser; use proc_macro2::{TokenStream, Span}; use quote::ToTokens; use ra_ap_hir::Semantics; @@ -323,10 +323,16 @@ impl ToTokens for ParsedMetaExportName { } } +#[derive(Parser)] +/// Split FFI entrypoints out of a freshly-transpiled Rust codebase. +struct Args { + /// Directory of Rust project to modify. `Cargo.toml` should reside inside this directory. + cargo_dir_path: PathBuf, +} fn main() { - let cargo_dir_path = env::args().nth(1).unwrap(); - let cargo_dir_path = Path::new(&cargo_dir_path); + let args = Args::parse(); + let cargo_dir_path = Path::new(&args.cargo_dir_path); let cargo_config = CargoConfig::default(); From a0a4e76eb5642c82514801d5ecc9f75cb3f3fd50 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Sun, 23 Nov 2025 22:19:19 -0500 Subject: [PATCH 17/25] tools/split_ffi_entry_points: use "visit" syn feature --- tools/split_ffi_entry_points/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/split_ffi_entry_points/Cargo.toml b/tools/split_ffi_entry_points/Cargo.toml index 8b0abaa812..3f7254b581 100644 --- a/tools/split_ffi_entry_points/Cargo.toml +++ b/tools/split_ffi_entry_points/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] rust_util = { path = "../rust_util" } -syn = { version = "2.0.108", features = ["full", "visit-mut"] } +syn = { version = "2.0.108", features = ["full", "visit-mut", "visit"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" clap = { version = "4.5", features = ["derive"] } From a2a241fdb0e8ef53e9d0ce379414c69a8cc6850e Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Sun, 23 Nov 2025 22:23:54 -0500 Subject: [PATCH 18/25] tools/rust_util: use "visit" syn feature --- tools/rust_util/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rust_util/Cargo.toml b/tools/rust_util/Cargo.toml index ae39291263..9622ced91f 100644 --- a/tools/rust_util/Cargo.toml +++ b/tools/rust_util/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" edition = "2024" [dependencies] -syn = { version = "2.0.108", features = ["full", "visit-mut"] } +syn = { version = "2.0.108", features = ["full", "visit-mut", "visit"] } proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" From 265e101ccbac3ab145642368832841f02199c0ef Mon Sep 17 00:00:00 2001 From: fw Date: Sun, 7 Dec 2025 16:30:24 -0500 Subject: [PATCH 19/25] tools/rust_util: do not include r# prefix in fs paths --- tools/rust_util/src/collect.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/rust_util/src/collect.rs b/tools/rust_util/src/collect.rs index a69cad854f..a1d58e8c64 100644 --- a/tools/rust_util/src/collect.rs +++ b/tools/rust_util/src/collect.rs @@ -3,6 +3,7 @@ use std::fs; use std::iter; use std::path::{Path, PathBuf}; use syn; +use syn::ext::IdentExt; use crate::error::Error; @@ -56,10 +57,10 @@ impl FileCollector { syn::Item::Mod(ref im) => im, _ => continue, }; - mod_path.push(im.ident.to_string()); + mod_path.push(im.ident.unraw().to_string()); if let Some((_, ref inline_items)) = im.content { let name = path_attr_value(&im.attrs)? - .unwrap_or_else(|| im.ident.to_string()); + .unwrap_or_else(|| im.ident.unraw().to_string()); let module = parent_module.iter().copied().chain(iter::once(&name as &_)) .collect::>(); self.walk_items(inline_items, base_path, mod_path.clone(), &module)?; @@ -72,7 +73,7 @@ impl FileCollector { path.push(attr_path); self.parse(path, mod_path.clone(), false)?; } else { - let name = im.ident.to_string(); + let name = im.ident.unraw().to_string(); // Try `foo/mod.rs` first; if it doesn't exist, try `foo.rs` instead. path.push(name); path.push("mod.rs"); From 60776caa5c20b45cb2523f22f0a51234402d24ae Mon Sep 17 00:00:00 2001 From: fw Date: Sat, 6 Dec 2025 10:20:41 -0500 Subject: [PATCH 20/25] cargo: exclude tools/ from Cargo workspace --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 93abf39708..8dfa79cbdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ exclude = [ "analysis/tests", "examples", "tests", + "tools", ] [workspace.package] From b14877a098eee1359f854adfb212fe40c343da6b Mon Sep 17 00:00:00 2001 From: fw Date: Sat, 6 Dec 2025 10:24:26 -0500 Subject: [PATCH 21/25] tools: add README --- tools/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/README.md diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..0583551071 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,20 @@ +# C2Rust CRISP tools + +- `merge_rust` +- `split_rust` +- `split_ffi_entry_points` + +## Building + +These tools rely on rust-analyzer's libraries, so they need a relatively recent version of Rust. Run `cargo build --release` in their respective directories to build them. + +## Running + +`split_rust` and `merge_rust` expect the root source file of a Rust project as their first argument, e.g. `lib.rs` or `main.rs`. + +- `merge_rust` modifies the specified codebase in-place. +- `split_rust` emits JSON on standard output. + +`split_ffi_entry_points` expects a Rust project directory (the directory containing a `Cargo.toml` file) as its only argument. + +It modifies that Rust project in-place. From c689e5e2bdce83b36dc62b2ad7b0fe7a184b802a Mon Sep 17 00:00:00 2001 From: fw Date: Fri, 12 Dec 2025 11:57:57 -0500 Subject: [PATCH 22/25] tools: add rust-toolchain.toml, fixing README build command with rustup --- tools/rust-toolchain.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/rust-toolchain.toml diff --git a/tools/rust-toolchain.toml b/tools/rust-toolchain.toml new file mode 100644 index 0000000000..292fe499e3 --- /dev/null +++ b/tools/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" From 44f79cc19a523015c0c8d8cd92db7d496be09582 Mon Sep 17 00:00:00 2001 From: fw Date: Fri, 12 Dec 2025 11:58:48 -0500 Subject: [PATCH 23/25] tools: use match ergonomics --- tools/rust_util/src/error.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/rust_util/src/error.rs b/tools/rust_util/src/error.rs index 0cf3382cef..43b91f4038 100644 --- a/tools/rust_util/src/error.rs +++ b/tools/rust_util/src/error.rs @@ -35,22 +35,22 @@ impl Error { impl Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Error::Io(ref x) => Display::fmt(x, f), - Error::Syn(ref x) => Display::fmt(x, f), - Error::Str(ref x) => Display::fmt(x, f), - Error::At(ref desc, ref inner) => write!(f, "{desc}: {inner}"), + match self { + Error::Io(x) => Display::fmt(x, f), + Error::Syn(x) => Display::fmt(x, f), + Error::Str(x) => Display::fmt(x, f), + Error::At(desc, inner) => write!(f, "{desc}: {inner}"), } } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match *self { - Error::Io(ref x) => Some(x), - Error::Syn(ref x) => Some(x), + match self { + Error::Io(x) => Some(x), + Error::Syn(x) => Some(x), Error::Str(_) => None, - Error::At(_, ref x) => Some(x), + Error::At(_, x) => Some(x), } } } From 6739500c6ff2970fa7c7d8232dbeb9da4a23a4ba Mon Sep 17 00:00:00 2001 From: fw Date: Fri, 12 Dec 2025 11:59:59 -0500 Subject: [PATCH 24/25] tools: move doc comment above attributes --- tools/merge_rust/src/main.rs | 2 +- tools/split_ffi_entry_points/src/main.rs | 2 +- tools/split_rust/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/merge_rust/src/main.rs b/tools/merge_rust/src/main.rs index 954fdb393e..cc37cdecc2 100644 --- a/tools/merge_rust/src/main.rs +++ b/tools/merge_rust/src/main.rs @@ -6,8 +6,8 @@ use rust_util::item_span::item_spans; use serde_json; use clap::Parser; -#[derive(Parser)] /// Merge updated item definitions into a Rust codebase. +#[derive(Parser)] struct Args { /// Root Rust source file to update (`lib.rs` or `main.rs`). src_root_path: PathBuf, diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index b36fd29142..5157aec162 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -323,8 +323,8 @@ impl ToTokens for ParsedMetaExportName { } } -#[derive(Parser)] /// Split FFI entrypoints out of a freshly-transpiled Rust codebase. +#[derive(Parser)] struct Args { /// Directory of Rust project to modify. `Cargo.toml` should reside inside this directory. cargo_dir_path: PathBuf, diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index 9321d2871a..802489c059 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -6,8 +6,8 @@ use rust_util::item_span::item_spans; use serde_json; use clap::Parser; -#[derive(Parser)] /// Split a Rust codebase into a JSON map from item paths to their source text. +#[derive(Parser)] struct Args { /// Root Rust source file to split (`lib.rs` or `main.rs`). src_root_path: PathBuf, From 84450a91c1d17254527eb7e11e38757624637a41 Mon Sep 17 00:00:00 2001 From: fw Date: Fri, 12 Dec 2025 12:01:01 -0500 Subject: [PATCH 25/25] tools: rustfmt --- tools/merge_rust/src/main.rs | 25 +- tools/related_decls/Cargo.lock | 2047 ++++++++++++++++++++++ tools/related_decls/Cargo.toml | 17 + tools/related_decls/src/main.rs | 401 +++++ tools/rust_util/src/collect.rs | 16 +- tools/rust_util/src/error.rs | 17 +- tools/rust_util/src/item_span.rs | 10 +- tools/rust_util/src/rewrite.rs | 40 +- tools/split_ffi_entry_points/src/main.rs | 103 +- tools/split_rust/src/main.rs | 10 +- 10 files changed, 2588 insertions(+), 98 deletions(-) create mode 100644 tools/related_decls/Cargo.lock create mode 100644 tools/related_decls/Cargo.toml create mode 100644 tools/related_decls/src/main.rs diff --git a/tools/merge_rust/src/main.rs b/tools/merge_rust/src/main.rs index cc37cdecc2..266158ddcd 100644 --- a/tools/merge_rust/src/main.rs +++ b/tools/merge_rust/src/main.rs @@ -1,10 +1,10 @@ -use std::collections::HashMap; -use std::fs::{self, File}; -use std::path::PathBuf; +use clap::Parser; use rust_util::collect::FileCollector; use rust_util::item_span::item_spans; use serde_json; -use clap::Parser; +use std::collections::HashMap; +use std::fs::{self, File}; +use std::path::PathBuf; /// Merge updated item definitions into a Rust codebase. #[derive(Parser)] @@ -21,8 +21,7 @@ fn main() { let new_snippet_json_path = args.new_snippets_file; let new_snippets_file = File::open(&new_snippet_json_path).unwrap(); - let new_snippets: HashMap = - serde_json::from_reader(new_snippets_file).unwrap(); + let new_snippets: HashMap = serde_json::from_reader(new_snippets_file).unwrap(); let mut fc = FileCollector::default(); fc.parse(&src_root_path, vec![], true).unwrap(); @@ -32,7 +31,7 @@ fn main() { let mut rewrites = Vec::new(); for (item_path, lo, hi) in item_spans(mod_path.to_owned(), ast) { - let old_snippet = &old_src[lo .. hi]; + let old_snippet = &old_src[lo..hi]; let item_path_str = item_path.join("::"); if let Some(new_snippet) = new_snippets.get(&item_path_str) { if new_snippet != old_snippet { @@ -49,9 +48,15 @@ fn main() { let mut new_src = String::with_capacity(old_src.len()); let mut pos = 0; for &(lo, hi, new_snippet) in &rewrites { - assert!(lo >= pos, "overlapping rewrites: previous rewrite ended at {}, \ - but current rewrite covers {} .. {}", pos, lo, hi); - new_src.push_str(&old_src[pos .. lo]); + assert!( + lo >= pos, + "overlapping rewrites: previous rewrite ended at {}, \ + but current rewrite covers {} .. {}", + pos, + lo, + hi + ); + new_src.push_str(&old_src[pos..lo]); new_src.push_str(new_snippet); pos = hi; } diff --git a/tools/related_decls/Cargo.lock b/tools/related_decls/Cargo.lock new file mode 100644 index 0000000000..bee8145082 --- /dev/null +++ b/tools/related_decls/Cargo.lock @@ -0,0 +1,2047 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "borsh" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +dependencies = [ + "cfg_aliases", +] + +[[package]] +name = "boxcar" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" + +[[package]] +name = "camino" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84982c6c0ae343635a3a4ee6dedef965513735c8b183caa7289fa6e27399ebd4" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-util-schemas" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dc1a6f7b5651af85774ae5a34b4e8be397d9cf4bc063b7e6dbd99a841837830" +dependencies = [ + "semver", + "serde", + "serde-untagged", + "serde-value", + "thiserror", + "toml", + "unicode-xid", + "url", +] + +[[package]] +name = "cargo_metadata" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868" +dependencies = [ + "camino", + "cargo-platform", + "cargo-util-schemas", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chalk-derive" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb4899682de915ca7c0b025bdd0a3d34c75fe12184122fda6805a7baddaa293c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "chalk-ir" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90a37d2ab99352b4caca135061e7b4ac67024b648c28ed0b787feec4bea4caed" +dependencies = [ + "bitflags 2.10.0", + "chalk-derive", +] + +[[package]] +name = "chalk-recursive" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c855be60e646664bc37c2496d3dc81ca5ef60520930e5e0f0057a0575aff6c19" +dependencies = [ + "chalk-derive", + "chalk-ir", + "chalk-solve", + "rustc-hash 1.1.0", + "tracing", +] + +[[package]] +name = "chalk-solve" +version = "0.103.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "477ac6cdfd2013e9f93b09b036c2b607a67b2e728f4777b8422d55a79e9e3a34" +dependencies = [ + "chalk-derive", + "chalk-ir", + "ena", + "indexmap", + "itertools 0.12.1", + "petgraph", + "rustc-hash 1.1.0", + "tracing", +] + +[[package]] +name = "countme" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" + +[[package]] +name = "cov-mark" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90863d8442510cddf7f46618c4f92413774635771a3e80830c8b30d183420b14" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "drop_bomb" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "fst" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +dependencies = [ + "equivalent", + "hashbrown 0.16.0", + "serde", + "serde_core", +] + +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.10.0", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jod-thread" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a037eddb7d28de1d0fc42411f501b53b75838d313908078d6698d064f3029b24" + +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + +[[package]] +name = "la-arena" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3752f229dcc5a481d60f385fa479ff46818033d881d2d801aa27dffcfb5e8306" + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "line-index" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e27e0ed5a392a7f5ba0b3808a2afccff16c64933312c84b57618b49d1209bd2" +dependencies = [ + "nohash-hasher", + "text-size", +] + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mio" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "miow" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.10.0", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-types" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "papaya" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92dd0b07c53a0a0c764db2ace8c541dc47320dad97c2200c2a637ab9dd2328f" +dependencies = [ + "equivalent", + "seize", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "perf-event" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5396562cd2eaa828445d6d34258ae21ee1eb9d40fe626ca7f51c8dccb4af9d66" +dependencies = [ + "libc", + "perf-event-open-sys", +] + +[[package]] +name = "perf-event-open-sys" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce9bedf5da2c234fdf2391ede2b90fabf585355f33100689bc364a3ea558561a" +dependencies = [ + "libc", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ra-ap-rustc_abi" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18c877575c259d127072e9bfc41d985202262fb4d6bfdae3d1252147c2562c2" +dependencies = [ + "bitflags 2.10.0", + "ra-ap-rustc_hashes", + "ra-ap-rustc_index", + "tracing", +] + +[[package]] +name = "ra-ap-rustc_hashes" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439ed1df3472443133b66949f81080dff88089b42f825761455463709ee1cad" +dependencies = [ + "rustc-stable-hash", +] + +[[package]] +name = "ra-ap-rustc_index" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a24fe0be21be1f8ebc21dcb40129214fb4cefb0f2753f3d46b6dbe656a1a45" +dependencies = [ + "ra-ap-rustc_index_macros", + "smallvec", +] + +[[package]] +name = "ra-ap-rustc_index_macros" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844a27ddcad0116facae2df8e741fd788662cf93dc13029cd864f2b8013b81f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22944e31fb91e9b3e75bcbc91e37d958b8c0825a6160927f2856831d2ce83b36" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + +[[package]] +name = "ra-ap-rustc_lexer" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b734cfcb577d09877799a22742f1bd398be6c00bc428d9de56d48d11ece5771" +dependencies = [ + "memchr", + "unicode-properties", + "unicode-xid", +] + +[[package]] +name = "ra-ap-rustc_parse_format" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81057891bc2063ad9e353f29462fbc47a0f5072560af34428ae9313aaa5e9d97" +dependencies = [ + "ra-ap-rustc_lexer 0.121.0", + "rustc-literal-escaper", +] + +[[package]] +name = "ra-ap-rustc_pattern_analysis" +version = "0.123.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b0ee1f059b9dea0818c6c7267478926eee95ba4c7dcf89c8db32fa165d3904" +dependencies = [ + "ra-ap-rustc_index", + "rustc-hash 2.1.1", + "rustc_apfloat", + "smallvec", + "tracing", +] + +[[package]] +name = "ra_ap_base_db" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e876bb2c3e52a8d4e6684526a2d4e81f9d028b939ee4dc5dc775fe10deb44d59" +dependencies = [ + "dashmap", + "indexmap", + "la-arena", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_syntax", + "ra_ap_vfs", + "rustc-hash 2.1.1", + "salsa", + "salsa-macros", + "semver", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_cfg" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0b56eb4536ce6d2431932c4d337aeeaf7bb22c9249b38cbe80677b5881228f" +dependencies = [ + "ra_ap_intern", + "ra_ap_tt", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_edition" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bdc6cbe42c63ca78611bae82bfc8db24864f33dccc813697c5fde43a0907285" + +[[package]] +name = "ra_ap_hir" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebffdc134eccabc17209d7760cfff7fd12ed18ab6e21188c5e084b97aa38504c" +dependencies = [ + "arrayvec", + "either", + "indexmap", + "itertools 0.14.0", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_hir_def", + "ra_ap_hir_expand", + "ra_ap_hir_ty", + "ra_ap_intern", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", + "rustc-hash 2.1.1", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_def" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81d2337ef59550392d42aa997aa1105a3d6d1c2b3a583c777786bc4a0a074fd5" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "drop_bomb", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "la-arena", + "ra-ap-rustc_abi", + "ra-ap-rustc_parse_format", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_hir_expand", + "ra_ap_intern", + "ra_ap_mbe", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa", + "salsa-macros", + "smallvec", + "text-size", + "thin-vec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_expand" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf8ececb2743a819d8299a408e17f164dd1a1004d65936b3d5493b55330326" +dependencies = [ + "cov-mark", + "either", + "itertools 0.14.0", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_mbe", + "ra_ap_parser", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_syntax-bridge", + "ra_ap_tt", + "rustc-hash 2.1.1", + "salsa", + "salsa-macros", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_hir_ty" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc004e1099ba766a61500c27d34eb5cd336430d0a89a9620315a90d7a202a73a" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "chalk-derive", + "chalk-ir", + "chalk-recursive", + "chalk-solve", + "cov-mark", + "either", + "ena", + "indexmap", + "itertools 0.14.0", + "la-arena", + "oorandom", + "ra-ap-rustc_abi", + "ra-ap-rustc_index", + "ra-ap-rustc_pattern_analysis", + "ra_ap_base_db", + "ra_ap_hir_def", + "ra_ap_hir_expand", + "ra_ap_intern", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "rustc-hash 2.1.1", + "rustc_apfloat", + "salsa", + "salsa-macros", + "scoped-tls", + "smallvec", + "tracing", + "triomphe", + "typed-arena", +] + +[[package]] +name = "ra_ap_ide_db" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2acb572d6dbeb1c96d0339890ba91298b8f5f0ab22648da4ee2b4ab77dbc3fe" +dependencies = [ + "arrayvec", + "bitflags 2.10.0", + "cov-mark", + "crossbeam-channel", + "either", + "fst", + "indexmap", + "itertools 0.14.0", + "line-index", + "memchr", + "nohash-hasher", + "ra_ap_base_db", + "ra_ap_hir", + "ra_ap_parser", + "ra_ap_profile", + "ra_ap_query-group-macro", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_vfs", + "rayon", + "rustc-hash 2.1.1", + "salsa", + "salsa-macros", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_intern" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14586c2c4781b69fdd0c505972d9bff8c162a8740537a3ee506faff686d9a20d" +dependencies = [ + "dashmap", + "hashbrown 0.14.5", + "rustc-hash 2.1.1", + "triomphe", +] + +[[package]] +name = "ra_ap_load-cargo" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ce5546b3e3414507ab4d12348d0a28748062e33a1448895c68466d0b015503" +dependencies = [ + "anyhow", + "crossbeam-channel", + "itertools 0.14.0", + "ra_ap_hir_expand", + "ra_ap_ide_db", + "ra_ap_intern", + "ra_ap_proc_macro_api", + "ra_ap_project_model", + "ra_ap_span", + "ra_ap_tt", + "ra_ap_vfs", + "ra_ap_vfs-notify", + "tracing", +] + +[[package]] +name = "ra_ap_mbe" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67333c6405797cb64aafb994b9a179157b30beeda2352e203e800be2b184a22d" +dependencies = [ + "arrayvec", + "cov-mark", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_intern", + "ra_ap_parser", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax-bridge", + "ra_ap_tt", + "rustc-hash 2.1.1", + "smallvec", +] + +[[package]] +name = "ra_ap_parser" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b92b8b147c0826b83e70ad44e3c98e94201fc93e1f09396c43b4d7958c22a" +dependencies = [ + "drop_bomb", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_edition", + "rustc-literal-escaper", + "tracing", +] + +[[package]] +name = "ra_ap_paths" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4991f3d57fac0def7822bebfeb159c8d7b58c824bf82044b765c54f2c0971e2" +dependencies = [ + "camino", +] + +[[package]] +name = "ra_ap_proc_macro_api" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45db9e2df587d56f0738afa89fb2c100ff7c1e9cbe49e07f6a8b62342832211b" +dependencies = [ + "indexmap", + "ra_ap_intern", + "ra_ap_paths", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_tt", + "rustc-hash 2.1.1", + "serde", + "serde_derive", + "serde_json", + "tracing", +] + +[[package]] +name = "ra_ap_profile" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19981637b8ee4160e228c815a7fef3944b5c0555d6af41a931be92d68978bc6c" +dependencies = [ + "cfg-if", + "libc", + "perf-event", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_project_model" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bda0769fd6ca949fdd5917acb68ddc2c143745614ddd94ef38b376838611cf8" +dependencies = [ + "anyhow", + "cargo_metadata", + "itertools 0.14.0", + "la-arena", + "ra_ap_base_db", + "ra_ap_cfg", + "ra_ap_intern", + "ra_ap_paths", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_toolchain", + "rustc-hash 2.1.1", + "semver", + "serde", + "serde_derive", + "serde_json", + "temp-dir", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_query-group-macro" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f182a4b05f004eabaa83250a5de7ea3a13a92c88f3cbe98bfa1880cd9fbce0a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ra_ap_span" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6f9fa2de07f5cccf431674b90e82c1fe1ea2339db3b3869eec44d135de09a4" +dependencies = [ + "hashbrown 0.14.5", + "la-arena", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_vfs", + "rustc-hash 2.1.1", + "salsa", + "text-size", +] + +[[package]] +name = "ra_ap_stdx" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa770adb32896fcba934b464ac3bd179163ba2b0766e275eed5b4e262e08492b" +dependencies = [ + "crossbeam-channel", + "crossbeam-utils", + "itertools 0.14.0", + "jod-thread", + "libc", + "miow", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "ra_ap_syntax" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9e1393281ad5c635239d353ed3cfbf28c8d0af03d0c61a3b24b31d1143b17f" +dependencies = [ + "either", + "itertools 0.14.0", + "ra_ap_parser", + "ra_ap_stdx", + "rowan", + "rustc-hash 2.1.1", + "rustc-literal-escaper", + "smol_str", + "tracing", + "triomphe", +] + +[[package]] +name = "ra_ap_syntax-bridge" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684e6ff1008ee5340335888f0453d94bb38950f110059a51f1818c7f6a56a807" +dependencies = [ + "ra_ap_intern", + "ra_ap_parser", + "ra_ap_span", + "ra_ap_stdx", + "ra_ap_syntax", + "ra_ap_tt", + "rustc-hash 2.1.1", +] + +[[package]] +name = "ra_ap_toolchain" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61969c5f72af03a9837e077c2d939d87a5c863623725c461777c352664a3bb03" +dependencies = [ + "camino", + "home", +] + +[[package]] +name = "ra_ap_tt" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb87c7b35572c18a580ea811e970b94875fad5ac7cfa8644266a59081044f959" +dependencies = [ + "arrayvec", + "ra-ap-rustc_lexer 0.123.0", + "ra_ap_intern", + "ra_ap_stdx", + "text-size", +] + +[[package]] +name = "ra_ap_vfs" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c174d6b9b7a7f54687df7e00c3e75ed6f082a7943a9afb1d54f33c0c12773de" +dependencies = [ + "crossbeam-channel", + "fst", + "indexmap", + "nohash-hasher", + "ra_ap_paths", + "ra_ap_stdx", + "rustc-hash 2.1.1", + "tracing", +] + +[[package]] +name = "ra_ap_vfs-notify" +version = "0.0.301" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f6fce8d47c7ce9b8f2cd0e5a55f8fc4878d6043e61f46cde4391d3a5c6086f" +dependencies = [ + "crossbeam-channel", + "notify", + "ra_ap_paths", + "ra_ap_stdx", + "ra_ap_vfs", + "rayon", + "rustc-hash 2.1.1", + "tracing", + "walkdir", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "rowan" +version = "0.15.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a58fa8a7ccff2aec4f39cc45bf5f985cec7125ab271cf681c279fd00192b49" +dependencies = [ + "countme", + "hashbrown 0.14.5", + "memoffset", + "rustc-hash 1.1.0", + "text-size", +] + +[[package]] +name = "rust_util" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-literal-escaper" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b" + +[[package]] +name = "rustc-stable-hash" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781442f29170c5c93b7185ad559492601acdc71d5bb0706f5868094f45cfcd08" + +[[package]] +name = "rustc_apfloat" +version = "0.2.3+llvm-462a31f5a5ab" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486c2179b4796f65bfe2ee33679acf0927ac83ecf583ad6c91c3b4570911b9ad" +dependencies = [ + "bitflags 2.10.0", + "smallvec", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "salsa" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e235afdb8e510f38a07138fbe5a0b64691894358a9c0cbd813b1aade110efc9" +dependencies = [ + "boxcar", + "crossbeam-queue", + "crossbeam-utils", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "intrusive-collections", + "papaya", + "parking_lot", + "portable-atomic", + "rayon", + "rustc-hash 2.1.1", + "salsa-macro-rules", + "salsa-macros", + "smallvec", + "thin-vec", + "tracing", +] + +[[package]] +name = "salsa-macro-rules" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2edb86a7e9c91f6d30c9ce054312721dbe773a162db27bbfae834d16177b30ce" + +[[package]] +name = "salsa-macros" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0778d6e209051bc4e75acfe83bcd7848601ec3dbe9c3dbb982829020e9128af" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seize" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smol_str" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3498b0a27f93ef1402f20eefacfaa1691272ac4eca1cdc8c596cb0a245d6cbf5" +dependencies = [ + "borsh", + "serde_core", +] + +[[package]] +name = "split_ffi_entry_points" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "ra_ap_hir", + "ra_ap_ide_db", + "ra_ap_load-cargo", + "ra_ap_project_model", + "ra_ap_syntax", + "rust_util", + "syn", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "syn" +version = "2.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "temp-dir" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83176759e9416cf81ee66cb6508dbfe9c96f20b8b56265a39917551c23c70964" + +[[package]] +name = "text-size" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" + +[[package]] +name = "thin-vec" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] + +[[package]] +name = "triomphe" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd69c5aa8f924c7519d6372789a74eac5b94fb0f8fcf0d4a97eb0bfc3e785f39" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/tools/related_decls/Cargo.toml b/tools/related_decls/Cargo.toml new file mode 100644 index 0000000000..ecbd805879 --- /dev/null +++ b/tools/related_decls/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "related_decls" +version = "0.1.0" +edition = "2024" + +[dependencies] +rust_util = { path = "../rust_util" } + +syn = { version = "2.0.108", features = ["full", "visit-mut", "visit"] } +proc-macro2 = { version = "1", features = ["span-locations"] } +quote = "1" + +ra_ap_hir = "=0.0.301" +ra_ap_ide_db = "=0.0.301" +ra_ap_load-cargo = "=0.0.301" +ra_ap_project_model = "=0.0.301" +ra_ap_syntax = "=0.0.301" diff --git a/tools/related_decls/src/main.rs b/tools/related_decls/src/main.rs new file mode 100644 index 0000000000..c19d12ee3d --- /dev/null +++ b/tools/related_decls/src/main.rs @@ -0,0 +1,401 @@ +use proc_macro2::{Span, TokenStream}; +use quote::ToTokens; +use ra_ap_hir::Semantics; +use ra_ap_ide_db::RootDatabase; +use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; +use ra_ap_project_model::CargoConfig; +use ra_ap_syntax::SyntaxNode; +use rust_util::rewrite::{FlatTokens, OutputBuffer, TokenIndex, render_output}; +use std::env; +use std::fs; +use std::iter; +use std::mem; +use std::path::Path; +use std::str::FromStr; +use syn; +use syn::spanned::Spanned; +use syn::visit_mut::{self, VisitMut}; + +struct AddDerivedItemVisitor(F); + +impl Option> AddDerivedItemVisitor { + fn visit_items(&mut self, items: &mut Vec) { + let new_items = Vec::with_capacity(items.len()); + let old_items = mem::replace(items, new_items); + for mut item in old_items { + let derived_item = (self.0)(&mut item); + items.push(item); + if let Some(derived_item) = derived_item { + items.push(derived_item); + } + } + } +} + +impl Option> VisitMut for AddDerivedItemVisitor { + fn visit_item_mod_mut(&mut self, im: &mut syn::ItemMod) { + let items = match im.content { + Some((_, ref mut x)) => x, + None => return, + }; + self.visit_items(items); + visit_mut::visit_item_mod_mut(self, im); + } + + fn visit_file_mut(&mut self, f: &mut syn::File) { + self.visit_items(&mut f.items); + visit_mut::visit_file_mut(self, f); + } +} + +fn add_ffi_wrapper( + _db: &RootDatabase, + _sema: &Semantics, + _root: SyntaxNode, + item: &mut syn::Item, +) -> Option { + let fn_item = match *item { + syn::Item::Fn(ref mut x) => x, + _ => return None, + }; + let fn_name = fn_item.sig.ident.to_string(); + + // Example of gathering semantic information from rust-analyzer: + /* + let range = span_to_text_range(fn_item.span()); + let cover = root.covering_element(range); + // If this assert fails, we might need to look for a `FN` ancestor of `cover` instead. + debug_assert_eq!(cover.kind(), SyntaxKind::FN); + let cover = cover.into_node().unwrap(); + let f_ast = ast::Fn::cast(cover).unwrap(); + eprintln!("f_ast = {f_ast:?}"); + + let f = sema.to_fn_def(&f_ast).unwrap(); + eprintln!("f = {f:?}"); + + let attrs = f.attrs(db); + // etc... + */ + + // Walk over the attributes of `fn_item`, sorting them into attrs that should remain on the + // inner function and ones that should be moved or copied onto the newly-generated wrapper. + let mut inner_attrs = Vec::with_capacity(fn_item.attrs.len()); + let mut wrapper_attrs = Vec::new(); + let mut need_wrapper = false; + + for mut attr in mem::take(&mut fn_item.attrs) { + let mut pm = ParsedMeta::from(attr.meta); + + let mut move_to_wrapper = false; + pm.with_innermost_mut(&mut |pm| match pm { + ParsedMeta::NoMangle(..) => { + move_to_wrapper = true; + *pm = ParsedMeta::ExportName(ParsedMetaExportName { + ident: syn::Ident::new("export_name", Span::call_site()), + eq: syn::Token![=](Span::call_site()), + name: syn::LitStr::new(&fn_name, Span::call_site()), + }); + } + ParsedMeta::ExportName(..) => { + move_to_wrapper = true; + } + _ => {} + }); + + attr.meta = pm.into(); + + if move_to_wrapper { + wrapper_attrs.push(attr); + need_wrapper = true; + } else { + inner_attrs.push(attr); + } + } + + fn_item.attrs = inner_attrs; + + if !need_wrapper { + return None; + } + + let wrapper_name = format!("{fn_name}_ffi"); + let mut fn_wrapper = syn::ItemFn { + attrs: wrapper_attrs, + vis: fn_item.vis.clone(), + sig: fn_item.sig.clone(), + block: Box::new(syn::Block { + brace_token: syn::token::Brace::default(), + stmts: Vec::new(), + }), + }; + fn_wrapper.sig.ident = syn::Ident::new(&wrapper_name, Span::call_site()); + + let mut arg_exprs = Vec::new(); + for (i, arg) in fn_wrapper.sig.inputs.iter_mut().enumerate() { + let ident = match *arg { + syn::FnArg::Receiver(_) => syn::Ident::new("self", Span::call_site()), + syn::FnArg::Typed(ref mut pt) => match *pt.pat { + syn::Pat::Ident(ref pi) => pi.ident.clone(), + _ => { + let ident = syn::Ident::new(&format!("arg{i}"), Span::call_site()); + *pt.pat = syn::Pat::Ident(syn::PatIdent { + attrs: Vec::new(), + by_ref: None, + mutability: None, + ident: ident.clone(), + subpat: None, + }); + ident + } + }, + }; + let expr = syn::Expr::Path(syn::ExprPath { + attrs: Vec::new(), + qself: None, + path: syn::Path::from(ident), + }); + arg_exprs.push(expr); + } + + let wrapper_expr = syn::Expr::Call(syn::ExprCall { + attrs: Vec::new(), + func: Box::new(syn::Expr::Path(syn::ExprPath { + attrs: Vec::new(), + qself: None, + path: syn::Path::from(syn::Ident::new(&fn_name, Span::call_site())), + })), + paren_token: syn::token::Paren::default(), + args: arg_exprs.into_iter().collect(), + }); + let wrapper_stmt = syn::Stmt::Expr(wrapper_expr, None); + fn_wrapper.block.stmts.push(wrapper_stmt); + + Some(fn_wrapper.into()) +} + +/* +fn span_to_text_range(span: Span) -> TextRange { + let span_range = span.byte_range(); + let lo = TextSize::try_from(span_range.start).unwrap(); + let hi = TextSize::try_from(span_range.end).unwrap(); + TextRange::new(lo, hi) +} +*/ + +// Helpers for dealing with nested meta items in attrs, like `#[unsafe(no_mangle)]` + +#[derive(Clone)] +enum ParsedMeta { + Meta(syn::Meta), + Unsafe(Box), + NoMangle(ParsedMetaNoMangle), + ExportName(ParsedMetaExportName), +} + +#[derive(Clone)] +struct ParsedMetaUnsafe { + ident: syn::Ident, + paren: syn::token::Paren, + inner: ParsedMeta, +} + +#[derive(Clone)] +struct ParsedMetaNoMangle { + ident: syn::Ident, +} + +#[derive(Clone)] +struct ParsedMetaExportName { + ident: syn::Ident, + eq: syn::Token![=], + name: syn::LitStr, +} + +impl ParsedMeta { + pub fn parse(meta: &syn::Meta) -> syn::Result { + let ident = meta.path().require_ident()?; + let ident_str = ident.to_string(); + match ident_str.as_str() { + "unsafe" => { + let ml = meta.require_list()?; + let ident = ml.path.require_ident()?.clone(); + let paren = match ml.delimiter { + syn::MacroDelimiter::Paren(p) => p, + _ => { + return Err(syn::Error::new( + ml.delimiter.span().open(), + "expected parens", + )); + } + }; + let meta: syn::Meta = syn::parse2(ml.tokens.clone())?; + let inner = ParsedMeta::from(meta); + Ok(ParsedMeta::Unsafe(Box::new(ParsedMetaUnsafe { + ident, + paren, + inner, + }))) + } + "no_mangle" => { + let _ = meta.require_path_only()?; + let ident = ident.clone(); + Ok(ParsedMeta::NoMangle(ParsedMetaNoMangle { ident })) + } + "export_name" => { + let mnv = meta.require_name_value()?; + let ident = mnv.path.require_ident()?.clone(); + let eq = mnv.eq_token; + let expr_lit = match mnv.value { + syn::Expr::Lit(ref el) => el, + _ => return Err(syn::Error::new(mnv.value.span(), "expected Lit")), + }; + let syn::ExprLit { ref attrs, ref lit } = *expr_lit; + if attrs.len() > 0 { + return Err(syn::Error::new(expr_lit.span(), "name must not have attrs")); + } + let name = match *lit { + syn::Lit::Str(ref ls) => ls.clone(), + _ => return Err(syn::Error::new(lit.span(), "expected Str")), + }; + Ok(ParsedMeta::ExportName(ParsedMetaExportName { + ident, + eq, + name, + })) + } + _ => Ok(ParsedMeta::Meta(meta.clone())), + } + } + + pub fn with_innermost_mut(&mut self, f: &mut impl FnMut(&mut ParsedMeta)) { + match *self { + ParsedMeta::Meta(..) | ParsedMeta::NoMangle(..) | ParsedMeta::ExportName(..) => f(self), + ParsedMeta::Unsafe(ref mut pmu) => pmu.inner.with_innermost_mut(f), + } + } +} + +impl From for ParsedMeta { + fn from(meta: syn::Meta) -> ParsedMeta { + match Self::parse(&meta) { + Ok(x) => x, + Err(e) => { + eprintln!("warning: failed to parse `{}`: {e}", meta.to_token_stream()); + ParsedMeta::Meta(meta) + } + } + } +} + +impl From for syn::Meta { + fn from(pm: ParsedMeta) -> syn::Meta { + syn::parse2(pm.into_token_stream()).unwrap() + } +} + +impl ToTokens for ParsedMeta { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + ParsedMeta::Meta(ref x) => x.to_tokens(tokens), + ParsedMeta::Unsafe(ref x) => x.to_tokens(tokens), + ParsedMeta::NoMangle(ref x) => x.to_tokens(tokens), + ParsedMeta::ExportName(ref x) => x.to_tokens(tokens), + } + } +} + +impl ToTokens for ParsedMetaUnsafe { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.paren.surround(tokens, |tokens| { + self.inner.to_tokens(tokens); + }); + } +} + +impl ToTokens for ParsedMetaNoMangle { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + } +} + +impl ToTokens for ParsedMetaExportName { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.eq.to_tokens(tokens); + self.name.to_tokens(tokens); + } +} + +fn main() { + let cargo_dir_path = env::args().nth(1).unwrap(); + let cargo_dir_path = Path::new(&cargo_dir_path); + + let cargo_config = CargoConfig::default(); + + let load_cargo_config: LoadCargoConfig = LoadCargoConfig { + load_out_dirs_from_check: true, + with_proc_macro_server: ProcMacroServerChoice::Sysroot, + prefill_caches: false, + }; + + let (db, vfs, _proc_macro_client) = ra_ap_load_cargo::load_workspace_at( + cargo_dir_path, + &cargo_config, + &load_cargo_config, + &|_msg| {}, + ) + .unwrap(); + + // Assume the first file in `vfs` is the crate root. + let (first_file_id, _) = vfs.iter().next().unwrap(); + + let sema = Semantics::new(&db); + + eprintln!("processing crate..."); + let krate = sema.first_crate(first_file_id).unwrap(); + + let mut files = Vec::new(); + for m in krate.modules(&db) { + let src = m.definition_source(&db); + let node = src.value.node(); + if let Some(editioned_file_id) = m.as_source_file_id(&db) { + sema.parse(editioned_file_id); + let file_id = editioned_file_id.file_id(&db); + let vfs_path = vfs.file_path(file_id); + if let Some(path) = vfs_path.as_path() { + files.push((path.to_path_buf(), node)); + } + } + } + + for (path, root) in files { + // Only rewrite files that are inside the provided cargo dir. If our strategy for finding + // the main crate is wrong, this will keep us from overwriting files unexpectedly. + let mut ancestors = iter::successors(Some(path.as_path()), |p| p.parent()); + if !ancestors.any(|a| a == cargo_dir_path) { + eprintln!("skip {path:?}: outside cargo dir {cargo_dir_path:?}"); + continue; + } + + let code = fs::read_to_string(&path).unwrap(); + + let ts = TokenStream::from_str(&code).unwrap(); + let orig_tokens = FlatTokens::new(ts.clone()).collect::>(); + let ti = TokenIndex::new(&orig_tokens); + + let mut ast: syn::File = syn::parse2(ts.clone()).unwrap(); + let mut v = AddDerivedItemVisitor(|i: &mut syn::Item| -> Option { + add_ffi_wrapper(&db, &sema, root.clone(), i) + }); + v.visit_file_mut(&mut ast); + + let new_ts = ast.into_token_stream(); + + let mut buf = OutputBuffer::new(); + render_output(&code, &orig_tokens, &ti, new_ts, &mut buf); + let s = buf.finish(); + fs::write(&path, &s).unwrap(); + eprintln!("wrote {:?}", path); + } +} diff --git a/tools/rust_util/src/collect.rs b/tools/rust_util/src/collect.rs index a1d58e8c64..6a9e6fe179 100644 --- a/tools/rust_util/src/collect.rs +++ b/tools/rust_util/src/collect.rs @@ -1,11 +1,10 @@ +use crate::error::Error; use std::collections::HashSet; use std::fs; use std::iter; use std::path::{Path, PathBuf}; use syn; use syn::ext::IdentExt; -use crate::error::Error; - #[derive(Clone, Default)] pub struct FileCollector { @@ -35,7 +34,9 @@ impl FileCollector { let is_mod_rs = is_root || file_path.file_name().is_some_and(|n| n == "mod.rs"); let base_path_storage; let base_path = if is_mod_rs { - file_path.parent().ok_or_else(|| format!("mod.rs path {file_path:?} has no parent"))? + file_path + .parent() + .ok_or_else(|| format!("mod.rs path {file_path:?} has no parent"))? } else { base_path_storage = file_path.with_extension(""); &base_path_storage @@ -59,9 +60,12 @@ impl FileCollector { }; mod_path.push(im.ident.unraw().to_string()); if let Some((_, ref inline_items)) = im.content { - let name = path_attr_value(&im.attrs)? - .unwrap_or_else(|| im.ident.unraw().to_string()); - let module = parent_module.iter().copied().chain(iter::once(&name as &_)) + let name = + path_attr_value(&im.attrs)?.unwrap_or_else(|| im.ident.unraw().to_string()); + let module = parent_module + .iter() + .copied() + .chain(iter::once(&name as &_)) .collect::>(); self.walk_items(inline_items, base_path, mod_path.clone(), &module)?; } else { diff --git a/tools/rust_util/src/error.rs b/tools/rust_util/src/error.rs index 43b91f4038..28e93187d5 100644 --- a/tools/rust_util/src/error.rs +++ b/tools/rust_util/src/error.rs @@ -2,7 +2,6 @@ use std::fmt::{self, Display}; use std::io; use syn; - #[derive(Debug)] pub enum Error { Io(io::Error), @@ -12,19 +11,27 @@ pub enum Error { } impl From for Error { - fn from(x: io::Error) -> Error { Error::Io(x) } + fn from(x: io::Error) -> Error { + Error::Io(x) + } } impl From for Error { - fn from(x: syn::Error) -> Error { Error::Syn(x) } + fn from(x: syn::Error) -> Error { + Error::Syn(x) + } } impl From for Error { - fn from(x: String) -> Error { Error::Str(x) } + fn from(x: String) -> Error { + Error::Str(x) + } } impl From<&str> for Error { - fn from(x: &str) -> Error { Error::Str(x.to_owned()) } + fn from(x: &str) -> Error { + Error::Str(x.to_owned()) + } } impl Error { diff --git a/tools/rust_util/src/item_span.rs b/tools/rust_util/src/item_span.rs index cbe812e3a7..c840347593 100644 --- a/tools/rust_util/src/item_span.rs +++ b/tools/rust_util/src/item_span.rs @@ -24,7 +24,8 @@ impl ItemSpanVisitor { self.cur_path.push(name); let range = sp.byte_range(); - self.item_spans.push((self.cur_path.clone(), range.start, range.end)); + self.item_spans + .push((self.cur_path.clone(), range.start, range.end)); let r = f(self); self.cur_path.pop(); @@ -38,21 +39,20 @@ impl Visit<'_> for ItemSpanVisitor { syn::Item::Fn(ref ifn) => { let name = ifn.sig.ident.to_string(); self.enter(name, ifn.span(), |v| v.visit_item_fn(ifn)); - }, + } syn::Item::Mod(ref im) => { let name = im.ident.to_string(); self.enter(name, im.span(), |v| v.visit_item_mod(im)); - }, + } // TODO: handle other items that can contain nested items. Note that any expr or type // can contain items, e.g. `type T = [u8; { fn f(){} 10 }];` _ => { visit::visit_item(self, item); - }, + } } } } - pub fn item_spans(mod_path: Vec, ast: &syn::File) -> Vec<(Vec, usize, usize)> { let mut v = ItemSpanVisitor::new(mod_path); v.visit_file(ast); diff --git a/tools/rust_util/src/rewrite.rs b/tools/rust_util/src/rewrite.rs index 7abb45a7d5..42a9c76bb8 100644 --- a/tools/rust_util/src/rewrite.rs +++ b/tools/rust_util/src/rewrite.rs @@ -1,6 +1,5 @@ +use proc_macro2::{Delimiter, Spacing, Span, TokenStream, TokenTree}; use std::collections::BTreeSet; -use proc_macro2::{TokenStream, TokenTree, Delimiter, Spacing, Span}; - pub struct FlatTokens { stack: Vec<(proc_macro2::token_stream::IntoIter, Delimiter, Span)>, @@ -21,7 +20,8 @@ impl Iterator for FlatTokens { match it.next() { Some(TokenTree::Group(g)) => { // Return the open delimiter and continue with the contents of the group. - self.stack.push((g.stream().into_iter(), g.delimiter(), g.span_close())); + self.stack + .push((g.stream().into_iter(), g.delimiter(), g.span_close())); let open_ch = match g.delimiter() { Delimiter::Parenthesis => '(', Delimiter::Bracket => '[', @@ -36,10 +36,10 @@ impl Iterator for FlatTokens { spacing: Spacing::Alone, span: (range.start, range.end), }); - }, - Some(tt@TokenTree::Ident(_)) | - Some(tt@TokenTree::Punct(_)) | - Some(tt@TokenTree::Literal(_)) => return Some(Token::from_token_tree(tt)), + } + Some(tt @ TokenTree::Ident(_)) + | Some(tt @ TokenTree::Punct(_)) + | Some(tt @ TokenTree::Literal(_)) => return Some(Token::from_token_tree(tt)), None => { // Pop the now-empty group and return the close delimiter. self.stack.pop(); @@ -57,14 +57,13 @@ impl Iterator for FlatTokens { spacing: Spacing::Alone, span: (range.start, range.end), }); - }, + } } } None } } - #[derive(Clone, PartialEq, Eq, Debug)] pub struct Token { pub text: Box, @@ -83,11 +82,14 @@ impl Token { let range = tt.span().byte_range(); let start = range.start; let end = range.end; - Token { text, spacing, span: (start, end) } + Token { + text, + spacing, + span: (start, end), + } } } - pub struct TokenIndex<'a> { tokens: &'a [Token], /// Multi-map mapping `(start, end)` to indexes in `tokens` that have that span. @@ -108,7 +110,7 @@ impl<'a> TokenIndex<'a> { let lo = ((start, end), 0); let hi = ((start, end), usize::MAX); let mut found = None; - for &(_, i) in self.index.range(lo ..= hi) { + for &(_, i) in self.index.range(lo..=hi) { if self.tokens[i] == *t { if found.is_none() { found = Some(i); @@ -122,7 +124,6 @@ impl<'a> TokenIndex<'a> { } } - pub struct OutputBuffer { s: String, /// Whether the most recently emitted chunk had `Spacing::Joint`. @@ -183,7 +184,7 @@ pub fn render_output( ) { if let Some(t) = orig_tokens.get(0) { let (start_pos, _) = t.span; - buf.emit(&orig[0 .. start_pos], Spacing::Joint); + buf.emit(&orig[0..start_pos], Spacing::Joint); } struct Run { @@ -204,7 +205,7 @@ pub fn render_output( let end_token = &orig_tokens[run.end_idx]; let start_pos = run.start_pos; let (_, end_pos) = end_token.span; - buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + buf.emit(&orig[start_pos..end_pos], end_token.spacing); current_run = None; } } @@ -213,7 +214,10 @@ pub fn render_output( debug_assert!(current_run.is_none()); if let Some(idx) = ti.find(&t) { let (start_pos, _) = t.span; - current_run = Some(Run { start_pos, end_idx: idx }); + current_run = Some(Run { + start_pos, + end_idx: idx, + }); continue; } @@ -225,11 +229,11 @@ pub fn render_output( let end_token = &orig_tokens[run.end_idx]; let start_pos = run.start_pos; let (_, end_pos) = end_token.span; - buf.emit(&orig[start_pos .. end_pos], end_token.spacing); + buf.emit(&orig[start_pos..end_pos], end_token.spacing); } if let Some(t) = orig_tokens.last() { let (_, end_pos) = t.span; - buf.emit(&orig[end_pos .. orig.len()], Spacing::Joint); + buf.emit(&orig[end_pos..orig.len()], Spacing::Joint); } } diff --git a/tools/split_ffi_entry_points/src/main.rs b/tools/split_ffi_entry_points/src/main.rs index 5157aec162..33fed3afa6 100644 --- a/tools/split_ffi_entry_points/src/main.rs +++ b/tools/split_ffi_entry_points/src/main.rs @@ -1,22 +1,21 @@ -use std::fs; -use std::iter; -use std::mem; -use std::path::{Path, PathBuf}; -use std::str::FromStr; use clap::Parser; -use proc_macro2::{TokenStream, Span}; +use proc_macro2::{Span, TokenStream}; use quote::ToTokens; use ra_ap_hir::Semantics; use ra_ap_ide_db::RootDatabase; use ra_ap_load_cargo::{self, LoadCargoConfig, ProcMacroServerChoice}; use ra_ap_project_model::CargoConfig; use ra_ap_syntax::SyntaxNode; -use rust_util::rewrite::{FlatTokens, TokenIndex, OutputBuffer, render_output}; +use rust_util::rewrite::{FlatTokens, OutputBuffer, TokenIndex, render_output}; +use std::fs; +use std::iter; +use std::mem; +use std::path::{Path, PathBuf}; +use std::str::FromStr; use syn; use syn::spanned::Spanned; use syn::visit_mut::{self, VisitMut}; - struct AddDerivedItemVisitor(F); impl Option> AddDerivedItemVisitor { @@ -88,21 +87,19 @@ fn add_ffi_wrapper( let mut pm = ParsedMeta::from(attr.meta); let mut move_to_wrapper = false; - pm.with_innermost_mut(&mut |pm| { - match pm { - ParsedMeta::NoMangle(..) => { - move_to_wrapper = true; - *pm = ParsedMeta::ExportName(ParsedMetaExportName { - ident: syn::Ident::new("export_name", Span::call_site()), - eq: syn::Token![=](Span::call_site()), - name: syn::LitStr::new(&fn_name, Span::call_site()), - }); - }, - ParsedMeta::ExportName(..) => { - move_to_wrapper = true; - }, - _ => {}, + pm.with_innermost_mut(&mut |pm| match pm { + ParsedMeta::NoMangle(..) => { + move_to_wrapper = true; + *pm = ParsedMeta::ExportName(ParsedMetaExportName { + ident: syn::Ident::new("export_name", Span::call_site()), + eq: syn::Token![=](Span::call_site()), + name: syn::LitStr::new(&fn_name, Span::call_site()), + }); + } + ParsedMeta::ExportName(..) => { + move_to_wrapper = true; } + _ => {} }); attr.meta = pm.into(); @@ -137,20 +134,18 @@ fn add_ffi_wrapper( for (i, arg) in fn_wrapper.sig.inputs.iter_mut().enumerate() { let ident = match *arg { syn::FnArg::Receiver(_) => syn::Ident::new("self", Span::call_site()), - syn::FnArg::Typed(ref mut pt) => { - match *pt.pat { - syn::Pat::Ident(ref pi) => pi.ident.clone(), - _ => { - let ident = syn::Ident::new(&format!("arg{i}"), Span::call_site()); - *pt.pat = syn::Pat::Ident(syn::PatIdent { - attrs: Vec::new(), - by_ref: None, - mutability: None, - ident: ident.clone(), - subpat: None, - }); - ident - }, + syn::FnArg::Typed(ref mut pt) => match *pt.pat { + syn::Pat::Ident(ref pi) => pi.ident.clone(), + _ => { + let ident = syn::Ident::new(&format!("arg{i}"), Span::call_site()); + *pt.pat = syn::Pat::Ident(syn::PatIdent { + attrs: Vec::new(), + by_ref: None, + mutability: None, + ident: ident.clone(), + subpat: None, + }); + ident } }, }; @@ -187,7 +182,6 @@ fn span_to_text_range(span: Span) -> TextRange { } */ - // Helpers for dealing with nested meta items in attrs, like `#[unsafe(no_mangle)]` #[derive(Clone)] @@ -227,18 +221,26 @@ impl ParsedMeta { let ident = ml.path.require_ident()?.clone(); let paren = match ml.delimiter { syn::MacroDelimiter::Paren(p) => p, - _ => return Err( - syn::Error::new(ml.delimiter.span().open(), "expected parens")), + _ => { + return Err(syn::Error::new( + ml.delimiter.span().open(), + "expected parens", + )); + } }; let meta: syn::Meta = syn::parse2(ml.tokens.clone())?; let inner = ParsedMeta::from(meta); - Ok(ParsedMeta::Unsafe(Box::new(ParsedMetaUnsafe { ident, paren, inner }))) - }, + Ok(ParsedMeta::Unsafe(Box::new(ParsedMetaUnsafe { + ident, + paren, + inner, + }))) + } "no_mangle" => { let _ = meta.require_path_only()?; let ident = ident.clone(); Ok(ParsedMeta::NoMangle(ParsedMetaNoMangle { ident })) - }, + } "export_name" => { let mnv = meta.require_name_value()?; let ident = mnv.path.require_ident()?.clone(); @@ -255,17 +257,19 @@ impl ParsedMeta { syn::Lit::Str(ref ls) => ls.clone(), _ => return Err(syn::Error::new(lit.span(), "expected Str")), }; - Ok(ParsedMeta::ExportName(ParsedMetaExportName { ident, eq, name })) - }, + Ok(ParsedMeta::ExportName(ParsedMetaExportName { + ident, + eq, + name, + })) + } _ => Ok(ParsedMeta::Meta(meta.clone())), } } pub fn with_innermost_mut(&mut self, f: &mut impl FnMut(&mut ParsedMeta)) { match *self { - ParsedMeta::Meta(..) | - ParsedMeta::NoMangle(..) | - ParsedMeta::ExportName(..) => f(self), + ParsedMeta::Meta(..) | ParsedMeta::NoMangle(..) | ParsedMeta::ExportName(..) => f(self), ParsedMeta::Unsafe(ref mut pmu) => pmu.inner.with_innermost_mut(f), } } @@ -278,7 +282,7 @@ impl From for ParsedMeta { Err(e) => { eprintln!("warning: failed to parse `{}`: {e}", meta.to_token_stream()); ParsedMeta::Meta(meta) - }, + } } } } @@ -347,7 +351,8 @@ fn main() { &cargo_config, &load_cargo_config, &|_msg| {}, - ).unwrap(); + ) + .unwrap(); // Assume the first file in `vfs` is the crate root. let (first_file_id, _) = vfs.iter().next().unwrap(); diff --git a/tools/split_rust/src/main.rs b/tools/split_rust/src/main.rs index 802489c059..206d389cad 100644 --- a/tools/split_rust/src/main.rs +++ b/tools/split_rust/src/main.rs @@ -1,10 +1,10 @@ -use std::collections::HashMap; -use std::fs; -use std::path::PathBuf; +use clap::Parser; use rust_util::collect::FileCollector; use rust_util::item_span::item_spans; use serde_json; -use clap::Parser; +use std::collections::HashMap; +use std::fs; +use std::path::PathBuf; /// Split a Rust codebase into a JSON map from item paths to their source text. #[derive(Parser)] @@ -22,7 +22,7 @@ fn main() { eprintln!("visit {:?}", name); let src = fs::read_to_string(name).unwrap(); for (item_path, lo, hi) in item_spans(mod_path.to_owned(), ast) { - let snippet = &src[lo .. hi]; + let snippet = &src[lo..hi]; out.insert(item_path.join("::"), snippet.to_owned()); } }