From c2bded38da9ff38f0a523da7c9e47528e75a38e5 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 22 Nov 2024 20:46:24 -0500 Subject: [PATCH] fix: make sure the `const-extern-fn` feature is enabled This was dropped in fa554bc4f8 on `main` and 674cc1f47f 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: https://github.com/rust-lang/libc/issues/4115 [1] [2]: https://github.com/rust-lang/libc/pull/4134 (backport ) (cherry picked from commit 19e9e6ade3a9fe8d077ca0e2643bae7daa26005b) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 234e74453472c..6d15865ab6845 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = []