Skip to content
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

[move 2024] let mut #14184

Merged
merged 7 commits into from
Oct 12, 2023
Merged

[move 2024] let mut #14184

merged 7 commits into from
Oct 12, 2023

Conversation

tnowacki
Copy link
Contributor

Description

  • mut modifier on variable declarations is not required for Move 2024
  • Unused mut modifiers are reported
  • Added S { mut f } punning for variable declarations with unpack

Test Plan

  • Added tests

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Move 2024.alpha now requires mut on local variables that are assigned or borrowed mutably. This is done on local variable declarations, e.g. let mut x = 0. And can also be done when field punning, e.g. let S { mut f } = s;

@vercel
Copy link

vercel bot commented Oct 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2023 4:58pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2023 4:58pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Oct 12, 2023 4:58pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 12, 2023 4:58pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 12, 2023 4:58pm

Copy link
Contributor

@cgswords cgswords left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, module a small implementation nit around representation for legacy code paths and some small questions about representation for improved readability. Thanks for getting it in!

Comment on lines +2573 to +2575
let supports_let_mut = context
.env
.supports_feature(context.current_package, FeatureGate::LetMut);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@tnowacki tnowacki merged commit f318f7a into MystenLabs:main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants