-
Notifications
You must be signed in to change notification settings - Fork 0
no_std, regc tool, fix enum resolution, more safety #12
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds no_std support to the Rust RPI library, introduces a regc tool for working with RSF specs, and eliminates unwrap/expect calls from generated code for improved safety. The changes also fix enum resolution issues across modules and add support for descriptor registers.
- Converts the library to no_std for embedded compatibility
- Replaces fallible operations in generated code with proper error handling
- Restructures the codebase into a workspace with separate rust_rpi crate
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
rust_rpi/src/lib.rs | Adds no_std support and moves OutOfRange error definition inline |
rust_rpi/Cargo.toml | Creates new rust_rpi crate package definition |
lib/tests/codegen.rs | Updates test paths and adds checks to prevent unwrap/expect in generated code |
lib/test_data/nic_rpi.rs | Shows generated code changes with proper error handling instead of unwraps |
lib/src/rust_codegen.rs | Major refactoring to eliminate unwraps and improve enum handling |
lib/src/parser.rs | Improves error handling and updates test paths |
lib/src/model.rs | Refactors module path handling and improves type resolution |
lib/src/lib.rs | Removes unused modules from library exports |
lib/src/common.rs | Adds utility method for Component trait |
lib/src/ast.rs | Minor debug trait addition and test path updates |
lib/Cargo.toml | Creates lib crate package definition with workspace dependencies |
examples/nic.rsf | Updates enum width from 2 to 3 bits |
Readme.md | Documents new regc tool and primitive types |
Cargo.toml | Converts to workspace structure |
Comments suppressed due to low confidence (3)
rust_rpi/Cargo.toml:4
- Rust edition "2024" does not exist. The available editions are "2015", "2018", and "2021". This should be changed to "2021" which is the latest stable edition.
edition = "2024"
lib/Cargo.toml:4
- Rust edition "2024" does not exist. The available editions are "2015", "2018", and "2021". This should be changed to "2021" which is the latest stable edition.
edition = "2024"
Cargo.toml:8
- Rust edition "2024" does not exist. The available editions are "2015", "2018", and "2021". This should be changed to "2021" which is the latest stable edition.
edition = "2024"
no_std
support.regc
tool for checking/compiling/viewing RSF specs.