rust/tests/ui/suggestions/non_copy_move_out_of_tuple.rs
2025-09-22 22:02:24 +02:00

9 lines
214 B
Rust

// Regression test for #146537.
struct NonCopy;
fn main() {
let tuple = &(NonCopy,);
let b: NonCopy;
(b,) = *tuple; //~ ERROR: cannot move out of `tuple.0` which is behind a shared reference [E0507]
}