Skip to content

Commit

Permalink
Proof that #5046 is fixed. (#6583)
Browse files Browse the repository at this point in the history
## Description

The reproduction reported in #5046 is throwing the expected error.

Closes #5046.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

Co-authored-by: Joshua Batty <[email protected]>
  • Loading branch information
esdrubal and JoshuaBatty authored Sep 26, 2024
1 parent 2156bfb commit 6fe4223
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[package]]
name = "core"
source = "path+from-root-6B977435DD9C5058"

[[package]]
name = "missing_hash_trait"
source = "member"
dependencies = ["std"]

[[package]]
name = "std"
source = "path+from-root-6B977435DD9C5058"
dependencies = ["core"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "missing_hash_trait"
entry = "main.sw"
implicit-std = false

[dependencies]
std = { path = "../../../../../../sway-lib-std" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
contract;

struct MyStruct {
val: u64
}

abi MyContract {
#[storage(read, write)]
fn test_function();
}

storage {
my_map: StorageMap<MyStruct, u64> = StorageMap::<MyStruct, u64> {},
}

impl MyContract for Contract {
#[storage(read, write)]
fn test_function() {
let my_struct = MyStruct { val: 1 };
storage.my_map.insert(my_struct, 2)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
category = "fail"

# check: $()storage.my_map.insert(my_struct, 2)
# nextln: $()Trait "Hash" is not implemented for type "MyStruct".

0 comments on commit 6fe4223

Please sign in to comment.