diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-08-03 18:00:36 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-08-05 13:03:03 +0200 |
| commit | 2e7db9c69ffeb58cb512e84a88ab5dced33abcf2 (patch) | |
| tree | 0a63402fe8f80eb05e5a193dee09ce1915458e64 /src/tools/rust-analyzer/crates/hir-expand | |
| parent | d84b970e6046b3212c918af52fd9f2c15630c862 (diff) | |
| download | rust-2e7db9c69ffeb58cb512e84a88ab5dced33abcf2.tar.gz rust-2e7db9c69ffeb58cb512e84a88ab5dced33abcf2.zip | |
Simplify FileDelegate
Diffstat (limited to 'src/tools/rust-analyzer/crates/hir-expand')
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-expand/src/change.rs | 4 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-expand/src/lib.rs | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-expand/src/change.rs b/src/tools/rust-analyzer/crates/hir-expand/src/change.rs index 1a3dd0e7ddb..8b3f69db027 100644 --- a/src/tools/rust-analyzer/crates/hir-expand/src/change.rs +++ b/src/tools/rust-analyzer/crates/hir-expand/src/change.rs @@ -1,7 +1,7 @@ //! Defines a unit of change that can applied to the database to get the next //! state. Changes are transactional. use base_db::{ - salsa::Durability, CrateGraph, CrateId, FileChange, SourceDatabaseExt, SourceRoot, + salsa::Durability, CrateGraph, CrateId, FileChange, SourceRoot, SourceRootDatabase, TargetLayoutLoadResult, Version, }; use la_arena::RawIdx; @@ -23,7 +23,7 @@ impl ChangeWithProcMacros { Self::default() } - pub fn apply(self, db: &mut (impl ExpandDatabase + SourceDatabaseExt)) { + pub fn apply(self, db: &mut (impl ExpandDatabase + SourceRootDatabase)) { self.source_change.apply(db); if let Some(proc_macros) = self.proc_macros { db.set_proc_macros_with_durability(Arc::new(proc_macros), Durability::HIGH); diff --git a/src/tools/rust-analyzer/crates/hir-expand/src/lib.rs b/src/tools/rust-analyzer/crates/hir-expand/src/lib.rs index 18da77d6caa..2bea9026265 100644 --- a/src/tools/rust-analyzer/crates/hir-expand/src/lib.rs +++ b/src/tools/rust-analyzer/crates/hir-expand/src/lib.rs @@ -176,7 +176,12 @@ impl ExpandErrorKind { &ExpandErrorKind::MissingProcMacroExpander(def_crate) => { match db.proc_macros().get_error_for_crate(def_crate) { Some((e, hard_err)) => (e.to_owned(), hard_err), - None => ("missing expander".to_owned(), true), + None => ( + format!( + "internal error: proc-macro map is missing error entry for crate {def_crate:?}" + ), + true, + ), } } ExpandErrorKind::MacroDefinition => { |
