diff options
| author | bors <bors@rust-lang.org> | 2020-08-23 16:59:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-23 16:59:10 +0000 |
| commit | d02a209eb946929801882d884b459f438d9650d2 (patch) | |
| tree | 5709406a25ae340a0037faa7ff2c69079a9551fe /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | 9d606d939a61c2f4c7bb4d89d959b60a53f50241 (diff) | |
| parent | cf76256b83d7ccbf1d673c4bcb3ad0d1bd904315 (diff) | |
| download | rust-d02a209eb946929801882d884b459f438d9650d2.tar.gz rust-d02a209eb946929801882d884b459f438d9650d2.zip | |
Auto merge of #75028 - MrModder:master, r=steveklabnik
Document that slice refers to any pointer type to a sequence I was recently confused about the way slices are represented in memory. The necessary information was not available in the std-docs directly, but was a mix of different material from the reference and book. This PR should clear up the definition of slices a bit more in the documentation. Especially the fact that the term slice refers to the pointer/reference type, e.g. `&[T]`, and not `[T]`. It also documents that slice pointers are twice the size of pointers to `Sized` types, as this concept may be unfamiliar to users coming from other languages that do not have the concept of "fat pointers" (especially C/C++). I've documented why this was important to me and my findings in [this blog post](https://codecrash.me/understanding-rust-slices). r? @lcnr
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
