librustc: Remove the fallback to int
from typechecking.
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
This commit is contained in:
parent
f7f95c8f5a
commit
9e3d0b002a
362 changed files with 2229 additions and 2050 deletions
|
@ -364,7 +364,8 @@ impl TwoWaySearcher {
|
|||
period = period2;
|
||||
}
|
||||
|
||||
let byteset = needle.iter().fold(0, |a, &b| (1 << (b & 0x3f)) | a);
|
||||
let byteset = needle.iter()
|
||||
.fold(0, |a, &b| (1 << ((b & 0x3f) as uint)) | a);
|
||||
|
||||
if needle.slice_to(critPos) == needle.slice_from(needle.len() - critPos) {
|
||||
TwoWaySearcher {
|
||||
|
@ -396,7 +397,9 @@ impl TwoWaySearcher {
|
|||
}
|
||||
|
||||
// Quickly skip by large portions unrelated to our substring
|
||||
if (self.byteset >> (haystack[self.position + needle.len() - 1] & 0x3f)) & 1 == 0 {
|
||||
if (self.byteset >>
|
||||
((haystack[self.position + needle.len() - 1] & 0x3f)
|
||||
as uint)) & 1 == 0 {
|
||||
self.position += needle.len();
|
||||
continue 'search;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue