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

Replace OnceLock with LazyLock #11687

Open
jayzhan211 opened this issue Jul 28, 2024 · 9 comments · May be fixed by #11690 or #12601
Open

Replace OnceLock with LazyLock #11687

jayzhan211 opened this issue Jul 28, 2024 · 9 comments · May be fixed by #11690 or #12601
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jayzhan211
Copy link
Contributor

Is your feature request related to a problem or challenge?

LazyLock is stabilized in 1.80 🚀
It is more ergonomic than OnceLock, it would be nice to switch to LazyLock

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@jayzhan211 jayzhan211 added enhancement New feature or request good first issue Good for newcomers labels Jul 28, 2024
@Rafferty97
Copy link
Contributor

I'm happy to take this one. For the uses of OnceLock in statics that currently have an associated getter function, such as ROW_GROUP_METADATA and row_group_metadata in access_plan.rs, would it be better to replace calls to the function with direct access to the static, or just simplify the implementation of the getter function without changing the call sites?

@jayzhan211
Copy link
Contributor Author

We can direct access to the static data, since it is not a breaking change, changing call sites is fine

@Rafferty97
Copy link
Contributor

take

Rafferty97 added a commit to Rafferty97/datafusion that referenced this issue Jul 28, 2024
Rafferty97 added a commit to Rafferty97/datafusion that referenced this issue Jul 28, 2024
@Omega359
Copy link
Contributor

We can't do that (yet). DataFusion MSRV is 1.76

@jayzhan211
Copy link
Contributor Author

We can't do that (yet). DataFusion MSRV is 1.76

Oh, I forgot that. Sorry @Rafferty97

@alamb
Copy link
Contributor

alamb commented Sep 18, 2024

MSRV is now 1.78 so we can probably revive this issue

@alamb
Copy link
Contributor

alamb commented Sep 18, 2024

@Rafferty97 I unassigned you but if you are still interested in working on this issue, please feel free to reassign it to yourself.

For anyone else who finds this issue, you can see what is needed in this PR: #11690 but that has bitrotted.

I would suggest just applying the same changes in a new PR

@OussamaSaoudi
Copy link
Contributor

take

@Omega359
Copy link
Contributor

Didn't LazyLock become stable in 1.80.0 ? https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html

I just tried to use it in main and it wouldn't compile...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
5 participants