rust/library
Nadja Reitzenstein 23c608f3a1 Fix a technicality regarding the size of C's char type
Specifically, ISO/IEC 9899:2018 — better known as "C18" — (and at least
C11, C99 and C89) do not specify the size of `byte` in bits.
Section 3.6 defines "byte" as "addressable unit of data storage" while
section 6.2.5 ("Types") only defines "char" as "large enough to store
any member of the basic execution set" giving it a lower bound of 7 bit
(since there are 96 characters in the basic execution set).
With section 6.5.3.4 paragraph 4 "When sizeof is applied to an operant
that has type char […] the result is 1" you could read this as the size
of `char` in bits being defined as exactly the same as the number of
bits in a byte but it's also valid to read that as an exception.

In general implementations take `char` as the smallest unit of
addressable memory, which for modern byte-addressed architectures is
overwhelmingly 8 bits to the point of this convention being completely
cemented into just about all of our software.

So is any of this actually relevant at all? I hope not. I sincerely hope
that this never, ever comes up.
But if for some reason a poor rustacean is having to interface with C
code running on a Cray X1 that in 2003 is still doing word-addressed
memory with 64-bit words and they trust the docs here blindly it will
blow up in her face. And I'll be truly sorry for her to have to deal
with … all of that.
2021-09-20 08:19:13 +02:00
..
alloc refactor: VecDeques IntoIter fields to private 2021-09-17 21:46:32 +01:00
backtrace@cc89bb66f9 Update the backtrace crate 2021-09-15 20:32:35 +02:00
core Auto merge of #89031 - the8472:outline-once-cell-init-closure, r=Mark-Simulacrum 2021-09-19 08:05:45 +00:00
panic_abort Use C-unwind ABI for __rust_start_panic in panic_abort 2021-08-05 18:01:17 +08:00
panic_unwind STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
proc_macro Rollup merge of #86165 - m-ou-se:proc-macro-span-shrink, r=dtolnay 2021-09-10 08:23:14 -07:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Fix a technicality regarding the size of C's char type 2021-09-20 08:19:13 +02:00
stdarch@89b0e355bc Update the stdarch submodule 2021-08-24 09:02:44 -07:00
test don't clone types that are Copy (clippy::clone_on_copy) 2021-09-11 10:18:56 +02:00
unwind build llvm libunwind.a in rustbuild 2021-08-28 14:14:22 +08:00