diff --git a/compiler/rustc_error_codes/src/error_codes/E0508.md b/compiler/rustc_error_codes/src/error_codes/E0508.md index 33572fca6a3e8..91865907bf271 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0508.md +++ b/compiler/rustc_error_codes/src/error_codes/E0508.md @@ -39,3 +39,16 @@ fn main() { let _value = array[0].clone(); } ``` + +If you really want to move the value out, you can use a destructuring array +pattern to move it: + +``` +struct NonCopy; + +fn main() { + let array = [NonCopy; 1]; + // Destructuring the array + let [_value] = array; +} +```