Skip to content

Commit bfff48b

Browse files
committed
---
yaml --- r: 56876 b: refs/heads/try c: 0615fdd h: refs/heads/master v: v3
1 parent b4f1080 commit bfff48b

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
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: c4685477e0771ee21afa6b93ea0d4ca2c7f6abd9
5+
refs/heads/try: 0615fddd80116d63fba7040bdd89ad59117037dd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)