GithubHelp home page GithubHelp logo

Comments (3)

alexcrichton avatar alexcrichton commented on July 2, 2024

This is likely indicative of either your compiler or a dependency needs to be updated, but I don't think this is an issue with this crate.

from socket2.

andykilroy avatar andykilroy commented on July 2, 2024

Found it. Was pulling in and aged cfg-if 0.1.2. Thanks Alex!

from socket2.

aleksuss avatar aleksuss commented on July 2, 2024

I've had the same issue when I tried to publish my crate which has a dependency socket2-0.3.11 with Rust 1.38. But with Rust 1.36 is OK.
Compile output:

error: cannot find macro `__cfg_if_items` in this scope
  --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:27:1
   |
27 | / cfg_if::cfg_if! {
28 | |     if #[cfg(any(target_os = "dragonfly", target_os = "freebsd",
29 | |                  target_os = "ios", target_os = "macos",
30 | |                  target_os = "openbsd", target_os = "netbsd",
...  |
37 | |     }
38 | | }
   | |_^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: cannot find macro `__cfg_if_items` in this scope
  --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:40:1
   |
40 | / cfg_if::cfg_if! {
41 | |     if #[cfg(any(target_os = "linux", target_os = "android",
42 | |                  target_os = "dragonfly", target_os = "freebsd",
43 | |                  target_os = "openbsd", target_os = "netbsd",
...  |
48 | |     }
49 | | }
   | |_^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: cannot find macro `__cfg_if_items` in this scope
  --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:51:1
   |
51 | / cfg_if::cfg_if! {
52 | |     if #[cfg(any(target_os = "macos", target_os = "ios"))] {
53 | |         use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION;
54 | |     } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "haiku"))] {
...  |
58 | |     }
59 | | }
   | |_^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0425]: cannot find value `MSG_NOSIGNAL` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:408:21
    |
408 |                     MSG_NOSIGNAL,
    |                     ^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `MSG_NOSIGNAL` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:422:21
    |
422 |                     MSG_NOSIGNAL,
    |                     ^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `IPV6_ADD_MEMBERSHIP` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:628:54
    |
628 |         unsafe { self.setsockopt(libc::IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, mreq) }
    |                                                      ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `IPV6_DROP_MEMBERSHIP` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:647:54
    |
647 |         unsafe { self.setsockopt(libc::IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, mreq) }
    |                                                      ^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `KEEPALIVE_OPTION` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:707:66
    |
707 |             let secs: c_int = self.getsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION)?;
    |                                                                  ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `KEEPALIVE_OPTION` in this scope
   --> /Users/crocus/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sys/unix.rs:721:52
    |
721 |                 self.setsockopt(libc::IPPROTO_TCP, KEEPALIVE_OPTION, dur.as_secs() as c_int)?;
    |                                                    ^^^^^^^^^^^^^^^^ not found in this scope

error: aborting due to 9 previous errors

For more information about this error, try `rustc --explain E0425`.
error: could not compile `socket2`.

from socket2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.