-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce boxes and vectors to reduce Result sizes. #3226
Conversation
The following error variants were large enough to trip Clippy's `result_large_err` lint: - RenderPassCompatibilityError::IncompatibleColorAttachment - CreateShaderModuleError::Validation Large error types are a problem, because they make the `Result` type large, requiring the program to copy around large numbers of bytes even in the success case. Since the failure case is rare, it's usually not a problem to just heap-allocate the contents to keep the `Ok` case small.
dcb48dd
to
76c0334
Compare
Codecov Report
@@ Coverage Diff @@
## master #3226 +/- ##
==========================================
- Coverage 64.70% 64.61% -0.10%
==========================================
Files 81 81
Lines 38819 39479 +660
==========================================
+ Hits 25118 25509 +391
- Misses 13701 13970 +269
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
The Android
|
FYI, my CI is seeing similar failures on macOS only, starting recently. |
Looks like a yank. https://crates.io/crates/ndk-sys/versions Not sure why this is causing failures on CI. (I am also seeing it) |
Obsoleted by #3231 |
@cwfitzgerald (CC @jimblandy): I don't think this PR is actually made obsolete by the rollback to MSRV 1.64. We will still need to confront the offending lint in an eventual upgrade to 1.65 or beyond, and in the meantime, this change is forwards-compatible with the current MSRV. Is there a reason I'm missing for closing this? |
@ErichDonGubler this PR was included as a commit on that PR. |
The following error variants were large enough to trip Clippy's
result_large_err
lint:Large error types are a problem, because they make the
Result
type large, requiring the program to copy around large numbers of bytes even in the success case. Since the failure case is rare, it's usually not a problem to just heap-allocate the contents to keep theOk
case small.Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories
Description
Describe what problem this is solving, and how it's solved.
Testing
Explain how this change is tested.