-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
P-tokenrequired for supporting P-token coderequired for supporting P-token code
Description
The from_utf8
function from Rust's stdlib is currently not included in our SMIR JSON because it is not polymorphic. This function is essential for UTF-8 string conversion and will be needed for proper string support in the system.
Current Situation
from_utf8
is a non-polymorphic stdlib function (source)- The function internally uses
transmute
(visible in the_unchecked
version) - String support is currently not implemented in the system
- Functions like
amount_to_ui_amount
andui_amount_to_amount
will require string support
Technical Details
The from_utf8
function performs UTF-8 validation and conversion from byte arrays to strings. Since it ultimately calls transmute
for the unsafe conversion, special handling may be required when implementing this in SMIR.
Tasks
- Analyze the special handling needed for
transmute
operations infrom_utf8
- Implement string type support in SMIR
- Add
from_utf8
function support - Update
amount_to_ui_amount
andui_amount_to_amount
to handle strings - Add appropriate test cases for string conversions
Priority
Low/Medium - Marked as non-urgent task, but will be required for full functionality
Related Components
- SMIR JSON serialization
- Standard library function support
- String type handling
- Functions:
amount_to_ui_amount
,ui_amount_to_amount
References
- Rust stdlib
from_utf8
source: https://doc.rust-lang.org/src/core/str/converts.rs.html#89
Labels
enhancement
, stdlib-support
, type-system
, non-urgent
Metadata
Metadata
Assignees
Labels
P-tokenrequired for supporting P-token coderequired for supporting P-token code