diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-06 22:53:05 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-06 22:53:05 +0100 |
commit | 6fccb152b4646877e38dc29dce1b0cd826eb6908 (patch) | |
tree | 361153338ec7c32866a5477b3e7681d05a4b0b7c /crates/hir/src/source_analyzer.rs | |
parent | b37b709459a4ff881a91965ebf0c39e3a449c304 (diff) | |
parent | 20ae41c1a12963e938cb3bd4c7c84007412d6fa6 (diff) |
Merge #8746
8746: Don't store call-site text offsets in hygiene info r=matklad a=jonas-schievink
This threads a lot more database references around in order to avoid storing a bare `TextOffset` in the hygiene info. This `TextOffset` made hygiene info and `ItemTree`s more volatile than they should be, leading to excessive recomputation of `ItemTree`s.
The incremental test added in https://github.com/rust-analyzer/rust-analyzer/pull/8721 is now passing with these changes.
closes https://github.com/rust-analyzer/rust-analyzer/pull/8721
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
-rw-r--r-- | crates/hir/src/source_analyzer.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 0895bd6f1..b5c65808e 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -283,7 +283,7 @@ impl SourceAnalyzer { | |||
283 | 283 | ||
284 | // This must be a normal source file rather than macro file. | 284 | // This must be a normal source file rather than macro file. |
285 | let hygiene = Hygiene::new(db.upcast(), self.file_id); | 285 | let hygiene = Hygiene::new(db.upcast(), self.file_id); |
286 | let ctx = body::LowerCtx::with_hygiene(&hygiene); | 286 | let ctx = body::LowerCtx::with_hygiene(db.upcast(), &hygiene); |
287 | let hir_path = Path::from_src(path.clone(), &ctx)?; | 287 | let hir_path = Path::from_src(path.clone(), &ctx)?; |
288 | 288 | ||
289 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we | 289 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we |