Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions repr-stabby.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Note that unbits can never overlap with a forbidden value.
Unit types have size 0, alignment 1, and no niches.

### Boolean
`bool` is a single byte type, where all values that aren't `0` represents `false`, `1` represents `true`, and all other values are forbidden.
`bool` is a single byte type, `0` represents `false`, `1` represents `true`, and all other values are forbidden.

### Pointers and references
Pointers are considered nullables, whereas references are non-null types (`[0; size_of_ptr]` is their only forbidden value)
Expand Down Expand Up @@ -107,4 +107,4 @@ def determinant(Ok, Err) -> (Determinant, int, int, Unbits):
# Future possibilities
At the moment, `Result<Ok, Err>` never has any forbidden values left, even if `Ok` had multiple fvs that could fit in `Err`'s unbits. This means that `Option<Option<bool>>` occupies 2 bytes, instead of 1 as it does with Rust's current layout.

Since extracting only the correct FV from FVs can be complex to implement in computation contexts such as Rust's trait-solver, the choice was made not to do it. Should this become feasible, a release process will have to be designed. If you implement `#[repr(stabby)]`, please [file an issue on `stabby`'s original repository'](https://github.com/ZettaScaleLabs/stabby/issues/new) to be notified.
Since extracting only the correct FV from FVs can be complex to implement in computation contexts such as Rust's trait-solver, the choice was made not to do it. Should this become feasible, a release process will have to be designed. If you implement `#[repr(stabby)]`, please [file an issue on `stabby`'s original repository'](https://github.com/ZettaScaleLabs/stabby/issues/new) to be notified.