What is wrong
Rust (capture layer) fails on clippy in cli/dirad:
error: the `Err`-variant returned from this function is very large
--> cli/dirad/src/...:386
386 | ) -> Result<(String, Option<bool>, ZavetConfig, Option<PathBuf>), Response> {
| ^^^^ the `Err`-variant is at least 160 bytes
= help: try reducing the size of `dira_core::protocol::Response`, for example by
boxing large elements or replacing it with `Box<dira_core::protocol::Response>`
= note: `-D clippy::result-large-err` implied by `-D warnings`
error: could not compile `dirad` (lib) due to 1 previous error
error: could not compile `dirad` (lib test) due to 1 previous error
The job denies warnings (-D warnings), so this one lint fails the build outright, including the lib-test target.
Why it is showing up now
Nothing in the crate changed. clippy::result_large_err tightened, so a Response that was always this size now trips the threshold. It reproduces on a branch that touches only markdown, which is how it was found: #129 changes 43 .md files and zero .rs files and is red on this job.
The fix is a judgement call
Two options, and they are not equivalent:
- Box it. Return
Result<T, Box<Response>> at the call sites clippy names. Correct if Response genuinely is a large error payload and the Err path is rare. Costs an allocation on the error path and touches every caller that matches on it.
- Shrink
Response. If the size comes from one fat variant, box that variant instead. Better long term, wider blast radius.
An #[allow(clippy::result_large_err)] is the third option and the worst one, since it hides the size rather than deciding about it.
Blast radius
Until this is fixed, Rust (capture layer) is red on every PR, including documentation-only ones, so the job cannot signal anything about the change under review.
🤖 Generated with Claude Code
What is wrong
Rust (capture layer)fails on clippy incli/dirad:The job denies warnings (
-D warnings), so this one lint fails the build outright, including the lib-test target.Why it is showing up now
Nothing in the crate changed.
clippy::result_large_errtightened, so aResponsethat was always this size now trips the threshold. It reproduces on a branch that touches only markdown, which is how it was found: #129 changes 43.mdfiles and zero.rsfiles and is red on this job.The fix is a judgement call
Two options, and they are not equivalent:
Result<T, Box<Response>>at the call sites clippy names. Correct ifResponsegenuinely is a large error payload and theErrpath is rare. Costs an allocation on the error path and touches every caller that matches on it.Response. If the size comes from one fat variant, box that variant instead. Better long term, wider blast radius.An
#[allow(clippy::result_large_err)]is the third option and the worst one, since it hides the size rather than deciding about it.Blast radius
Until this is fixed,
Rust (capture layer)is red on every PR, including documentation-only ones, so the job cannot signal anything about the change under review.🤖 Generated with Claude Code