Skip to content

Removed dup and drop as functions from the corelib.#9342

Merged
orizi merged 1 commit intomainfrom
orizi/12-25-removed_dup_and_drop_as_functions_from_the_corelib
Dec 29, 2025
Merged

Removed dup and drop as functions from the corelib.#9342
orizi merged 1 commit intomainfrom
orizi/12-25-removed_dup_and_drop_as_functions_from_the_corelib

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Dec 25, 2025

Summary

Removed dup and drop external functions from the core library and moved them to specific test modules where they are needed. Updated the function signatures to include trait constraints (+Copy<T> for dup and +Drop<T> for drop).


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The dup and drop functions were previously defined in the core library without proper trait constraints. This PR moves them to the specific test modules where they are actually used and adds the appropriate trait constraints (+Copy<T> for dup and +Drop<T> for drop), ensuring proper type safety and removing unnecessary dependencies from the core library.


What was the behavior or documentation before?

The dup and drop functions were defined in the core library without trait constraints, and were imported in the prelude. This created unnecessary dependencies and lacked proper type safety.


What is the behavior or documentation after?

The functions are now defined locally in the test modules where they are needed, with proper trait constraints. The core library and prelude no longer include these functions, making the code more modular and type-safe.


Additional context

This change helps to enforce proper trait constraints for operations that should only be allowed on types that implement specific traits (Copy for duplication and Drop for dropping).

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

orizi commented Dec 25, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@orizi orizi mentioned this pull request Dec 25, 2025
5 tasks
@orizi orizi marked this pull request as ready for review December 25, 2025 14:46
@orizi orizi force-pushed the orizi/12-25-removed_various_todos branch from fb98e09 to fe467e0 Compare December 25, 2025 16:12
@orizi orizi force-pushed the orizi/12-25-removed_dup_and_drop_as_functions_from_the_corelib branch from 5e988e6 to 368f80e Compare December 25, 2025 16:12
@orizi orizi mentioned this pull request Dec 27, 2025
5 tasks
Copy link
Collaborator

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@TomerStarkware reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eytan-starkware).

@orizi orizi changed the base branch from orizi/12-25-removed_various_todos to graphite-base/9342 December 28, 2025 15:13
@orizi orizi force-pushed the orizi/12-25-removed_dup_and_drop_as_functions_from_the_corelib branch from 368f80e to dc7c5a3 Compare December 28, 2025 15:14
@orizi orizi force-pushed the graphite-base/9342 branch from fe467e0 to f7b306f Compare December 28, 2025 15:14
@orizi orizi changed the base branch from graphite-base/9342 to main December 28, 2025 15:14
@orizi orizi added this pull request to the merge queue Dec 29, 2025
Merged via the queue into main with commit bfc73ba Dec 29, 2025
108 checks passed
@orizi orizi deleted the orizi/12-25-removed_dup_and_drop_as_functions_from_the_corelib branch December 29, 2025 09:03
Princetimix69 pushed a commit to Princetimix69/cairo that referenced this pull request Jan 5, 2026
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.

3 participants