Skip to content

fix: r.as_ref() the trait AsRef<[_; 0]> is not implemented for [u8]#86

Merged
mattsse merged 5 commits intomainfrom
zerosnacks/fix-as-ref
May 12, 2025
Merged

fix: r.as_ref() the trait AsRef<[_; 0]> is not implemented for [u8]#86
mattsse merged 5 commits intomainfrom
zerosnacks/fix-as-ref

Conversation

@zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented May 12, 2025

Motivation

Whilst bumping to alloy-evm v0.7.1 I encountered this issue

This only occurs when alloy-evm is integrated (in this case Foundry); it is not raised when I clone and compile alloy-evm from source

Screenshot from 2025-05-12 14-49-46

Solution

I think this code is equivalent and resolves the compiler error downstream for Foundry

cc @mattsse / @klkvr

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks self-assigned this May 12, 2025
@zerosnacks zerosnacks added the bug Something isn't working label May 12, 2025
@mattsse
Copy link
Member

mattsse commented May 12, 2025

this is likely a msrv issue

but we should use &* here

changing

@zerosnacks zerosnacks marked this pull request as ready for review May 12, 2025 13:02
@zerosnacks zerosnacks requested review from klkvr and mattsse as code owners May 12, 2025 13:02
match context.local().shared_memory_buffer_slice(range.clone()) {
Some(slice) => {
r = slice;
r.as_ref()
Copy link
Member

Choose a reason for hiding this comment

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

can we do &*r here instead, I believe this is how we solved htis in revm-inspectors

paradigmxyz/revm-inspectors@5bf3f10

Copy link
Member Author

Choose a reason for hiding this comment

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

nice, this works 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

much better 😄

@zerosnacks zerosnacks requested a review from mattsse May 12, 2025 13:19
@mattsse mattsse merged commit 0feef69 into main May 12, 2025
27 checks passed
@mattsse mattsse deleted the zerosnacks/fix-as-ref branch May 12, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants