Skip to content

Clippy error: Asn1Read Err-variant is at least 136 bytes #7

Description

@robgjansen

We have the following clippy error caused by the asn1 crypto dependency:

✗ cargo clippy --all-targets -- -Dwarnings
   Compiling proteus v0.3.0 (/Users/rjansen/proteus)
    Checking test_bin v0.5.0
error: the `Err`-variant returned from this closure is very large
 --> src/crypto/pubkey.rs:7:10
  |
7 | #[derive(Asn1Read, Asn1Write)]
  |          ^^^^^^^^ the `Err`-variant is at least 136 bytes
  |
  = help: try reducing the size of `asn1::ParseError`, for example by boxing large elements or replacing it with `Box<asn1::ParseError>`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#result_large_err
  = note: `-D clippy::result-large-err` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(clippy::result_large_err)]`
  = note: this error originates in the derive macro `Asn1Read` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `proteus` (bin "proteus") due to 1 previous error

I tried disabling with #[allow(clippy::result_large_err)], but the exclusion is not getting applied maybe because it's an inner type defined in an external library.

This might be fixed in the latest version of asn1, version 0.24.1. We should check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions