Add DependencyMap data structure for imports#268
Merged
LesterEvSe merged 0 commit intoBlockstreamResearch:dev/importsfrom Apr 2, 2026
Merged
Add DependencyMap data structure for imports#268LesterEvSe merged 0 commit intoBlockstreamResearch:dev/importsfrom
DependencyMap data structure for imports#268LesterEvSe merged 0 commit intoBlockstreamResearch:dev/importsfrom
Conversation
6b422d6 to
ce70a8b
Compare
Contributor
|
ce70a8b needs rebase |
KyrylR
reviewed
Apr 2, 2026
Comment on lines
+94
to
+112
| /// Inserts a dependency remapping without interacting with the physical file system. | ||
| /// | ||
| /// **Warning:** This method completely bypasses OS path canonicalization (`std::fs::canonicalize`). | ||
| /// It is designed strictly for unit testing and virtual file environments where the | ||
| /// provided paths might not actually exist on the hard drive. | ||
| #[cfg(test)] | ||
| pub fn test_insert_without_canonicalize( | ||
| &mut self, | ||
| context: &Path, | ||
| dependency_root_path: String, | ||
| path: &Path, | ||
| ) { | ||
| self.inner.push(Remapping { | ||
| context_prefix: context.to_path_buf(), | ||
| dependency_root_path, | ||
| target: path.to_path_buf(), | ||
| }); | ||
| self.sort_mappings(); | ||
| } |
Collaborator
There was a problem hiding this comment.
Let's not include methods meant for testing to impl blocks
| // No matches found | ||
| Err(Error::UnknownLibrary(first_segment.to_string())).with_span(*use_decl.span()) | ||
| } | ||
| } |
Collaborator
Author
|
I rebase the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DependencyMapandRemappingdata structures.