Skip to content

fix: the trait bound [u8]: AsRef<[_; 0]> is not satisfied in precompiles#114

Merged
mattsse merged 2 commits intomainfrom
zerosnacks/attempt-ref-fix
Jun 24, 2025
Merged

fix: the trait bound [u8]: AsRef<[_; 0]> is not satisfied in precompiles#114
mattsse merged 2 commits intomainfrom
zerosnacks/attempt-ref-fix

Conversation

@zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Jun 24, 2025

Motivation

As raised here: #100 (comment) looks to be a regression of #86 during port to revm 26

In Foundry we are getting the following error on the r.as_ref() line:

when using the library in https://github.com/foundry-rs/foundry/tree/zerosnacks/bump-revm-26.0.0:

the trait bound `[u8]: AsRef<[_; 0]>` is not satisfied
the following other types implement trait `AsRef<T>`:
  `[u8]` implements `AsRef<winnow::stream::bstr::BStr>`
  `[u8]` implements `AsRef<winnow::stream::bytes::Bytes>`

Solution

Fixes type mismatch, turns it into a &[u8]

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks changed the title fix: attempt ref fix fix: the trait bound [u8]: AsRef<[_; 0]> is not satisfied in precompiles Jun 24, 2025
@zerosnacks zerosnacks marked this pull request as ready for review June 24, 2025 10:00
@zerosnacks zerosnacks requested review from klkvr and mattsse as code owners June 24, 2025 10:00
@zerosnacks zerosnacks mentioned this pull request Jun 24, 2025
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cursed -.-

@mattsse mattsse merged commit fabd2d3 into main Jun 24, 2025
27 checks passed
@mattsse mattsse deleted the zerosnacks/attempt-ref-fix branch June 24, 2025 10:16
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.

3 participants