mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
2229: Handle update to capture kind properly
This commit is contained in:
parent
ef52471066
commit
fbd775ff29
@ -400,6 +400,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
};
|
||||
|
||||
capture_info.capture_kind = capture_kind;
|
||||
let capture_info = if let Some(existing) = processed.get(&place) {
|
||||
determine_capture_info(*existing, capture_info)
|
||||
} else {
|
||||
capture_info
|
||||
};
|
||||
processed.insert(place, capture_info);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
// edition:2021
|
||||
// run-pass
|
||||
|
||||
|
||||
fn solve<F>(validate: F) -> Option<u64>
|
||||
where
|
||||
F: Fn(&mut [i8; 1]),
|
||||
{
|
||||
let mut position: [i8; 1] = [1];
|
||||
Some(0).map(|_| {
|
||||
validate(&mut position);
|
||||
let [_x] = position;
|
||||
0
|
||||
})
|
||||
}
|
||||
|
||||
fn main() {
|
||||
solve(|_| ());
|
||||
}
|
Loading…
Reference in New Issue
Block a user