From bbaf4daca02991f9b6ee90051248034a461bf91a Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Thu, 21 Jul 2022 13:37:41 +0200 Subject: [PATCH] Pass tidy checks --- crates/proc-macro-srv/build.rs | 6 +++--- crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs | 7 ++++--- .../src/abis/abi_sysroot/ra_server/symbol.rs | 2 ++ .../src/abis/abi_sysroot/ra_server/token_stream.rs | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/proc-macro-srv/build.rs b/crates/proc-macro-srv/build.rs index e3e4b9d87b..a8c732f315 100644 --- a/crates/proc-macro-srv/build.rs +++ b/crates/proc-macro-srv/build.rs @@ -1,9 +1,9 @@ +//! Determine rustc version `proc-macro-srv` (and thus the sysroot ABI) is +//! build with and make it accessible at runtime for ABI selection. + use std::{env, fs::File, io::Write, path::PathBuf, process::Command}; fn main() { - // Determine rustc version `proc-macro-srv` (and thus the sysroot ABI) is - // build with and make it accessible at runtime for ABI selection. - let mut path = PathBuf::from(env::var_os("OUT_DIR").unwrap()); path.push("rustc_version.rs"); let mut f = File::create(&path).unwrap(); diff --git a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs index d46f8dc88a..69f1e13fb0 100644 --- a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs +++ b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs @@ -82,7 +82,7 @@ impl server::FreeFunctions for RustAnalyzer { &mut self, s: &str, ) -> Result, ()> { - // TODO: keep track of LitKind and Suffix + // FIXME: keep track of LitKind and Suffix let symbol = SYMBOL_INTERNER.lock().unwrap().intern(s); Ok(bridge::Literal { kind: bridge::LitKind::Err, @@ -391,8 +391,9 @@ impl server::MultiSpan for RustAnalyzer { } impl server::Symbol for RustAnalyzer { - fn normalize_and_validate_ident(&mut self, _string: &str) -> Result { - todo!() + fn normalize_and_validate_ident(&mut self, string: &str) -> Result { + // FIXME: nfc-normalize and validate idents + Ok(::intern_symbol(string)) } } diff --git a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/symbol.rs b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/symbol.rs index 5bfc62a301..d16c2d2244 100644 --- a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/symbol.rs +++ b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/symbol.rs @@ -1,3 +1,5 @@ +//! Symbol interner for proc-macro-srv + use once_cell::sync::Lazy; use std::{collections::HashMap, sync::Mutex}; use tt::SmolStr; diff --git a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/token_stream.rs b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/token_stream.rs index c8bf2ecdd3..113bb52c1a 100644 --- a/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/token_stream.rs +++ b/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server/token_stream.rs @@ -1,3 +1,5 @@ +//! TokenStream implementation used by sysroot ABI + use tt::TokenTree; #[derive(Debug, Default, Clone)]