-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Dont ICE when computing coverage of synthetic async closure body #131802
Conversation
tests/coverage/async_closure.rs
Outdated
@@ -0,0 +1,16 @@ | |||
#![feature(coverage_attribute)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: #![feature(coverage_attribute)]
isn't needed here, as there are no #[coverage(..)]
attributes in the source.
Thanks. I don't know much about async closures (or feedable queries), but this looks like a reasonable workaround. Other than the nit, there's one thing missing: The new test needs to be blessed again with r=me when that's done. |
@rustbot author |
2b22a19
to
cdbf28a
Compare
Rollup of 9 pull requests Successful merges: - rust-lang#130136 (Partially stabilize const_pin) - rust-lang#131755 (Regression test for AVR `rjmp` offset) - rust-lang#131774 (Add getentropy for RTEMS) - rust-lang#131802 (Dont ICE when computing coverage of synthetic async closure body) - rust-lang#131809 (Fix predicate signatures in retain_mut docs) - rust-lang#131858 (Remove outdated documentation for `repeat_n`) - rust-lang#131866 (Avoid use imports in `thread_local_inner!`) - rust-lang#131874 (Default to the medium code model on OpenHarmony LoongArch target) - rust-lang#131877 (checktools.sh: add link to issue for more context about disabled Miri tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131802 - compiler-errors:fnonce-coverage, r=Zalathar Dont ICE when computing coverage of synthetic async closure body I'm not totally certain if this is *right*, but at least it doesn't ICE. The issue is that we end up generating two MIR bodies for each async closure, since the `FnOnce` and `Fn`/`FnMut` implementations have different borrowing behavior of their captured variables. They should ideally both contribute to the coverage, since those MIR bodies are (*to the user*) the same code and should have no behavioral differences. This PR at least suppresses the ICEs, and then I guess worst case we can fix this the right way later. r? Zalathar or re-roll Fixes rust-lang#131190
I'm not totally certain if this is right, but at least it doesn't ICE.
The issue is that we end up generating two MIR bodies for each async closure, since the
FnOnce
andFn
/FnMut
implementations have different borrowing behavior of their captured variables. They should ideally both contribute to the coverage, since those MIR bodies are (to the user) the same code and should have no behavioral differences.This PR at least suppresses the ICEs, and then I guess worst case we can fix this the right way later.
r? Zalathar or re-roll
Fixes #131190