Pinned shims/os_str.rs. Host OsStr encodings remain explicit operational leaves; they are not replaced with Lean UTF-8 strings. Allocation size follows the source encoded-byte length even for UTF-16 output. Path conversion itself is implemented on exact code units, preserving invalid non-Unicode paths.
Instances For
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- hostWindows : Bool
- hostUnix : Bool
- targetWindows : Bool
- fromUnixBytes : ByteArray → Os
OsStr::from_bytes / OsString::from_vec on the actual Unix host.
std::str::from_utf8 then OsStr::new, retaining invalid-UTF8 unsupported.
Windows from_wide is lossless; other hosts use strict String::from_utf16.
Windows encode_wide; other hosts require valid UTF8 then encode_utf16.
- encodedBytes : Os → ByteArray
- encodedLength : Os → Nat
- readCString : Memory.Pointer (Option P) → M S ByteArray
- readWideString : Memory.Pointer (Option P) → M S (Array UInt16)
- arrayLayout : Bool → UInt64 → M S LocalLayout
Actual Ty::new_array(u8/u16,count) and layout_of, including runtime type interning; a matching byte layout cannot substitute a fabricated type ID.
- allocate : LocalLayout → Kind → M S (Memory.Pointer (Option P))
Instances For
Unix OsString::into_string: consume the exact encoded bytes and return
the string only when they form valid UTF-8. This is distinct from lossy display
conversion and is the operation used by Miri's localtime_r for guest TZ.
Equations
Instances For
Equations
- Miri.Interpreter.OsStrings.unixIntoStringOf encodedBytes value = Miri.Interpreter.OsStrings.unixIntoString (encodedBytes value)
Instances For
Equations
- Miri.Interpreter.OsStrings.readOsString h pointer = do let __do_lift ← h.readCString pointer Miri.Interpreter.OsStrings.lift✝ (Miri.Interpreter.OsStrings.bytesToOsStr h __do_lift)
Instances For
Equations
- Miri.Interpreter.OsStrings.readOsWideString h pointer = do let __do_lift ← h.readWideString pointer Miri.Interpreter.OsStrings.lift✝ (h.fromWide __do_lift)
Instances For
Equations
- Miri.Interpreter.OsStrings.writeOsString h value pointer capacity = h.writeCString (h.encodedBytes value) pointer capacity
Instances For
Return the original failed/full length result even after successfully writing the truncated prefix, exactly as the source helper does.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source uses encoded OsStr length for both arrays, before conversion to UTF-16. Its unwrap/assert failure occurs after the actual allocation effects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.