Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust 2018 #13

Open
Byter09 opened this issue Dec 13, 2018 · 2 comments · May be fixed by #15
Open

Rust 2018 #13

Byter09 opened this issue Dec 13, 2018 · 2 comments · May be fixed by #15

Comments

@Byter09
Copy link

Byter09 commented Dec 13, 2018

Hello.

I wanted to write a small tool to calculate something distributed on a master with slaves and learn more about Rust on the way. Having a simple transport layer with the help of protocol seemed like a good way. I'm using rustc 1.31.0 (abe02cefd 2018-12-04) and am currently getting this error:

error[E0107]: wrong number of type arguments: expected 0, found 2                                                                                                                                                                       
 --> src/network.rs:4:10                                                                                                                                                                                                                
  |                                                                                                                                                                                                                                     
4 | #[derive(Protocol, Debug, PartialEq)]                                                                                                                                                                                               
  |          ^^^^^^^^ 2 unexpected type arguments                                                                                                                                                                                       

I'm trying to use this on:

#[derive(Protocol, Debug, PartialEq)]
pub enum Message {
    RequestRegistration,
    Register(Registration),
    Job(Job),
    Result(Job, Result),
    RequestStatus,
    Status(Status),
}

Sadly the error is not very helpful in explaining what exactly I'm doing wrong but I highly suggest it has to do with Rust 2018, because the examples still use extern crate and #[macro_use]. Also there's no edition = "2018" in the Cargo.toml.

Any help on this is very appreciated. I don't think there's any other crate that can do what procotol suggests it can do this easily.

@Byter09
Copy link
Author

Byter09 commented Dec 15, 2018

Update: I just forked protocol, upgraded it manually to Rust 2018 and tried to use the git version in my little project. Turns out the error is still there and I still have no clue what it means. 😕

@pzmarzly
Copy link

pzmarzly commented Apr 6, 2019

Have you tried not using Result in there? It's signature is Result<T, E> (type, error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants