Skip to content

Commit d14d415

Browse files
committed
Allow multiple num impls to be imported at once
If we import num::num, it gets reexported implicitly and causes collisions if you try to import (for example) int::num and i8::num at the same time.
1 parent 56c6c65 commit d14d415

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/libcore/int-template.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import T = inst::T;
22
import cmp::{eq, ord};
3-
import num::num;
43

54
export min_value, max_value;
65
export min, max;
@@ -124,7 +123,7 @@ impl eq of eq for T {
124123
}
125124
}
126125

127-
impl num of num for T {
126+
impl num of num::num for T {
128127
fn add(&&other: T) -> T { ret self + other; }
129128
fn sub(&&other: T) -> T { ret self - other; }
130129
fn mul(&&other: T) -> T { ret self * other; }
@@ -196,7 +195,7 @@ fn test_to_str() {
196195

197196
#[test]
198197
fn test_ifaces() {
199-
fn test<U:num>(ten: U) {
198+
fn test<U:num::num>(ten: U) {
200199
assert (ten.to_int() == 10);
201200

202201
let two = ten.from_int(2);

src/libcore/uint-template.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import T = inst::T;
22
import cmp::{eq, ord};
3-
import num::num;
43

54
export min_value, max_value;
65
export min, max;
@@ -65,7 +64,7 @@ impl eq of eq for T {
6564
}
6665
}
6766

68-
impl num of num for T {
67+
impl num of num::num for T {
6968
fn add(&&other: T) -> T { ret self + other; }
7069
fn sub(&&other: T) -> T { ret self - other; }
7170
fn mul(&&other: T) -> T { ret self * other; }

0 commit comments

Comments
 (0)