Skip to content

Feature detection bug in old nightly #3066

Closed as not planned
Closed as not planned
@robertbastian

Description

@robertbastian
mkdir repro
cd repro
cargo init
cargo add libc
cargo +nightly-2022-04-05 check
Compiling libc v0.2.139
error[E0658]: `const extern fn` definitions are unstable
    --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/macros.rs:188:17
     |
188  | /                 pub $($constness)* unsafe extern fn $i($($arg: $argty),*
189  | |                 ) -> $ret {
190  | |                     $($body);*
191  | |                 }
     | |_________________^
     |
    ::: ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/unix/linux_like/mod.rs:1501:1
     |
1501 | / f! {
1502 | |     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
1503 | |         if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
1504 | |             (*mhdr).msg_control as *mut cmsghdr
...    |
1547 | |     }
1548 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926 <https://github.com/rust-lang/rust/issues/64926> for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `const extern fn` definitions are unstable
    --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/macros.rs:203:17
     |
203  | /                 pub $($constness)* extern fn $i($($arg: $argty),*
204  | |                 ) -> $ret {
205  | |                     $($body);*
206  | |                 }
     | |_________________^
     |
    ::: ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/unix/linux_like/mod.rs:1550:1
     |
1550 | / safe_f! {
1551 | |     pub fn SIGRTMAX() -> ::c_int {
1552 | |         unsafe { __libc_current_sigrtmax() }
1553 | |     }
...    |
1625 | |     }
1626 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926 <https://github.com/rust-lang/rust/issues/64926> for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `safe_f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `const extern fn` definitions are unstable
    --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/macros.rs:203:17
     |
203  | /                 pub $($constness)* extern fn $i($($arg: $argty),*
204  | |                 ) -> $ret {
205  | |                     $($body);*
206  | |                 }
     | |_________________^
     |
    ::: ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.139/src/unix/linux_like/linux/mod.rs:3720:1
     |
3720 | / safe_f! {
3721 | |     pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
3722 | |         let major = major as ::dev_t;
3723 | |         let minor = minor as ::dev_t;
...    |
3730 | |     }
3731 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926 <https://github.com/rust-lang/rust/issues/64926> for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `safe_f` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions