Skip to content

Conversation

@avorylli
Copy link
Contributor

Describe your changes

Make StackInputs and StackOutputs implement Copy trait since they are wrappers around [Felt; 16] which is Copy.

Changes:

  • Added Copy derive to StackInputs and StackOutputs structs
  • Removed redundant .clone() calls in 25 locations across the codebase
  • Updated method implementations to leverage automatic copying

Closes #2487

Reopen #2503

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Please add a line in the CHANGELOG.md

.with_library(&CoreLibrary::default())
.unwrap();
let stack_inputs = stack_inputs.clone();
let stack_inputs = stack_inputs;
Copy link
Contributor

Choose a reason for hiding this comment

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

this line is now a no-op since StackInputs is Copy. you could just delete it entirely.

@avorylli avorylli requested a review from huitseeker January 14, 2026 10:56
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

LGTM

@plafer
Copy link
Contributor

plafer commented Jan 14, 2026

Hey @avorylli we're blocked from merging this due a680daa not being signed

@bobbinth
Copy link
Contributor

There also appear to be some merge conflicts. @avorylli - would you be able to resolve them?

@avorylli
Copy link
Contributor Author

There also appear to be some merge conflicts. @avorylli - would you be able to resolve them?

@bobbinth I am not sure about it but I can try

@huitseeker huitseeker force-pushed the refactor/make-stack-inputs-outputs-copy branch 2 times, most recently from a37aedc to edaa754 Compare January 20, 2026 18:47
@huitseeker huitseeker force-pushed the refactor/make-stack-inputs-outputs-copy branch from edaa754 to ad18cf3 Compare January 20, 2026 18:47
@huitseeker huitseeker merged commit fdd2a14 into 0xMiden:next Jan 20, 2026
14 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.

refactor: Make StackInputs and StackOutputs Copy

4 participants