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

Fully qualified std::result::Result in macro #1587

Merged
merged 3 commits into from
May 25, 2020

Conversation

ureeves
Copy link
Contributor

@ureeves ureeves commented May 23, 2020

Currently writing code where one defines a type alias named Result combined with a type that uses #[derive(NetworkBehaviour)] sometimes leads to E0107.

type Result<T> = std::result::Result<T, Error>;
struct Error {}

#[derive(NetworkBehaviour)]
struct Behaviour<TStore> {
    mdns: Mdns,
    kad: Kademlia<TStore>,
}

// NetworkBehaviourEventProcess implementations...
   --> src/lib.rs:223:10
    |
223 | #[derive(NetworkBehaviour)]
    |          ^^^^^^^^^^^^^^^^ unexpected type argument
    |
    = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

In my estimation this happens due to the use of Result in the definition of the NetworkBehaviour macro. Using the fully qualified name std::result::Result fixes this issue.

@mxinden
Copy link
Member

mxinden commented May 25, 2020

Retriggered pipeline as I doubt intra-doc-link failure is related to this change set.

@ureeves
Copy link
Contributor Author

ureeves commented May 25, 2020

The intra-doc-link check was succeeding at first, but the "Build and test" check was failing due to cancellation (taking too long).

After looking at the normal run time for this check (~11m) and taking into account that it builds just fine after change, I can only assume that something in the environment running the pipeline is making the tests take too long.

Maybe I'm looking at it wrong but it seems too small a change to cause this.

edit: Nevermind, looks like it's due to #1588

@tomaka tomaka merged commit 93ff335 into libp2p:master May 25, 2020
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 this pull request may close these issues.

4 participants