Skip to content

libexpr: Remove non-const overload of listElems#13360

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
xokdvium:duplicate-list-elems-overload
Jun 13, 2025
Merged

libexpr: Remove non-const overload of listElems#13360
Mic92 merged 1 commit intoNixOS:masterfrom
xokdvium:duplicate-list-elems-overload

Conversation

@xokdvium
Copy link
Contributor

Motivation

This overload isn't actually necessary anywhere and doesn't make much sense. The pointers to Values are themselves const, but the Values are mutable.
A non-const member function implies that the object itself can be modified but this doesn't make much sense considering the return type: Value * const * , which is a pointer to a constant array of pointers to mutable values.

cc @roberth, @edolstra as you've been cleaning up the meaning of const throughout the codebase.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This overload isn't actually necessary anywhere and
doesn't make much sense. The pointers to `Value`s are
themselves const, but the `Value`s are mutable.
A non-const member function implies that the object itself
can be modified but this doesn't make much sense considering
the return type: `Value * const * `, which is a pointer
to a constant array of pointers to mutable values.
@xokdvium xokdvium requested a review from edolstra as a code owner June 12, 2025 22:31
@Mic92 Mic92 merged commit d12e424 into NixOS:master Jun 13, 2025
12 checks passed
@xokdvium xokdvium deleted the duplicate-list-elems-overload branch June 13, 2025 08:09
@roberth roberth added backports created Does not require attention and can be filtered away backport 2.28-maintenance Automatically creates a PR against the branch backport 2.29-maintenance Automatically creates a PR against the branch labels Jul 30, 2025
mergify bot added a commit that referenced this pull request Jul 31, 2025
…3360

libexpr: Remove non-const overload of `listElems` (backport #13360)
mergify bot added a commit that referenced this pull request Jul 31, 2025
…3360

libexpr: Remove non-const overload of `listElems` (backport #13360)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.28-maintenance Automatically creates a PR against the branch backport 2.29-maintenance Automatically creates a PR against the branch backports created Does not require attention and can be filtered away

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants