core: mark float ClampBounds methods as #[inline] - #162191
Open
ojeda wants to merge 1 commit into
Open
Conversation
Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked `#[inline]`. This causes `core` to require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel: ld.lld: error: undefined symbol: fmaximum_numf >>> referenced by core.1f440ee8661e09f9-cgu.0 >>> rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a (and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`). It is possible to work around this in the Linux side, but these methods should probably be `#[inline]` to begin with, like many other similar methods are. Thus mark them as inline. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Collaborator
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
21 tasks
Contributor
|
These things pop up in the weirdest places. I think marking these as inline is perfectly fine and if it accomplishes what you want, doubly so. @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 2, 2026
core: mark float `ClampBounds` methods as `#[inline]` Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked `#[inline]`. This causes `core` to require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel: ld.lld: error: undefined symbol: fmaximum_numf >>> referenced by core.1f440ee8661e09f9-cgu.0 >>> rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a (and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`). It is possible to work around this in the Linux side, but these methods should probably be `#[inline]` to begin with, like many other similar methods are. Thus mark them as inline.
Contributor
Author
Thanks for the quick review! :) Yeah, the kernel build works with these 3 (all needed, i.e. it is the minimum set -- maybe the other methods on top could be marked too, but they are generic anyway). |
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 2, 2026
core: mark float `ClampBounds` methods as `#[inline]` Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked `#[inline]`. This causes `core` to require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel: ld.lld: error: undefined symbol: fmaximum_numf >>> referenced by core.1f440ee8661e09f9-cgu.0 >>> rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a (and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`). It is possible to work around this in the Linux side, but these methods should probably be `#[inline]` to begin with, like many other similar methods are. Thus mark them as inline.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 2, 2026
core: mark float `ClampBounds` methods as `#[inline]` Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked `#[inline]`. This causes `core` to require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel: ld.lld: error: undefined symbol: fmaximum_numf >>> referenced by core.1f440ee8661e09f9-cgu.0 >>> rust/core.o:(<core::ops::range::RangeFrom<f32> as core::cmp::clamp::ClampBounds<f32>>::clamp) in archive vmlinux.a (and similar for `f{min,max}imum_num{f,}` and `__gt{s,d}f2`). It is possible to work around this in the Linux side, but these methods should probably be `#[inline]` to begin with, like many other similar methods are. Thus mark them as inline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit bd174e1 ("Implement clamp_to") added a few float methods that are not marked
#[inline]. This causescoreto require new symbols in soft-float builds, even if the methods are unused, e.g. from the Linux kernel:(and similar for
f{min,max}imum_num{f,}and__gt{s,d}f2).It is possible to work around this in the Linux side, but these methods should probably be
#[inline]to begin with, like many other similar methods are.Thus mark them as inline.