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

macros: fix wrong error messages #4067

Merged
merged 1 commit into from Aug 25, 2021

Commits on Aug 25, 2021

  1. macros: fix wrong error messages

    The macros `tokio::main` and `tokio::test` return invalid error
    messages if the function being wrapped has no return value. This was
    because the semicolon from the last statement was missing.
    
    Also, since version 0.1.54 (or earlier),
    `clippy::semicolon_if_nothing_returned` triggered false-negative when
    using the macros `tokio::test` and `tokio::main` on functions without
    a result type.
    
    We can copy the semicolon and the `return` keyword from the last
    statement from the body of the wrapped function.
    
    Fixes: rust-lang/rust-clippy#7438
    c0va23 committed Aug 25, 2021
    Copy the full SHA
    9990139 View commit details
    Browse the repository at this point in the history