diff options
| author | bors <bors@rust-lang.org> | 2018-07-22 18:51:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-22 18:51:46 +0000 |
| commit | 3b7720399a9006d9d7b89c251fa37ead46f9db7a (patch) | |
| tree | 893229ffba03c1f5b454d36ae07257ccf1a75d5c /src/liballoc/tests | |
| parent | 32772fddd52013a38ece584279b6bc422b2d8b9b (diff) | |
| parent | b954d4d1b5a97cf9c13929a742e81035f3158440 (diff) | |
| download | rust-3b7720399a9006d9d7b89c251fa37ead46f9db7a.tar.gz rust-3b7720399a9006d9d7b89c251fa37ead46f9db7a.zip | |
Auto merge of #52616 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests Successful merges: - #51807 (Deprecation of str::slice_unchecked(_mut)) - #52051 (mem::swap the obvious way for types smaller than the SIMD optimization's block size) - #52465 (Add CI test harness for `thumb*` targets. [IRR-2018-embedded]) - #52507 (Reword when `_` couldn't be inferred) - #52508 (Document that Unique::empty() and NonNull::dangling() aren't sentinel values) - #52521 (Fix links in rustdoc book.) - #52581 (Avoid using `#[macro_export]` for documenting builtin macros) - #52582 (Typo) - #52587 (Add missing backtick in UniversalRegions doc comment) - #52594 (Run the error index tool against the sysroot libdir) - #52615 (Added new lines to .gitignore.)
Diffstat (limited to 'src/liballoc/tests')
| -rw-r--r-- | src/liballoc/tests/str.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs index 75306ac82df..6275c7bb112 100644 --- a/src/liballoc/tests/str.rs +++ b/src/liballoc/tests/str.rs @@ -177,9 +177,9 @@ fn test_join_for_different_lengths_with_long_separator() { #[test] fn test_unsafe_slice() { - assert_eq!("ab", unsafe {"abc".slice_unchecked(0, 2)}); - assert_eq!("bc", unsafe {"abc".slice_unchecked(1, 3)}); - assert_eq!("", unsafe {"abc".slice_unchecked(1, 1)}); + assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)}); + assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)}); + assert_eq!("", unsafe {"abc".get_unchecked(1..1)}); fn a_million_letter_a() -> String { let mut i = 0; let mut rs = String::new(); @@ -200,7 +200,7 @@ fn test_unsafe_slice() { } let letters = a_million_letter_a(); assert_eq!(half_a_million_letter_a(), - unsafe { letters.slice_unchecked(0, 500000)}); + unsafe { letters.get_unchecked(0..500000)}); } #[test] |
