diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2020-10-10 00:25:28 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2020-10-10 00:56:45 +0300 |
| commit | 54a560833451324194b51e906c50a9122a3d97fc (patch) | |
| tree | 0e07283da9b76047ee06f60c5bed1eed1753bafb /src/test/codegen | |
| parent | 5ddef544fa26c5535376fa424baf30cb985f7cb1 (diff) | |
| download | rust-54a560833451324194b51e906c50a9122a3d97fc.tar.gz rust-54a560833451324194b51e906c50a9122a3d97fc.zip | |
Revert "Assume slice len is bounded by allocation size"
https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379 suggests that the original PR introduced a significant perf regression. This reverts commit e44784b8750016a695361c990024750e037d8f9f / #77023.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/len-is-bounded.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/test/codegen/len-is-bounded.rs b/src/test/codegen/len-is-bounded.rs deleted file mode 100644 index bb74fc3b275..00000000000 --- a/src/test/codegen/len-is-bounded.rs +++ /dev/null @@ -1,24 +0,0 @@ -// min-llvm-version: 11.0 -// compile-flags: -O -C panic=abort -#![crate_type = "lib"] - -#[no_mangle] -pub fn len_range(a: &[u8], b: &[u8]) -> usize { - // CHECK-NOT: panic - a.len().checked_add(b.len()).unwrap() -} - -#[no_mangle] -pub fn len_range_on_non_byte(a: &[u16], b: &[u16]) -> usize { - // CHECK-NOT: panic - a.len().checked_add(b.len()).unwrap() -} - -pub struct Zst; - -#[no_mangle] -pub fn zst_range(a: &[Zst], b: &[Zst]) -> usize { - // Zsts may be arbitrarily large. - // CHECK: panic - a.len().checked_add(b.len()).unwrap() -} |
