elast0ny / shared_memory

A Rust wrapper around native shared memory for Linux and Windows
380 stars 51 forks source link

Patern matching errors on linux #73

Closed Rayzeq closed 3 years ago

Rayzeq commented 3 years ago

Cargo version: 1.53.0 (also tried with 1.55.0-nightly) Rustc version: 1.53.0 (also tried with 1.55.0-nightly) Crate version: 0.11.4

When it compile the crate it throw these errors:

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
  --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:87:13
   |
87 |         Err(nix::Error::Sys(Errno::EEXIST)) => return Err(ShmemError::MappingIdExists),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
   |
   = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
  --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:88:13
   |
88 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::MapCreateFailed(e as u32)),
   |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
   |
   = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
   --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:103:13
    |
103 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::UnknownOsError(e as u32)),
    |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
    |
    = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
   --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:119:13
    |
119 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::MapCreateFailed(e as u32)),
    |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
    |
    = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
   --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:135:13
    |
135 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::MapOpenFailed(e as u32)),
    |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
    |
    = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
   --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:150:13
    |
150 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::MapOpenFailed(e as u32)),
    |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
    |
    = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
   --> /home/zacharie/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:166:13
    |
166 |         Err(nix::Error::Sys(e)) => return Err(ShmemError::MapOpenFailed(e as u32)),
    |             ^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
    |
    = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

error: aborting due to 7 previous errors
Rayzeq commented 3 years ago

I just saw that the lines are fixed in the repository, so the problem is now "Publish to crates.io" I think.

phsieh commented 3 years ago

I have the same problem as Rayzeq.

owen-hope commented 3 years ago

@Rayzeq @phsieh A temporary solution till the new changes get pushed to crates.io is to declare it as a git commit in your Cargo.toml file so it gets pulled from there and not crates.io. shared_memory = {git = "https://github.com/elast0ny/shared_memory-rs", rev = "4879c7641f64d444420b81fd32f496939ee7155d", package = "shared_memory"}

elast0ny commented 3 years ago

Version 12 is now published to crates.io