You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cargo build Compiling libc-const-extern-test v0.1.0 (/home/nathan/src/libc-const-extern-test)error[E0015]: cannot call non-const fn `WIFEXITED` in constants --> src/main.rs:4:27 |4 | const _: () = assert!(WIFEXITED(0)); | ^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variantsFor more information about this error, try `rustc --explain E0015`.error: could not compile `libc-const-extern-test` (bin "libc-const-extern-test") due to previous errorzsh: exit 101 cargo build
I wasn't sure if this was intended behavior or not (this error first showed up after commit e2e6fd6). If it is intended, then I guess it is just the README.md that may need to be updated to remove this text from the Features description:
const-extern-fn: ... If you use Rust >= 1.62, this feature is implicitly enabled. ...
If it is unintended, then should the const-extern-fn feature be enabled by default now that the MSRV of libc is 1.71?
In commit e2e6fd6 the definition of safe_f! in src/macros.rs was updated to be conditional on const-extern-fn directly. Previously it was conditionally defined based on libc_const_extern_fn which is automatically turned on by build.rs based on the rustc version.
Apologies in advance if this is a known breakage / work in progress on main.
The text was updated successfully, but these errors were encountered:
Yeah, it's WIP. I'd like to enable it unconditionally but ctest2 emits an error which is used by libc-test. That's because it uses an ancient rustc parser and we have to make it update (and enable the const fn feature) before releasing libc v0.3.
See #3248 for what is needed to release.
Looks like there is both feature = "const-extern-fn" which the user can enable and cfg(libc_const_extern_fn) which the build script automatically enables. The latter is entirely unused in the source code.
Rust / System details:
libc version: main branch at commit e2e6fd6 or later.
Minimal test code:
Build output:
I wasn't sure if this was intended behavior or not (this error first showed up after commit e2e6fd6). If it is intended, then I guess it is just the README.md that may need to be updated to remove this text from the Features description:
If it is unintended, then should the
const-extern-fn
feature be enabled by default now that the MSRV of libc is 1.71?In commit e2e6fd6 the definition of
safe_f!
insrc/macros.rs
was updated to be conditional onconst-extern-fn
directly. Previously it was conditionally defined based onlibc_const_extern_fn
which is automatically turned on bybuild.rs
based on the rustc version.Apologies in advance if this is a known breakage / work in progress on
main
.The text was updated successfully, but these errors were encountered: