Skip to content

Commit 5281771

Browse files
committed
Merge pull request rust-lang#2706 from mozilla/incoming
Incoming
2 parents 0a6943d + b8710de commit 5281771

File tree

158 files changed

+1524
-1057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1524
-1057
lines changed

src/cargo/cargo.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ fn test_is_uuid() {
165165
assert !is_uuid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaป");
166166
}
167167

168-
// FIXME: implement url/URL parsing so we don't have to resort to weak checks
168+
// FIXME (#2661): implement url/URL parsing so we don't have to resort
169+
// to weak checks
169170

170171
fn has_archive_extension(p: str) -> bool {
171172
str::ends_with(p, ".tar") ||
@@ -188,8 +189,8 @@ fn is_archive_path(u: str) -> bool {
188189
}
189190

190191
fn is_archive_url(u: str) -> bool {
191-
// FIXME: this requires the protocol bit - if we had proper url parsing,
192-
// we wouldn't need it
192+
// FIXME (#2661): this requires the protocol bit - if we had proper
193+
// url parsing, we wouldn't need it
193194

194195
alt str::find_str(u, "://") {
195196
option::some(i) { has_archive_extension(u) }
@@ -315,7 +316,7 @@ fn load_crate(filename: str) -> option<crate> {
315316

316317
alt *attr_name {
317318
"std" | "core" { }
318-
_ { e.deps += [query]; }
319+
_ { vec::push(e.deps, query); }
319320
}
320321
}
321322
_ { }
@@ -774,7 +775,7 @@ fn install_source(c: cargo, path: str) {
774775
let mut cratefiles = [];
775776
for os::walk_dir(".") {|p|
776777
if str::ends_with(p, ".rc") {
777-
cratefiles += [p];
778+
vec::push(cratefiles, p);
778779
}
779780
}
780781

@@ -956,9 +957,10 @@ fn cmd_uninstall(c: cargo) {
956957
let bin = c.bindir;
957958
let target = c.opts.free[2u];
958959

959-
// FIXME: needs stronger pattern matching
960-
// FIXME: needs to uninstall from a specified location in a cache instead
961-
// of looking for it (binaries can be uninstalled by name only)
960+
// FIXME (#2662): needs stronger pattern matching
961+
// FIXME (#2662): needs to uninstall from a specified location in a
962+
// cache instead of looking for it (binaries can be uninstalled by
963+
// name only)
962964
if is_uuid(target) {
963965
for os::list_dir(lib).each { |file|
964966
alt str::find_str(file, "-" + target + "-") {
@@ -1059,8 +1061,8 @@ fn install_query(c: cargo, wd: str, target: str) {
10591061
}
10601062
}
10611063

1062-
// FIXME: This whole dep_cache and current_install
1063-
// thing is a bit of a hack. It should be cleaned up in the future.
1064+
// FIXME (#2662): This whole dep_cache and current_install thing is
1065+
// a bit of a hack. It should be cleaned up in the future.
10641066

10651067
if target == c.current_install {
10661068
for c.dep_cache.each { |k, _v|
@@ -1894,7 +1896,7 @@ fn main(argv: [str]) {
18941896
if !first_time && o.free[1] != "init" {
18951897
cmd_init(c);
18961898

1897-
// FIXME: shouldn't need to reconfigure
1899+
// FIXME (#2662): shouldn't need to reconfigure
18981900
c = configure(o);
18991901
}
19001902

src/compiletest/compiletest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn make_tests(config: config) -> [test::test_desc] {
139139
let file = file;
140140
#debug("inspecting file %s", file);
141141
if is_test(config, file) {
142-
tests += [make_test(config, file)]
142+
vec::push(tests, make_test(config, file))
143143
}
144144
}
145145
ret tests;

src/compiletest/header.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn load_props(testfile: str) -> test_props {
3131
let mut pp_exact = option::none;
3232
for iter_header(testfile) {|ln|
3333
alt parse_error_pattern(ln) {
34-
option::some(ep) { error_patterns += [ep]; }
34+
option::some(ep) { vec::push(error_patterns, ep) }
3535
option::none { }
3636
};
3737

@@ -44,11 +44,11 @@ fn load_props(testfile: str) -> test_props {
4444
}
4545

4646
option::iter(parse_aux_build(ln)) {|ab|
47-
aux_builds += [ab];
47+
vec::push(aux_builds, ab);
4848
}
4949

5050
option::iter(parse_exec_env(ln)) {|ee|
51-
exec_env += [ee];
51+
vec::push(exec_env, ee);
5252
}
5353
};
5454
ret {

src/compiletest/procsrv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn target_env(lib_path: str, prog: str) -> [(str,str)] {
1919
else { (k,v) }
2020
};
2121
if str::ends_with(prog, "rustc.exe") {
22-
env += [("RUST_THREADS", "1")]
22+
vec::push(env, ("RUST_THREADS", "1"));
2323
}
2424
ret env;
2525
}
@@ -32,7 +32,7 @@ fn target_env(_lib_path: str, _prog: str) -> [(str,str)] {
3232
}
3333

3434

35-
// FIXME: This code is duplicated in core::run::program_output
35+
// FIXME (#2659): This code is duplicated in core::run::program_output
3636
fn run(lib_path: str,
3737
prog: str,
3838
args: [str],

src/compiletest/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn run_pretty_test(config: config, props: test_props, testfile: str) {
104104
procres);
105105
}
106106

107-
srcs += [procres.stdout];
107+
vec::push(srcs, procres.stdout);
108108
round += 1;
109109
}
110110

src/etc/get-snapshot.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ def unpack_snapshot(triple, dl_path):
88
tar = tarfile.open(dl_path)
99
kernel = get_kernel(triple)
1010
for p in tar.getnames():
11-
12-
# FIXME: Fix this once win32 snapshot globs are fixed.
13-
name = p.replace("rust-stage0/stage3/", "", 1);
14-
name = name.replace("rust-stage0/", "", 1);
15-
11+
name = p.replace("rust-stage0/", "", 1);
1612
stagep = os.path.join(triple, "stage0")
1713
fp = os.path.join(stagep, name)
1814
print("extracting " + p)

src/etc/snapshot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def in_tar_name(fn):
183183
shutil.move(file0, file1)
184184

185185
if flag == "install":
186-
# FIXME this is an ugly quick hack; pls make it better
186+
# FIXME (#2664): this is an ugly quick hack; pls make it better
187187
path = file1
188188
comps = path.split("-")
189189
parts = { 'year': comps[2], \

src/etc/tidy.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import sys, fileinput, subprocess
3+
import sys, fileinput, subprocess, re
44

55
err=0
66
cols=78
@@ -23,6 +23,11 @@ def report_err(s):
2323
try:
2424
for line in fileinput.input(file_names,
2525
openhook=fileinput.hook_encoded("utf-8")):
26+
27+
if fileinput.filename().find("tidy.py") == -1:
28+
if line.find("FIXME") != -1:
29+
if re.search("FIXME.*#\d+", line) == None:
30+
report_err("FIXME without issue number")
2631
if (line.find('\t') != -1 and
2732
fileinput.filename().find("Makefile") == -1):
2833
report_err("tab character")

src/fuzzer/cycles.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn test_cycles(r : rand::rng, k: uint, n: uint)
6262

6363
// Create a graph with no edges
6464
range(0u, vlen) {|_i|
65-
v += [mut empty_pointy()];
65+
vec::push(v, empty_pointy());
6666
}
6767

6868
// Fill in the graph with random edges, with density k/n
@@ -77,7 +77,7 @@ fn test_cycles(r : rand::rng, k: uint, n: uint)
7777
// https://github.com/mozilla/rust/issues/1899
7878

7979
if (likelihood(r, k, n)) { v[i].m = [p(choice(r, v))]; }
80-
if (likelihood(r, k, n)) { v[i].n += [mut p(choice(r, v))]; }
80+
if (likelihood(r, k, n)) { vec::push(v[i].n, mut p(choice(r, v))); }
8181
if (likelihood(r, k, n)) { v[i].o = {x: 0, y: p(choice(r, v))}; }
8282
}
8383

src/fuzzer/fuzzer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn stash_ty_if(c: fn@(@ast::ty, test_mode)->bool,
129129
e: @ast::ty,
130130
tm: test_mode) {
131131
if c(e, tm) {
132-
*es += [*e];
132+
vec::push(*es,*e);
133133
} else {/* now my indices are wrong :( */ }
134134
}
135135

src/fuzzer/ivec_fuzz.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ fn vec_edits<T: copy>(v: [T], xs: [T]) -> [[T]] {
5757

5858
if Lv != 1u {
5959
// When Lv == 1u, this is redundant with omit.
60-
edits += [[]];
60+
vec::push(edits, []);
6161
}
6262
if Lv >= 3u {
6363
// When Lv == 2u, this is redundant with swap.
64-
edits += [vec::reversed(v)];
64+
vec::push(edits, vec::reversed(v));
6565
}
6666
ix(0u, 1u, Lv) {|i| edits += [vec_omit(v, i)]; }
6767
ix(0u, 1u, Lv) {|i| edits += [vec_dup(v, i)]; }
@@ -71,10 +71,10 @@ fn vec_edits<T: copy>(v: [T], xs: [T]) -> [[T]] {
7171

7272
ix(0u, 1u, len(xs)) {|j|
7373
ix(0u, 1u, Lv) {|i|
74-
edits += [vec_poke(v, i, xs[j])];
74+
vec::push(edits, vec_poke(v, i, xs[j]));
7575
}
7676
ix(0u, 0u, Lv) {|i|
77-
edits += [vec_insert(v, i, xs[j])];
77+
vec::push(edits, vec_insert(v, i, xs[j]));
7878
}
7979
}
8080

src/fuzzer/rand_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn weighted_vec<T: copy>(v : [weighted<T>]) -> [T] {
6262
for {weight: weight, item: item} in v {
6363
let i = 0u;
6464
while i < weight {
65-
r += [item];
65+
vec::push(r, item);
6666
i += 1u;
6767
}
6868
}

src/libcore/arc.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,18 @@ allowing them to share the underlying data."]
6868
fn clone<T: const>(rc: &arc<T>) -> arc<T> {
6969
unsafe {
7070
let ptr: ~arc_data<T> = unsafe::reinterpret_cast(**rc);
71-
rustrt::rust_atomic_increment(&mut ptr.count);
71+
let new_count = rustrt::rust_atomic_increment(&mut ptr.count);
72+
assert new_count >= 2;
7273
unsafe::forget(ptr);
7374
}
7475
arc_destruct(**rc)
7576
}
7677

7778
// An arc over mutable data that is protected by a lock.
78-
type ex_data<T> = {lock: sys::lock_and_signal, data: T};
79-
type exclusive<T> = arc_destruct<ex_data<T>>;
79+
type ex_data<T: send> = {lock: sys::lock_and_signal, data: T};
80+
type exclusive<T: send> = arc_destruct<ex_data<T>>;
8081

81-
fn exclusive<T>(-data: T) -> exclusive<T> {
82+
fn exclusive<T:send >(-data: T) -> exclusive<T> {
8283
let data = ~{mut count: 1, data: {lock: sys::create_lock(),
8384
data: data}};
8485
unsafe {
@@ -88,12 +89,13 @@ fn exclusive<T>(-data: T) -> exclusive<T> {
8889
}
8990
}
9091

91-
impl methods<T> for exclusive<T> {
92+
impl methods<T: send> for exclusive<T> {
9293
fn clone() -> exclusive<T> {
9394
unsafe {
9495
// this makes me nervous...
9596
let ptr: ~arc_data<ex_data<T>> = unsafe::reinterpret_cast(*self);
96-
rustrt::rust_atomic_increment(&mut ptr.count);
97+
let new_count = rustrt::rust_atomic_increment(&mut ptr.count);
98+
assert new_count > 1;
9799
unsafe::forget(ptr);
98100
}
99101
arc_destruct(*self)

src/libcore/cmath.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export c_float;
22
export c_double;
33

44
// uncomment once #1433 is fixed
5-
// FIXME export c_float_math_consts;
6-
// FIXME export c_double_math_consts;
5+
// FIXME (#1433): export c_float_math_consts;
6+
// FIXME (#1433): export c_double_math_consts;
77

88
export c_float_targ_consts;
99
export c_double_targ_consts;
@@ -68,8 +68,7 @@ native mod c_double {
6868
#[link_name="ilogb"] pure fn ilog_radix(n: c_double) -> c_int;
6969
pure fn modf(n: c_double, &iptr: c_double) -> c_double;
7070
pure fn pow(n: c_double, e: c_double) -> c_double;
71-
// FIXME enable when rounding modes become available
72-
// (See Issue #1379)
71+
// FIXME (#1379): enable when rounding modes become available
7372
// pure fn rint(n: c_double) -> c_double;
7473
pure fn round(n: c_double) -> c_double;
7574
// rename: for consistency with logradix
@@ -149,8 +148,7 @@ native mod c_float {
149148
#[link_name="modff"] pure fn modf(n: c_float,
150149
&iptr: c_float) -> c_float;
151150
#[link_name="powf"] pure fn pow(n: c_float, e: c_float) -> c_float;
152-
// FIXME enable when rounding modes become available
153-
// (See Issue #1379)
151+
// FIXME (#1379): enable when rounding modes become available
154152
// #[link_name="rintf"] pure fn rint(n: c_float) -> c_float;
155153
#[link_name="roundf"] pure fn round(n: c_float) -> c_float;
156154
#[link_name="scalbnf"] pure fn ldexp_radix(n: c_float, i: c_int)
@@ -176,8 +174,8 @@ mod c_float_targ_consts {
176174
const max_exp: uint = 128u;
177175
const min_10_exp: int = -37;
178176
const max_10_exp: int = 38;
179-
// FIXME this is wrong! replace with hexadecimal (%a) constants below
180-
// (see Issue #1433)
177+
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
178+
// below.
181179
const min_value: f32 = 1.175494e-38_f32;
182180
const max_value: f32 = 3.402823e+38_f32;
183181
const epsilon: f32 = 0.000000_f32;
@@ -191,8 +189,8 @@ mod c_double_targ_consts {
191189
const max_exp: uint = 1024u;
192190
const min_10_exp: int = -307;
193191
const max_10_exp: int = 308;
194-
// FIXME this is wrong! replace with hexadecimal (%a) constants below
195-
// (see Issue #1433)
192+
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
193+
// below.
196194
const min_value: f64 = 2.225074e-308_f64;
197195
const max_value: f64 = 1.797693e+308_f64;
198196
const epsilon: f64 = 2.220446e-16_f64;

0 commit comments

Comments
 (0)