about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-28 04:12:10 +0200
committerGitHub <noreply@github.com>2022-03-28 04:12:10 +0200
commitd88c03c0f1082d01294ef8cf5d14194d5d1284fa (patch)
tree91b2749c2c48105b5eea3f9b5222d444352e0271 /compiler/rustc_codegen_llvm/src
parent6ed1a67b3805bdea306ee055e035e298f92a10e4 (diff)
parent80340f62fee46c1ac5ea787e4dcbe553c6abd41a (diff)
downloadrust-d88c03c0f1082d01294ef8cf5d14194d5d1284fa.tar.gz
rust-d88c03c0f1082d01294ef8cf5d14194d5d1284fa.zip
Rollup merge of #95016 - janpaul123:patch-1, r=dtolnay
Docs: make Vec::from_raw_parts documentation less strict

This is my first PR; be gentle!

In https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/2?u=janpaul123 it was suggested to me that I should make a PR to make the documentation of `Vec::from_raw_parts` less strict, since we don't require `T` to have the same size, just `size_of::<T>() * capacity` to be the same, since that is what results in `Layout::size` being the same in `dealloc`, which is really what matters.

Also in https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/8?u=janpaul123 it was suggested that it's better to use `slice::from_raw_parts`, which I think is useful advise that could also be mentioned in the docs, so I added that too.

Let me know what you think! :)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions