Skip to content

Commit 150a045

Browse files
committed
---
yaml --- r: 56114 b: refs/heads/auto c: 0615fdd h: refs/heads/master v: v3
1 parent e7786b6 commit 150a045

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: c4685477e0771ee21afa6b93ea0d4ca2c7f6abd9
17+
refs/heads/auto: 0615fddd80116d63fba7040bdd89ad59117037dd
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/num/num.rs

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -110,37 +110,29 @@ pub trait NumCast {
110110

111111
macro_rules! impl_num_cast(
112112
($T:ty, $conv:ident) => (
113-
// FIXME #4375: This enclosing module is necessary because
114-
// of a bug with macros expanding into multiple items
115-
pub mod $conv {
116-
use num::NumCast;
117-
118-
#[cfg(notest)]
119-
impl NumCast for $T {
120-
#[doc = "Cast `n` to a `$T`"]
121-
#[inline(always)]
122-
fn from<N:NumCast>(n: N) -> $T {
123-
// `$conv` could be generated using `concat_idents!`, but that
124-
// macro seems to be broken at the moment
125-
n.$conv()
126-
}
127-
128-
#[inline(always)] fn to_u8(&self) -> u8 { *self as u8 }
129-
#[inline(always)] fn to_u16(&self) -> u16 { *self as u16 }
130-
#[inline(always)] fn to_u32(&self) -> u32 { *self as u32 }
131-
#[inline(always)] fn to_u64(&self) -> u64 { *self as u64 }
132-
#[inline(always)] fn to_uint(&self) -> uint { *self as uint }
133-
134-
#[inline(always)] fn to_i8(&self) -> i8 { *self as i8 }
135-
#[inline(always)] fn to_i16(&self) -> i16 { *self as i16 }
136-
#[inline(always)] fn to_i32(&self) -> i32 { *self as i32 }
137-
#[inline(always)] fn to_i64(&self) -> i64 { *self as i64 }
138-
#[inline(always)] fn to_int(&self) -> int { *self as int }
139-
140-
#[inline(always)] fn to_f32(&self) -> f32 { *self as f32 }
141-
#[inline(always)] fn to_f64(&self) -> f64 { *self as f64 }
142-
#[inline(always)] fn to_float(&self) -> float { *self as float }
113+
impl NumCast for $T {
114+
#[inline(always)]
115+
fn from<N:NumCast>(n: N) -> $T {
116+
// `$conv` could be generated using `concat_idents!`, but that
117+
// macro seems to be broken at the moment
118+
n.$conv()
143119
}
120+
121+
#[inline(always)] fn to_u8(&self) -> u8 { *self as u8 }
122+
#[inline(always)] fn to_u16(&self) -> u16 { *self as u16 }
123+
#[inline(always)] fn to_u32(&self) -> u32 { *self as u32 }
124+
#[inline(always)] fn to_u64(&self) -> u64 { *self as u64 }
125+
#[inline(always)] fn to_uint(&self) -> uint { *self as uint }
126+
127+
#[inline(always)] fn to_i8(&self) -> i8 { *self as i8 }
128+
#[inline(always)] fn to_i16(&self) -> i16 { *self as i16 }
129+
#[inline(always)] fn to_i32(&self) -> i32 { *self as i32 }
130+
#[inline(always)] fn to_i64(&self) -> i64 { *self as i64 }
131+
#[inline(always)] fn to_int(&self) -> int { *self as int }
132+
133+
#[inline(always)] fn to_f32(&self) -> f32 { *self as f32 }
134+
#[inline(always)] fn to_f64(&self) -> f64 { *self as f64 }
135+
#[inline(always)] fn to_float(&self) -> float { *self as float }
144136
}
145137
)
146138
)

0 commit comments

Comments
 (0)