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

Follow-up: Implement storage2 trait derive proc. macros #399

Merged
merged 5 commits into from
May 21, 2020

Conversation

Robbepop
Copy link
Collaborator

@Robbepop Robbepop commented May 19, 2020

Follow up for #311 .
Adds derive proc. macros for the SpreadLayout and PackedLayout traits of the new ink_core::storage2 module.

Must not be merged before #311 is merged.

This PR also improves the structure of the ink_core/derive crate.
Moves AllocateUsing and Flush derives into their own files.
Move to synstructure tests for the new trait derive proc. macros instead of the current test framework.

@Robbepop Robbepop mentioned this pull request May 19, 2020
81 tasks
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2020

Codecov Report

Merging #399 into master will decrease coverage by 0.07%.
The diff coverage is 99.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #399      +/-   ##
==========================================
- Coverage   86.34%   86.27%   -0.08%     
==========================================
  Files         131      134       +3     
  Lines        5727     5821      +94     
==========================================
+ Hits         4945     5022      +77     
- Misses        782      799      +17     
Impacted Files Coverage Δ
core/derive/src/spread_layout.rs 98.52% <98.52%> (ø)
core/derive/src/allocate_using.rs 100.00% <100.00%> (ø)
core/derive/src/flush.rs 100.00% <100.00%> (ø)
core/derive/src/packed_layout.rs 100.00% <100.00%> (ø)
core/src/storage2/traits/impls/tuples.rs 47.36% <0.00%> (-52.64%) ⬇️
core/src/storage2/traits/impls/prims.rs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dffc8cf...972b96b. Read the comment docs.

@Robbepop Robbepop marked this pull request as ready for review May 20, 2020 12:12
Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

LGTM

/// we use the array indexing trick to compute the maximum element:
///
/// ```no_compile
/// max(a, b) = [a, b][(a < b) as usize]
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL

@Robbepop Robbepop merged commit 0c253cb into master May 21, 2020
@Robbepop Robbepop deleted the robin-impl-storage2-derives branch May 21, 2020 08:32
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