mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
Pass tidy checks
This commit is contained in:
parent
fdddd83224
commit
bbaf4daca0
4 changed files with 11 additions and 6 deletions
|
@ -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};
|
use std::{env, fs::File, io::Write, path::PathBuf, process::Command};
|
||||||
|
|
||||||
fn main() {
|
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());
|
let mut path = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
path.push("rustc_version.rs");
|
path.push("rustc_version.rs");
|
||||||
let mut f = File::create(&path).unwrap();
|
let mut f = File::create(&path).unwrap();
|
||||||
|
|
|
@ -82,7 +82,7 @@ impl server::FreeFunctions for RustAnalyzer {
|
||||||
&mut self,
|
&mut self,
|
||||||
s: &str,
|
s: &str,
|
||||||
) -> Result<bridge::Literal<Self::Span, Self::Symbol>, ()> {
|
) -> Result<bridge::Literal<Self::Span, Self::Symbol>, ()> {
|
||||||
// TODO: keep track of LitKind and Suffix
|
// FIXME: keep track of LitKind and Suffix
|
||||||
let symbol = SYMBOL_INTERNER.lock().unwrap().intern(s);
|
let symbol = SYMBOL_INTERNER.lock().unwrap().intern(s);
|
||||||
Ok(bridge::Literal {
|
Ok(bridge::Literal {
|
||||||
kind: bridge::LitKind::Err,
|
kind: bridge::LitKind::Err,
|
||||||
|
@ -391,8 +391,9 @@ impl server::MultiSpan for RustAnalyzer {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl server::Symbol for RustAnalyzer {
|
impl server::Symbol for RustAnalyzer {
|
||||||
fn normalize_and_validate_ident(&mut self, _string: &str) -> Result<Self::Symbol, ()> {
|
fn normalize_and_validate_ident(&mut self, string: &str) -> Result<Self::Symbol, ()> {
|
||||||
todo!()
|
// FIXME: nfc-normalize and validate idents
|
||||||
|
Ok(<Self as server::Server>::intern_symbol(string))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Symbol interner for proc-macro-srv
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use std::{collections::HashMap, sync::Mutex};
|
use std::{collections::HashMap, sync::Mutex};
|
||||||
use tt::SmolStr;
|
use tt::SmolStr;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! TokenStream implementation used by sysroot ABI
|
||||||
|
|
||||||
use tt::TokenTree;
|
use tt::TokenTree;
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone)]
|
#[derive(Debug, Default, Clone)]
|
||||||
|
|
Loading…
Reference in a new issue