mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
⬆️ rust-analyzer
This commit is contained in:
parent
61c744d4fd
commit
a2a1d99545
126 changed files with 2098 additions and 904 deletions
|
@ -4,7 +4,7 @@ version = "0.0.0"
|
|||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
rust-version = "1.65"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
|
|
@ -117,7 +117,7 @@ impl Abi {
|
|||
let inner = unsafe { Abi_1_63::from_lib(lib, symbol_name) }?;
|
||||
Ok(Abi::Abi1_63(inner))
|
||||
}
|
||||
_ => Err(LoadProcMacroDylibError::UnsupportedABI),
|
||||
_ => Err(LoadProcMacroDylibError::UnsupportedABI(info.version_string.clone())),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,14 +80,14 @@ fn load_library(file: &Path) -> Result<Library, libloading::Error> {
|
|||
pub enum LoadProcMacroDylibError {
|
||||
Io(io::Error),
|
||||
LibLoading(libloading::Error),
|
||||
UnsupportedABI,
|
||||
UnsupportedABI(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for LoadProcMacroDylibError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Io(e) => e.fmt(f),
|
||||
Self::UnsupportedABI => write!(f, "unsupported ABI version"),
|
||||
Self::UnsupportedABI(v) => write!(f, "unsupported ABI `{v}`"),
|
||||
Self::LibLoading(e) => e.fmt(f),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,12 +113,12 @@ impl ProcMacroSrv {
|
|||
|
||||
fn expander(&mut self, path: &Path) -> Result<&dylib::Expander, String> {
|
||||
let time = fs::metadata(path).and_then(|it| it.modified()).map_err(|err| {
|
||||
format!("Failed to get file metadata for {}: {:?}", path.display(), err)
|
||||
format!("Failed to get file metadata for {}: {}", path.display(), err)
|
||||
})?;
|
||||
|
||||
Ok(match self.expanders.entry((path.to_path_buf(), time)) {
|
||||
Entry::Vacant(v) => v.insert(dylib::Expander::new(path).map_err(|err| {
|
||||
format!("Cannot create expander for {}: {:?}", path.display(), err)
|
||||
format!("Cannot create expander for {}: {}", path.display(), err)
|
||||
})?),
|
||||
Entry::Occupied(e) => e.into_mut(),
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@ fn test_derive_error() {
|
|||
expect![[r##"
|
||||
SUBTREE $
|
||||
IDENT compile_error 4294967295
|
||||
PUNCH ! [joint] 4294967295
|
||||
PUNCH ! [alone] 4294967295
|
||||
SUBTREE () 4294967295
|
||||
LITERAL "#[derive(DeriveError)] struct S ;" 4294967295
|
||||
PUNCH ; [alone] 4294967295"##]],
|
||||
|
@ -109,7 +109,7 @@ fn test_fn_like_macro_clone_literals() {
|
|||
PUNCH , [alone] 4294967295
|
||||
LITERAL 2_u32 4294967295
|
||||
PUNCH , [alone] 4294967295
|
||||
PUNCH - [joint] 4294967295
|
||||
PUNCH - [alone] 4294967295
|
||||
LITERAL 4i64 4294967295
|
||||
PUNCH , [alone] 4294967295
|
||||
LITERAL 3.14f32 4294967295
|
||||
|
@ -130,7 +130,7 @@ fn test_attr_macro() {
|
|||
expect![[r##"
|
||||
SUBTREE $
|
||||
IDENT compile_error 4294967295
|
||||
PUNCH ! [joint] 4294967295
|
||||
PUNCH ! [alone] 4294967295
|
||||
SUBTREE () 4294967295
|
||||
LITERAL "#[attr_error(some arguments)] mod m {}" 4294967295
|
||||
PUNCH ; [alone] 4294967295"##]],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue