We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bdac78 commit e9db8adCopy full SHA for e9db8ad
src/libcore/str.rs
@@ -479,6 +479,9 @@ impl TwoWaySearcher {
479
((haystack[self.position + needle.len() - 1] & 0x3f)
480
as uint)) & 1 == 0 {
481
self.position += needle.len();
482
+ if !long_period {
483
+ self.memory = 0;
484
+ }
485
continue 'search;
486
}
487
src/libcoretest/str.rs
@@ -26,6 +26,12 @@ fn strslice_issue_16589() {
26
check_contains_all_substrings("012345678901234567890123456789bcdabcdabcd");
27
28
29
+#[test]
30
+fn strslice_issue_16878() {
31
+ assert!(!"1234567ah012345678901ah".contains("hah"));
32
+ assert!(!"00abc01234567890123456789abc".contains("bcabc"));
33
+}
34
+
35
36
#[test]
37
fn test_strslice_contains() {
0 commit comments