diff options
Diffstat (limited to 'tests/crashes')
-rw-r--r-- | tests/crashes/109812.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/crashes/109812.rs b/tests/crashes/109812.rs new file mode 100644 index 00000000000..c29b8746521 --- /dev/null +++ b/tests/crashes/109812.rs @@ -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; + }); +} |