Skip to content

Fix libm intrinsics for versions newer than 0.2.11 #364

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

Merged
merged 1 commit into from
Aug 16, 2025

Conversation

tuguzT
Copy link
Contributor

@tuguzT tuguzT commented Aug 15, 2025

Resolves #242 in another way by allowing to update libm dependency

I think that backend tried to replace all the public functions usages inside of libm itself, which caused issue #242 in the first place.

Without suggested changes, compilation fails with ICE similar to this one:

error: internal compiler error: compiler\rustc_middle\src\ty\mod.rs:1631:13: item_name: no name for DefPath { data: [DisambiguatedDefPathData { data: TypeNs("math"), disambiguator: 0 }, DisambiguatedDefPathData { data: TypeNs("generic"), disambiguator: 0 }, DisambiguatedDefPathData { data: TypeNs("rint"), disambiguator: 0 }, DisambiguatedDefPathData { data: ValueNs("rint_round"), disambiguator: 0 }, DisambiguatedDefPathData { data: Closure, disambiguator: 0 }], krate: crate0 }

Note that local DefId has krate field defined as LOCAL_CRATE, or CrateNum::ZERO, which Display impl is exactly crate0

@tuguzT tuguzT changed the title Fix libm intrinsics for versions newer that 0.2.11 Fix libm intrinsics for versions newer than 0.2.11 Aug 15, 2025
@tuguzT tuguzT marked this pull request as ready for review August 15, 2025 20:33
Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

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

Wow, thank you for the PR! This looks good to me 🚀

@LegNeato LegNeato added this pull request to the merge queue Aug 16, 2025
Merged via the queue into Rust-GPU:main with commit 9cf4ea4 Aug 16, 2025
13 checks passed
@@ -59,8 +59,7 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter", "json"] }
num-traits = { version = "0.2.15", default-features = false }
glam = { version = ">=0.22, <=0.30", default-features = false }
# libm 0.2.12 is a breaking change with new intrinsics
libm = { version = ">=0.2.5, <=0.2.11", default-features = false }
libm = { version = ">=0.2.5", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this version is equivalent to just 0.2.5, which is a more common format in Rust crates. It was only written like that before due to a range constraint.

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.

libm 0.2.12 breaks rust-gpu
3 participants