Skip to content

Add import errors#265

Merged
KyrylR merged 1 commit intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/errors
Apr 1, 2026
Merged

Add import errors#265
KyrylR merged 1 commit intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/errors

Conversation

@LesterEvSe
Copy link
Copy Markdown
Collaborator

This PR adds a useful set of errors for the import functionality. Also, the Error field inside the RichError struct was changed to Box<Error> to prevent large memory allocations on the stack and resolve clippy errors.

@LesterEvSe LesterEvSe requested a review from KyrylR April 1, 2026 09:30
@LesterEvSe LesterEvSe self-assigned this Apr 1, 2026
@LesterEvSe LesterEvSe requested a review from delta1 as a code owner April 1, 2026 09:30
@LesterEvSe LesterEvSe added the enhancement New feature or request label Apr 1, 2026
src/error.rs Outdated
{
fn merge(self, other: Self) -> Self {
match (&self.error, &other.error) {
match (&*self.error, &*other.error) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match (&*self.error, &*other.error) {
match (self.error.as_ref(), other.error.as_ref()) {

src/error.rs Outdated
if let Error::Syntax {
label: ref mut l, ..
} = &mut self.error
} = &mut *self.error
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} = &mut *self.error
} = self.error.as_mut()

src/error.rs Outdated
),
Error::Resolution(description) => write!(
f,
"Resolution error: {description}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more explanation to those messages

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we remove Virtual from the SourceFile struct, it is no longer needed. I will therefore remove it

@KyrylR KyrylR merged commit 0bb3a67 into BlockstreamResearch:dev/imports Apr 1, 2026
11 checks passed
@KyrylR KyrylR mentioned this pull request Apr 1, 2026
6 tasks
@LesterEvSe LesterEvSe deleted the feature/errors branch April 1, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants