Skip to content

Fixed a wrong word #369

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rust-2024/match-ergonomics.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In Rust 2021 and earlier editions, we allow this oddity:
let [x, mut y] = &[(), ()]; // x: &(), mut y: ()
```

Here, because we pass the shared reference in the pattern, the default binding mode switches to `ref`. But then, in these editions, writing `mut` on the binding resets the default binding mode to `move`.
Here, because we pass the shared reference in the scrutinee, the default binding mode switches to `ref`. But then, in these editions, writing `mut` on the binding resets the default binding mode to `move`.

This can be surprising as it's not intuitive that mutability should affect the type.

Expand Down