Skip to content
New issue

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

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

Already on GitHub? # to your account

libgreen sched::test_spawn_sched_blocking is unstable #11200

Closed
chris-morgan opened this issue Dec 29, 2013 · 1 comment · Fixed by #11204
Closed

libgreen sched::test_spawn_sched_blocking is unstable #11200

chris-morgan opened this issue Dec 29, 2013 · 1 comment · Fixed by #11204

Comments

@chris-morgan
Copy link
Member

Operating with a completely fresh build (git clean -fdx), the libgreen sched::test_spawn_sched_blocking test is sometimes hanging for me. (The other 24 tests in libgreen are successfully passing or being ignored, as appropriate.)

First of all I run make check and it hangs at that point. I kill it (^C) and try again and it passes.

$ rm -f tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-green.ok
$ make check-stage2-green

And it hangs. Kill and retry the make check-stage2-green, and it passes.

As long as I rm -f the .ok file before running make check-stage2-greenwhether or not that file exists—it fails, but if I then run make check-stage2-green again, it works again. The scary part is that this behaviour seems to be consistent, though that's ridiculous.

@alexcrichton
Copy link
Member

This also appears to have failed on the linux bot recently: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/2350/steps/test/logs/stdio

@bors bors closed this as completed in b5b570b Dec 30, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 31, 2023
[`unused_async`]: don't lint if paths reference async fn without immediate call

Fixes rust-lang#9695
Fixes rust-lang#9359

Clippy shouldn't lint unused `async` if there are paths referencing them if that path isn't the receiver of a function call, because that means that the function might be passed to some other function:
```rs
async fn f() {} // No await statements, so unused at this point

fn requires_fn_future<F: Future<Output = ()>>(_: fn() -> F) {}
requires_fn_future(f); // `f`'s asyncness is actually not unused.
```
(This isn't limited to just passing the function as a parameter to another function, it could also first be stored in a variable and later passed to another function as an argument)

This requires delaying the linting until post-crate and collecting path references to local async functions along the way.

changelog: [`unused_async`]: don't lint if paths reference async fn that require asyncness
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 3, 2024
Remove method call receiver special casing in `unused_async` lint

Fixes the false positive mentioned in rust-lang/rust-clippy#13466 (comment).

The false negative in the OP would be nice to fix too, but I'd rather do that in a separate PR because it's much more involved

Before this change, the `unused_async` lint would check if the async fn is also used anywhere and avoid linting if so. The exception is if the async function is immediately called, because the returned future handling can be easily removed (and also if we don't have some exceptions then the lint wouldn't trigger anywhere) *or* if it's a method call receiver.

I'm not exactly sure why I implemented that special casing for method call receivers in rust-lang#11200, but it doesn't make much sense in hindsight imo. Especially given that method calls are essentially equivalent to function calls with the receiver as the first argument, which was the primary motivation for not linting in the first place (async fn passed to another function, like `axum::get(handler)` where handler has to be an async fn).

changelog: none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants