-
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
Drop tracking misses variables consumed in let statements #93674
Comments
Thanks for the test case! I moved this to the On Deck board. I should be able to get to it this week, but I'll leave it unclaimed in case someone else wants to get there first. @rustbot label +AsyncAwait-Triaged +AsyncAwait-Polish |
Error: Label AsyncAwait-Triaged can only be set by Rust team members Please let |
@rustbot label +AsyncAwait-Triaged +AsyncAwait-Polish |
Ok I think I am missing some context here, and do not have the error that was discussed So with the following example #![feature(generators)]
#![feature(negative_impls)]
struct NotSend;
impl !Send for NotSend {}
fn assert_send<T: Send>(_: T) {}
fn main() {
// Fails:
assert_send(|| {
let a = NotSend;
let b = a; // a should be consumed here
drop(b);
yield;
});
// Succeeds:
assert_send(|| {
let a;
a = NotSend;
let b;
b = a;
drop(b);
yield;
});
} The error generated is the following on with the commit 136d74f
@rustbot claim |
Mh looking at the error looks like the following help message is wrong?
|
Note that the drop tracking is gated by The test case was fixed by |
For example when compiling with nightly-2022-01-22 (which included drop tracking):
This seems to be a mismatch between
record_consumed_borrow::ExprUseDelegate
which records a consume ofa
but associates it with a let statementlet b = a;
, whilecfg_build::DropRangeVisitor
considers only variables consumed by expressions.The text was updated successfully, but these errors were encountered: