Skip to content

Commit 68e6aa0

Browse files
committed
---
yaml --- r: 71977 b: refs/heads/dist-snap c: 0615fdd h: refs/heads/master i: 71975: e3d42ee v: v3
1 parent d45b1db commit 68e6aa0

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: c4685477e0771ee21afa6b93ea0d4ca2c7f6abd9
10+
refs/heads/dist-snap: 0615fddd80116d63fba7040bdd89ad59117037dd
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)