For example when compiling with nightly-2022-01-22 (which included drop tracking):
#![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;
});
}
This seems to be a mismatch between record_consumed_borrow::ExprUseDelegate which records a consume of a but associates it with a let statement let b = a;, while cfg_build::DropRangeVisitor considers only variables consumed by expressions.
For example when compiling with nightly-2022-01-22 (which included drop tracking):
This seems to be a mismatch between
record_consumed_borrow::ExprUseDelegatewhich records a consume ofabut associates it with a let statementlet b = a;, whilecfg_build::DropRangeVisitorconsiders only variables consumed by expressions.