diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-21 14:34:12 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-22 14:28:48 +0200 |
| commit | a27f3e3fd1e4d16160f8885b6b06665b5319f56c (patch) | |
| tree | b033935392cbadf6f85d2dbddf433a88e323aeeb /tests/codegen/slice-split-at.rs | |
| parent | ed93c1783b404d728d4809973a0550eb33cd293f (diff) | |
| download | rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.tar.gz rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.zip | |
Rename `tests/codegen` into `tests/codegen-llvm`
Diffstat (limited to 'tests/codegen/slice-split-at.rs')
| -rw-r--r-- | tests/codegen/slice-split-at.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/codegen/slice-split-at.rs b/tests/codegen/slice-split-at.rs deleted file mode 100644 index 07018cf9c91..00000000000 --- a/tests/codegen/slice-split-at.rs +++ /dev/null @@ -1,24 +0,0 @@ -//@ compile-flags: -Copt-level=3 -#![crate_type = "lib"] - -// Check that no panic is generated in `split_at` when calculating the index for -// the tail chunk using `checked_sub`. -// -// Tests written for refactored implementations of: -// `<[T]>::{split_last_chunk, split_last_chunk_mut, last_chunk, last_chunk_mut}` - -// CHECK-LABEL: @split_at_last_chunk -#[no_mangle] -pub fn split_at_last_chunk(s: &[u8], chunk_size: usize) -> Option<(&[u8], &[u8])> { - // CHECK-NOT: panic - let Some(index) = s.len().checked_sub(chunk_size) else { return None }; - Some(s.split_at(index)) -} - -// CHECK-LABEL: @split_at_mut_last_chunk -#[no_mangle] -pub fn split_at_mut_last_chunk(s: &mut [u8], chunk_size: usize) -> Option<(&mut [u8], &mut [u8])> { - // CHECK-NOT: panic - let Some(index) = s.len().checked_sub(chunk_size) else { return None }; - Some(s.split_at_mut(index)) -} |
