Skip to content

Commit

Permalink
fix: make sure the const-extern-fn feature is enabled
Browse files Browse the repository at this point in the history
This was dropped in fa554bc on `main` and 674cc1f on `libc-0.2`
("Drop the libc_const_extern_fn conditional"). Unfortunately, this meant
that functions were incorrectly never getting marked `const`, which
showed up with `CMSG_SPACE` [1].

Instead of the fix here, I attempted to just use `cfg(not(libc_ctest))`
instead of a Cargo feature to enable `const` extern functions; however,
this seemed extremely problematic with `ctest` for some reason [2].
Instead, leave the feature as-is and just make it enabled by default.

Fixes: rust-lang#4115 [1]

[2]: rust-lang#4134

(backport <rust-lang#4134>)
(cherry picked from commit 19e9e6a)
  • Loading branch information
tgross35 committed Nov 25, 2024
1 parent c93e86c commit c2bded3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cargo-args = ["-Zbuild-std=core"]
rustc-std-workspace-core = { version = "1.0.0", optional = true }

[features]
default = ["std"]
default = ["const-extern-fn", "std"]
std = []
rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
extra_traits = []
Expand Down

0 comments on commit c2bded3

Please sign in to comment.