Skip to content

Conversation

@a1phyr
Copy link
Contributor

@a1phyr a1phyr commented Dec 1, 2025

Rewrite this function to help to compiler understand what is going on here.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2025

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@joboet
Copy link
Member

joboet commented Dec 2, 2025

The downcast change looks fine, but I'm not convinced about the box removal being beneficial: wouldn't this increase the size of io::Result to three words instead of two?

@a1phyr
Copy link
Contributor Author

a1phyr commented Dec 3, 2025

Wow, I somehow managed to convince myself that the ErrorData enum was boxed in this case to make Error a single word...

Given the current situation, removing this box is probably not beneficial indeed. I'll remove the second commit.

@a1phyr a1phyr changed the title io::Error: avoid double-boxing of "custom" variant on 32 bits targets io::Error::downcast: avoid reallocation in case of failure Dec 3, 2025
@a1phyr a1phyr changed the title io::Error::downcast: avoid reallocation in case of failure Improve io::Error::downcast: Dec 3, 2025
@a1phyr a1phyr changed the title Improve io::Error::downcast: Improve io::Error::downcast Dec 3, 2025
@joboet
Copy link
Member

joboet commented Dec 3, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 3, 2025

📌 Commit 7de190a has been approved by joboet

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants