Skip to content

Commit 91e5a1c

Browse files
committed
core: Remove the nearly empty math module
This mod only had two functions, all of whose users have been changed to use the uint module.
1 parent 0351976 commit 91e5a1c

File tree

9 files changed

+8
-317
lines changed

9 files changed

+8
-317
lines changed

src/fuzzer/fuzzer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ fn check_variants_T<T: copy>(
254254
let L = vec::len(things);
255255

256256
if L < 100u {
257-
under(math::min(L, 20u)) {|i|
257+
under(uint::min(L, 20u)) {|i|
258258
log(error, "Replacing... #" + uint::str(i));
259-
under(math::min(L, 30u)) {|j|
259+
under(uint::min(L, 30u)) {|j|
260260
log(error, "With... " + stringifier(@things[j]));
261261
let crate2 = @replacer(crate, i, things[j], cx.mode);
262262
// It would be best to test the *crate* for stability, but testing the

src/libcore/core.rc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export either, option, result, iter;
3434
export libc, os, ctypes, sys, unsafe, logging;
3535
export comm, task, future;
3636
export extfmt;
37-
export math, bessel;
37+
export bessel;
3838
export tuple;
3939
export to_str;
4040

@@ -84,7 +84,6 @@ mod os;
8484
mod path;
8585

8686
mod ctypes;
87-
mod math;
8887
mod cmath;
8988
mod sys;
9089
mod unsafe;

src/libcore/math.rs

Lines changed: 0 additions & 307 deletions
This file was deleted.

src/libcore/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ mod u8 {
912912
pure fn cmp(&&a: [u8], &&b: [u8]) -> int unsafe {
913913
let a_len = len(a);
914914
let b_len = len(b);
915-
let n = math::min(a_len, b_len) as ctypes::size_t;
915+
let n = uint::min(a_len, b_len) as ctypes::size_t;
916916
let r = libc::memcmp(unsafe::to_ptr(a) as *libc::c_void,
917917
unsafe::to_ptr(b) as *libc::c_void, n) as int;
918918

src/libstd/rope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ mod node {
10061006
right : right,
10071007
char_len: char_len(left) + char_len(right),
10081008
byte_len: byte_len(left) + byte_len(right),
1009-
height: math::max(height(left), height(right)) + 1u
1009+
height: uint::max(height(left), height(right)) + 1u
10101010
})
10111011
}
10121012

src/rustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn get_relative_to(abs1: fs::path, abs2: fs::path) -> fs::path {
129129
assert len1 > 0u;
130130
assert len2 > 0u;
131131

132-
let max_common_path = math::min(len1, len2) - 1u;
132+
let max_common_path = uint::min(len1, len2) - 1u;
133133
let start_idx = 0u;
134134
while start_idx < max_common_path
135135
&& split1[start_idx] == split2[start_idx] {

src/rustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ mod unify {
15681568
_ { cx.tcx.sess.bug("someone forgot to document an invariant \
15691569
in union"); }
15701570
};
1571-
ufind::grow(vb.sets, math::max(set_a, set_b) + 1u);
1571+
ufind::grow(vb.sets, uint::max(set_a, set_b) + 1u);
15721572
let root_a = ufind::find(vb.sets, set_a);
15731573
let root_b = ufind::find(vb.sets, set_b);
15741574

src/rustc/util/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import math::{max, min};
21
import std::map::hashmap;
32
import syntax::ast;
43
import ast::{ty, pat};

src/rustdoc/unindent_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn unindent(s: str) -> str {
5757
false
5858
}
5959
};
60-
math::min(min_indent, spaces)
60+
uint::min(min_indent, spaces)
6161
}
6262
};
6363

0 commit comments

Comments
 (0)