-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add #[abi_name(name = "foo")]
attribute to rename ABI items.
#7057
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
Conversation
#[abi_name()
attribute to rename ABI items.#[abi_name(name = "foo")
attribute to rename ABI items.
CodSpeed Performance ReportMerging #7057 will degrade performances by 19.1%Comparing Summary
Benchmarks breakdown
|
04f5114
to
0bddb9d
Compare
#[abi_name(name = "foo")
attribute to rename ABI items.#[abi_name(name = "foo")]
attribute to rename ABI items.
test/src/e2e_vm_tests/test_programs/should_pass/language/abi_name_attribute/.gitignore
Outdated
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_pass/language/abi_name_attribute/src/lib.sw
Outdated
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_pass/language/abi_name_attribute/src/lib.sw
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attribute should be added to the Attributes chapter in the documentation.
I've changed that documentation page fully in #7058 because it was seriously outdated. So, whoever gets the PR merged later will have some slight merge conflicts to solve on that page 😄
Pull request was converted to draft
0bddb9d
to
e45048c
Compare
e45048c
to
e364c5c
Compare
e364c5c
to
b993940
Compare
b993940
to
a9d5c2a
Compare
a9d5c2a
to
9046048
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small mistake in the docs definitely worth fixing, otherwise only nitpicks 😄
Regarding the comments about diagnostics guidelines, we should add those guidelines to the repo (currently they are only in the RFC) and polish existing diagnostics that violate them, but that's a low prio so far.
test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_abi_names/Forc.toml
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_abi_names/src/lib.sw
Outdated
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_abi_names/Forc.toml
Outdated
Show resolved
Hide resolved
...vm_tests/test_programs/should_fail/attributes_invalid_args_values_types/src/abi_name_attr.sw
Outdated
Show resolved
Hide resolved
.../src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_args_values_types/stdout.snap
Outdated
Show resolved
Hide resolved
Add `#[abi_name(name = "foo")]` attribute to rename enum and struct ABI items. Here is example of how it can be used: ``` contract; struct MyStruct {} enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes FuelLabs#5955.
952ebae
to
d3bd54c
Compare
d3bd54c
to
591114b
Compare
591114b
to
591b97a
Compare
febb58e
to
271a850
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Description
Add
#[abi_name(name = "foo")]
attribute to rename enum and struct ABI items.Here is example of how it can be used:
Closes #5955.
Remarks
The checking for ABI names is being done in the ABI generation phase, which made it a requirement to change the interface of ABI checking to return Results everywhere and passing Handler all the way down, so emitted errors can be passed down to the driver for reporting.
Checklist
Breaking*
orNew Feature
labels where relevant.