Remove Copy and Clone implementation on sensitive structure#83
Merged
LuernOutOfOrder merged 8 commits intodevelopfrom Jan 19, 2026
Conversation
…ct to avoid implicite copy
…it copy and improve sub-system design
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors several hardware driver modules and their associated tests to improve code safety, clarity, and maintainability. The main changes include removing unnecessary
CopyandClonetrait derivations from driver structs and enums, updating method signatures to use references for safer access, and refactoring test code to use constants and references instead of value copies. These changes help prevent accidental data duplication, clarify ownership semantics, and make the codebase more idiomatic and robust.Trait and Derivation Simplification
CopyandClonetrait derivations from various driver structs and enums, such asTrapFrame,CpuIntcDriver,CpuIntcHw,RiscVCpuIntc,SerialDeviceDriver,SerialDevice,Ns16550,Clint0,TimerType,TimerDeviceDriver, andTimerDevice. This enforces safer handling of these types and prevents unintended copying. [1] [2] [3] [4] [5] [6] [7] [8]API and Method Signature Updates
get_cpu_intc_core_id,timer_type, andget_primary_timer, improving safety and reducing unnecessary copies. [1] [2] [3]Test Code Refactoring
Code Safety and Idiomatic Improvements
Version Update
0.3.0to0.3.1inCargo.tomlto reflect the API and implementation changes.