about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-17 05:43:55 +0000
committerbors <bors@rust-lang.org>2021-01-17 05:43:55 +0000
commit49d7889da4b97b63f4d3e793a27b78a78326c1cd (patch)
tree0821d36d8180b6c6c2a2a43190f588ef4fd0c9c9 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent95cbcad920d602cb7319e819e7ebc3cf56c20cd7 (diff)
parent6bcaba9f51cc345435cb8fdf085fecda7eeeed61 (diff)
downloadrust-49d7889da4b97b63f4d3e793a27b78a78326c1cd.tar.gz
rust-49d7889da4b97b63f4d3e793a27b78a78326c1cd.zip
Auto merge of #78818 - scottmcm:as_rchunks, r=KodrAus
Add `as_rchunks` (and friends) to slices

`@est31` mentioned (https://github.com/rust-lang/rust/issues/76354#issuecomment-717027175) that, for completeness, there needed to be an `as_chunks`-like method that chunks from the end (with the remainder at the beginning) like `rchunks` does.

So here's a PR for `as_rchunks: &[T] -> (&[T], &[[T; N]])` and `as_rchunks_mut: &mut [T] -> (&mut [T], &mut [[T; N]])`.

But as I was doing this and copy-pasting `from_raw_parts` calls, I thought that I should extract that into an unsafe method.  It started out a private helper, but it seemed like `as_chunks_unchecked` could be reasonable as a "real" method, so I added docs and made it public.  Let me know if you think it doesn't pull its weight.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions