From 3716ba66c4d18e7c3ec28e8383366e8107803b67 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`. 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 [1]. Instead, leave the feature as-is and just make it enabled by default. Fixes: https://github.com/rust-lang/libc/issues/4115 [1]: https://github.com/rust-lang/libc/pull/4134 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9deb2ac564e9a..107ee46ea3909 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,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 = ["rustc-std-workspace-core"] extra_traits = []