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

Remove uses of #[path = "../lazy.rs"] #581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove uses of #[path = "../lazy.rs"] #581

wants to merge 1 commit into from

Conversation

josephlr
Copy link
Member

@josephlr josephlr commented Jan 10, 2025

Now that the MSRV is >= 1.60, we can use #[cfg(target_has_atomic = "ptr")] to conditionally compile lazy.rs. We should probably also move other atomic/lazy code into lazy.rs, but that can wait for a followup PR.

I also slightly cleaned up the rndr.rs code to make things a bit more readable and to have the std implementation take precedence over the asm-based implementation. Let me know if you want me to split it off into its own PR.

Now that the MSRV is >= 1.60, we can use `#[cfg(target_has_atomic = "ptr")]`
to conditionally compile `lazy.rs`. We should probably also move other
atomic/lazy code into lazy.rs, but that can wait for a followup PR.

I also slightly cleaned up the `rndr.rs` code to make things a bit more
readable, let me know if you want me to split it off into its own PR.

Signed-off-by: Joe Richey <[email protected]>
@josephlr josephlr requested a review from newpavlov January 10, 2025 03:54
@josephlr josephlr modified the milestones: v0.3, Post 0.3 Release Jan 10, 2025
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

Considering that lazy is used only in two opt-in modules, I think #[path = "../lazy.rs"] is fine, especially considering that it also allows us to remove #![allow(dead_code)]. But it could be a different story if other atomic code is moved into the lazy module.

Could you move the RNDR cleanup into a separate PR?

fn is_rndr_available() -> bool {
true
}
#[cfg(not(target_feature = "rand"))]
Copy link
Member

Choose a reason for hiding this comment

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

Add an empty line here for better readability.

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