You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description
In #4067, there was a discussion about a falsely Clippy warning clippy::semicolon_if_nothing_returned in tokio's main and test.
Most problems were solved in #4176.
However, I encountered some leftovers that still pose the same problem.
Checking playground v0.0.1 (/playground)
warning: this import is redundant
--> src/main.rs:3:1
|
3 | use tokio; // 1.13.0
| ^^^^^^^^^^ help: remove it entirely
|
= note: #[warn(clippy::single_component_path_imports)] on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
warning: consider adding a ; to the last statement for consistent formatting
--> src/main.rs:11:5
|
11 | let _foo = foo().await;
| ^^^^^^^^^^^^^^^^^^^^^^^ help: add a ; here: let _foo = foo().await;;
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(clippy::semicolon_if_nothing_returned)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
warning: playground (bin "playground") generated 2 warnings
Finished dev [unoptimized + debuginfo] target(s) in 2.09s
My current state of investigation is, that this problem arises when ….async; is the last command in the function that is rewritten by tokio's main or test.
An expansion brings the following output:
#![feature(prelude_import)]#![warn(clippy::semicolon_if_nothing_returned)]#[prelude_import]use std::prelude::rust_2021::*;#[macro_use]externcrate std;use tokio;asyncfnfoo() -> &'staticstr{"foo"}fnmain(){let body = async{let _foo = foo().await;};#[allow(clippy::expect_used)]
tokio::runtime::Builder::new_multi_thread().enable_all().build().expect("Failed building the Runtime").block_on(body)}
So, the semicolon is missing here. But if ….async; isn't the last expression, then there is a ;.
The text was updated successfully, but these errors were encountered:
ChristianBeilschmidt
changed the title
Still wrong clippy error after macros: fix wrong error messages #4067
Still clippy warning after macros: fix wrong error messages #4067Nov 18, 2021
425: Build-rs r=jdroenner a=ChristianBeilschmidt
I did the following things:
1. Removed `anyhow` from our build-dependencies and just unwrapped the result in the `build.rs` file.
2. Clippy wanted to add #[must_use] labels to functions that take `&self` and return `Self`. This makes sense since not using would mean you did something wrong.
3. The arrow example was not working anymore 🤷. I changed the pointer cast. Fortunately, it seems that our in-code conversions still work.
4. I updated `tokio` and could remove some Clippy lint exclusions (`// TODO: remove when tokio-rs/tokio#4245 is fixed`).
5. I updated Actix-web and they removed `AnyBody`. This means I had to wrap our error handler differently. You now have to put it into an EitherBody-enum and this takes a BoxBody. So I had to call `boxed()` here as well. Please check that the HTTP responses still work, for me, it looks fine.
Co-authored-by: Christian Beilschmidt <[email protected]>
Version
1.13.0
Platform
Linux 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description
In #4067, there was a discussion about a falsely Clippy warning
clippy::semicolon_if_nothing_returned
in tokio's main and test.Most problems were solved in #4176.
However, I encountered some leftovers that still pose the same problem.
I could reproduce it in Rust Playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=39638811ab983f5bea782a42d5d184b9
The output of Clippy is
My current state of investigation is, that this problem arises when
….async;
is the last command in the function that is rewritten by tokio's main or test.An expansion brings the following output:
So, the semicolon is missing here. But if
….async;
isn't the last expression, then there is a;
.The text was updated successfully, but these errors were encountered: