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 9f23a63)
  • Loading branch information
tgross35 committed Nov 23, 2024
1 parent 026a64c commit 6acd276
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 6acd276

Please sign in to comment.