-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add destructuring example of E0508 #86549
Conversation
This adds an example that destructures the array to move the value, instead of taking a reference or cloning.
(rust-highfive has picked a reviewer for you, use r? to override) |
``` | ||
struct NonCopy; | ||
|
||
fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally there is no need to wrap into a main
function but since it's already the case for the other examples, let's just skip it. ;)
r=me once CI pass. |
@bors: r+ rollup |
📌 Commit 9db5c48 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#86223 (Specify the kind of the item for E0121) - rust-lang#86521 (Add comments around code where ordering is important due for panic-safety) - rust-lang#86523 (Improvements to intra-doc link macro disambiguators) - rust-lang#86542 (Line numbers aligned with content) - rust-lang#86549 (Add destructuring example of E0508) - rust-lang#86557 (Update books) Failed merges: - rust-lang#86548 (Fix crate filter search reset) r? `@ghost` `@rustbot` modify labels: rollup
This adds an example that destructures the array to move the value, instead of taking a reference or cloning.