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] add return locations to source map #19885

Conversation

jordanjennings-mysten
Copy link
Contributor

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Oct 16, 2024

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 10:36pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2024 10:36pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2024 10:36pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2024 10:36pm

Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Overall looks great to me modulo the comments on naming. Once that's fixed though you're good to land :)

@@ -47,6 +47,11 @@ macro_rules! record_src_loc {
.source_map
.add_parameter_mapping($context.current_function_definition_index(), source_name)?;
}};
(_return: $context:expr, $_type:expr) => {{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'd probably use return_ here. We usually have the convention of "suffix _ to shadow a keyword" and "prefix _ to mean an unused or ignored variable".

@@ -907,6 +914,9 @@ fn compile_function_body_impl(
for (var, _) in ast_function.signature.formals.into_iter() {
record_src_loc!(parameter: context, var)
}
for _type in ast_function.signature.return_type.into_iter() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Same thing here on using a suffix _ for this variable name.

@@ -1726,6 +1741,9 @@ fn compile_function_body_bytecode(
function_frame.define_local(&var.value, sig.clone())?;
record_src_loc!(parameter: context, var);
}
for _type in return_type {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto here on naming.

@jordanjennings-mysten jordanjennings-mysten merged commit 6d87bd2 into MystenLabs:main Oct 16, 2024
46 checks passed
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