Skip to content

fix: mark non-Linux stub functions as const fn - #87

Merged
fredespi merged 3 commits into
mainfrom
fix-cgroup-missing-const-lint
Jul 8, 2026
Merged

fix: mark non-Linux stub functions as const fn#87
fredespi merged 3 commits into
mainfrom
fix-cgroup-missing-const-lint

Conversation

@fredespi

@fredespi fredespi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cargo clippy --workspace --all-targets -- -D warnings flagged missing_const_for_fn on several non-Linux stub functions that trivially return a constant value and have no reason not to be const fn.
  • Marks container_id_for_pid (cgroup non-Linux stub) and several rocm-core non-Linux stub functions as const fn.
  • Fixes two environment-dependent test assumptions (python_launcher_prefers_path_python_*, runtime_environment_preloads_managed_rocm_paths) that incorrectly assumed properties true only on Linux/Windows.

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo fmt --check passes
  • cargo test --workspace --all-targets passes

fredespi added 3 commits July 8, 2026 14:58
Fixes a clippy missing_const_for_fn lint that only surfaces when
building on non-linux targets, since the function is cfg-gated to
non-linux and therefore never compiled (or linted) by Linux-only CI.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
Fixes the remaining missing_const_for_fn clippy lints that only surface
when building on non-linux targets. Each stub is cfg-gated to
non-linux and therefore never compiled or linted by Linux-only CI.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
python_launcher_prefers_path_python_* assumed every host has a wheel
platform tag; skip when current_platform_wheel_tags() has no match
(e.g. macOS) since python selection always falls through to managed.

runtime_environment_preloads_managed_rocm_paths asserted LD_LIBRARY_PATH
on any non-Windows host, but it's only set on Linux.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
@fredespi
fredespi force-pushed the fix-cgroup-missing-const-lint branch from 90e406c to 0a3a9f7 Compare July 8, 2026 13:00
@fredespi
fredespi added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 9841b96 Jul 8, 2026
15 checks passed
@fredespi
fredespi deleted the fix-cgroup-missing-const-lint branch July 8, 2026 16:52
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