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

Define generic AbiExample for OnceLock #33520

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

ryoqun
Copy link
Member

@ryoqun ryoqun commented Oct 4, 2023

Problem

i found generic AbiExample can be implemented while working on #33501.

seems #33140 (comment) removed generic impl for OnceCell, and replaced it with manual concrete AbiExample impls.

Summary of Changes

Define generic AbiExample for OnceLock for ease of use of frozen abi.

cc: @apfitzge

cargo-test-sbf (governance/addin-mock/program, governance/program):
error[E0658]: use of unstable library feature 'once_cell'
   --> src/abi_example.rs:559:36
     |
 559 | impl<T: AbiExample> AbiExample for std::sync::OnceLock<T> {
     |                                    ^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: see issue #74465 <rust-lang/rust#74465> for more information
     = help: add `#![feature(once_cell)]` to the crate attributes to enable
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #33520 (a30a797) into master (c9d04bc) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #33520   +/-   ##
=======================================
  Coverage    81.7%    81.7%           
=======================================
  Files         802      802           
  Lines      217872   217863    -9     
=======================================
+ Hits       178144   178184   +40     
+ Misses      39728    39679   -49     

Copy link
Contributor

@behzadnouri behzadnouri left a comment

Choose a reason for hiding this comment

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

see:
https://discord.com/channels/428295358100013066/1070815022604877915/1149026378323345469
for why this was removed.
Seems like toolchain has been updated since then.

@ryoqun ryoqun merged commit 05ddbf3 into solana-labs:master Oct 4, 2023
31 checks passed
tao-stones pushed a commit to tao-stones/solana that referenced this pull request Oct 6, 2023
* Define generic AbiExample for OnceLock

* Guard with cfg...

cargo-test-sbf (governance/addin-mock/program, governance/program):
error[E0658]: use of unstable library feature 'once_cell'
   --> src/abi_example.rs:559:36
     |
 559 | impl<T: AbiExample> AbiExample for std::sync::OnceLock<T> {
     |                                    ^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: see issue #74465 <rust-lang/rust#74465> for more information
     = help: add `#![feature(once_cell)]` to the crate attributes to enable
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.

2 participants