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
|
@ -570,11 +570,18 @@ pub trait Shl<RHS,Result> {
|
|||
|
||||
macro_rules! shl_impl(
|
||||
($($t:ty)*) => ($(
|
||||
#[cfg(not(test))]
|
||||
#[cfg(stage0)]
|
||||
impl Shl<$t, $t> for $t {
|
||||
#[inline]
|
||||
fn shl(&self, other: &$t) -> $t { (*self) << (*other) }
|
||||
}
|
||||
#[cfg(not(stage0), not(test))]
|
||||
impl Shl<$t, $t> for $t {
|
||||
#[inline]
|
||||
fn shl(&self, other: &$t) -> $t {
|
||||
(*self) << (*other as uint)
|
||||
}
|
||||
}
|
||||
)*)
|
||||
)
|
||||
|
||||
|
@ -612,11 +619,16 @@ pub trait Shr<RHS,Result> {
|
|||
|
||||
macro_rules! shr_impl(
|
||||
($($t:ty)*) => ($(
|
||||
#[cfg(not(test))]
|
||||
#[cfg(stage0, not(test))]
|
||||
impl Shr<$t, $t> for $t {
|
||||
#[inline]
|
||||
fn shr(&self, other: &$t) -> $t { (*self) >> (*other) }
|
||||
}
|
||||
#[cfg(not(stage0), not(test))]
|
||||
impl Shr<$t, $t> for $t {
|
||||
#[inline]
|
||||
fn shr(&self, other: &$t) -> $t { (*self) >> (*other as uint) }
|
||||
}
|
||||
)*)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue