Skip to content
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

Niches #3334

Closed
wants to merge 49 commits into from
Closed

Niches #3334

Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e62830c
Niches
joshtriplett Oct 23, 2022
2947255
Niche is RFC 3334
joshtriplett Oct 23, 2022
26b01d6
Forbid structs with generic parameters affecting the non-ZST field
joshtriplett Oct 23, 2022
f1b671a
Fix typo
joshtriplett Oct 23, 2022
74fee72
Further clarify the non-guarantees about multiple niche values
joshtriplett Oct 23, 2022
ae13802
Further clarify non-support for negative values at this time
joshtriplett Oct 23, 2022
ae3671a
Specify two's-complement specifically
joshtriplett Oct 23, 2022
f4b0631
Discuss mapping to unsigned integer representation
joshtriplett Oct 23, 2022
132d1f8
Alternatives: Add pattern-based syntax
joshtriplett Oct 23, 2022
7a1b2e4
Reorder some of the reference-level explanation to group similar things
joshtriplett Oct 23, 2022
422dcd9
Further clarify round-trip via bytes
joshtriplett Oct 23, 2022
825d29c
Add note about `non_exhaustive`.
joshtriplett Oct 23, 2022
1a36e03
Drop support for having ZST fields
joshtriplett Oct 24, 2022
ffd1965
Add future possibility of structs with ZST fields
joshtriplett Oct 24, 2022
9816724
Guarantee that adding a niche doesn't change storage size
joshtriplett Oct 24, 2022
ca5970e
Only allow simple field types
joshtriplett Oct 24, 2022
eaf6327
Future possibilities: fields of reference type
joshtriplett Oct 24, 2022
bb5b5b9
Future possibilities: mention interaction with read-only fields
joshtriplett Oct 24, 2022
93d4707
Consistently use "struct" rather than "structure"
joshtriplett Oct 24, 2022
4559ee9
Future possibilities: change `derive(TryInto)` to `derive(TryFrom)`
joshtriplett Oct 24, 2022
5b03ea2
Add language to reference section about unsafe vs safe operations
joshtriplett Oct 24, 2022
b8bcfda
Add information to the guide-level section on typical operations
joshtriplett Oct 24, 2022
c3c6154
Consistently use "niche" rather than "invalid" except when explaining…
joshtriplett Oct 24, 2022
bb1a8ec
Future possibilities: safe writes of compile-time constants
joshtriplett Oct 24, 2022
ad9bf34
Clarify language regarding compile-time constants and verification
joshtriplett Oct 24, 2022
f16a730
Explicitly allow `niche` to appear inside `cfg_attr`
joshtriplett Oct 24, 2022
ee9359f
Alternatives: Add detailed discussion of niche-on-field vs niche-on-s…
joshtriplett Oct 24, 2022
08bb5b4
Explicitly allow inclusive and exclusive ranges
joshtriplett Oct 24, 2022
77069e6
Note that the compiler may be able to perform additional optimizations
joshtriplett Oct 24, 2022
58d3b9e
Discuss pattern matching
joshtriplett Oct 24, 2022
d5966c6
Explicitly allow open-ended ranges.
joshtriplett Oct 24, 2022
c18bee3
Future possibilities: add niches affecting pattern-matching exhaustiv…
joshtriplett Oct 24, 2022
627df7f
Explicitly allow construction or writing from `const` code
joshtriplett Oct 24, 2022
5109f44
Note that `#[niche(...)]` would be forward-compatible with a pattern …
joshtriplett Oct 24, 2022
f77eb45
Discuss interaction with `derive(Default)`
joshtriplett Oct 24, 2022
5965de8
Note that a `derive(TryFrom)` would also avoid duplicating the range
joshtriplett Oct 24, 2022
811024a
Mention C and C++ bitfields
joshtriplett Oct 24, 2022
014d504
Note why we don't support `bool`
joshtriplett Oct 24, 2022
4856096
Add Ada as precedent
joshtriplett Oct 24, 2022
bb38342
Discuss how we can handle `derive(Default)`
joshtriplett Oct 24, 2022
c20796c
Explicitly conflict with `repr(packed)`
joshtriplett Oct 24, 2022
7f27700
Alternative regarding `derive(Default)`
joshtriplett Oct 24, 2022
b8e0397
Discuss mutable references in more detail
joshtriplett Oct 24, 2022
48d1c22
s/primitive integer type/built-in integer type/
joshtriplett Oct 25, 2022
6cf4c4e
s/either zero or one/at most one/
joshtriplett Oct 25, 2022
a011965
Clarify what else adding a niche *doesn't* change (alignment, other A…
joshtriplett Oct 25, 2022
ea1bd10
Remove a resolved question
joshtriplett Oct 25, 2022
5358cb5
Rework the RFC to use values of the field type: negative numbers and …
joshtriplett Oct 25, 2022
08244e0
Rephrase descriptions of ranges
joshtriplett Oct 26, 2022
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
Loading