Skip to content
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

chore: rm nonexhaustive for error #726

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Sep 17, 2023

having non-exhaustive on an error forces this clippy error:

126 | pub enum EVMError<DBError> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `EVMError<T>`
    = note: `EVMError<T>` is marked as non-exhaustive, so a wildcard `_` is necessary to match exhaustively
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
192 ~             EVMError::Database(err) => err.into(),
193 ~             _ => todo!(),
    |

this forces a wildcard handling which can introduce bugs if a new evmerror variant is added

@rakita
Copy link
Member

rakita commented Sep 18, 2023

This error marks the transaction as Invalid, so I would not assume that it will break things if the subvariant is different.

Would move those two errors behind EnvError: #685 so #[non_exhaustive] is less impactful and would be okay to remove it.

@rakita rakita merged commit 70cf969 into bluealloy:main Sep 18, 2023
8 checks passed
tonyke-bot pushed a commit to fuzzland/revm that referenced this pull request Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants