Skip to content

Commit

Permalink
add test for rust-lang#109812
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 28, 2024
1 parent c968b8b commit c32e2fe
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/crashes/109812.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ known-bug: #109812

#![warn(rust_2021_incompatible_closure_captures)]

enum Either {
One(X),
Two(X),
}

struct X(Y);

struct Y;

fn move_into_fnmut() {
let x = X(Y);

consume_fnmut(|| {
let Either::Two(ref mut _t) = x;

let X(mut _t) = x;
});
}

0 comments on commit c32e2fe

Please sign in to comment.