We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13037a3 + 259930e commit 21d1f4dCopy full SHA for 21d1f4d
src/libcore/str.rs
@@ -574,6 +574,9 @@ enum Searcher {
574
impl Searcher {
575
fn new(haystack: &[u8], needle: &[u8]) -> Searcher {
576
// FIXME: Tune this.
577
+ // FIXME(#16715): This unsigned integer addition will probably not
578
+ // overflow because that would mean that the memory almost solely
579
+ // consists of the needle. Needs #16715 to be formally fixed.
580
if needle.len() + 20 > haystack.len() {
581
Naive(NaiveSearcher::new())
582
} else {
0 commit comments