Skip to content

Commit c04b897

Browse files
committed
core: Resolve some FIXMEs
1 parent 34aa956 commit c04b897

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

src/libcore/extfmt.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,28 +164,26 @@ mod ct {
164164
let noflags: [flag] = [];
165165
if i >= lim { ret {flags: noflags, next: i}; }
166166

167-
// FIXME: This recursion generates illegal instructions if the return
168-
// value isn't boxed. Only started happening after the ivec conversion
169167
fn more_(f: flag, s: str, i: uint, lim: uint) ->
170-
@{flags: [flag], next: uint} {
168+
{flags: [flag], next: uint} {
171169
let next = parse_flags(s, i + 1u, lim);
172170
let rest = next.flags;
173171
let j = next.next;
174172
let curr: [flag] = [f];
175-
ret @{flags: curr + rest, next: j};
173+
ret {flags: curr + rest, next: j};
176174
}
177175
let more = bind more_(_, s, i, lim);
178176
let f = s[i];
179177
ret if f == '-' as u8 {
180-
*more(flag_left_justify)
178+
more(flag_left_justify)
181179
} else if f == '0' as u8 {
182-
*more(flag_left_zero_pad)
180+
more(flag_left_zero_pad)
183181
} else if f == ' ' as u8 {
184-
*more(flag_space_for_sign)
182+
more(flag_space_for_sign)
185183
} else if f == '+' as u8 {
186-
*more(flag_sign_always)
184+
more(flag_sign_always)
187185
} else if f == '#' as u8 {
188-
*more(flag_alternate)
186+
more(flag_alternate)
189187
} else { {flags: noflags, next: i} };
190188
}
191189
fn parse_count(s: str, i: uint, lim: uint) -> {count: count, next: uint} {

src/libcore/str.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,6 @@ Returns:
665665
The original string with all occurances of `from` replaced with `to`
666666
*/
667667
fn replace(s: str, from: str, to: str) : is_not_empty(from) -> str unsafe {
668-
// FIXME (694): Shouldn't have to check this
669-
check (is_not_empty(from));
670668
if byte_len(s) == 0u {
671669
ret "";
672670
} else if starts_with(s, from) {

src/libcore/sys.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ fn refcount<T>(t: @T) -> uint {
7373
ret rustrt::refcount::<T>(t);
7474
}
7575

76-
// FIXME: There's a wrapper for this in the task module and this really
77-
// just belongs there
78-
fn unsupervise() -> () {
79-
ret rustrt::unsupervise();
80-
}
81-
8276
fn log_str<T>(t: T) -> str {
8377
rustrt::shape_log_str(get_type_desc::<T>(), t)
8478
}

src/libcore/task.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ native mod rustrt {
7272
fn start_task(id: task, closure: *rust_closure);
7373

7474
fn rust_task_is_unwinding(rt: *rust_task) -> bool;
75+
fn unsupervise();
7576
}
7677

7778
/* Section: Types */
@@ -287,10 +288,7 @@ fn join(task_port: joinable_task) -> task_result {
287288
if _id == id {
288289
ret res
289290
} else {
290-
// FIXME: uncomment this when extfmt is moved to core
291-
// in a snapshot.
292-
// fail #fmt["join received id %d, expected %d", _id, id]
293-
fail;
291+
fail #fmt["join received id %d, expected %d", _id, id]
294292
}
295293
}
296294
}
@@ -303,7 +301,9 @@ Detaches this task from its parent in the task tree
303301
304302
An unsupervised task will not propagate its failure up the task tree
305303
*/
306-
fn unsupervise() { ret sys::unsupervise(); }
304+
fn unsupervise() {
305+
rustrt::unsupervise();
306+
}
307307

308308
/*
309309
Function: currently_unwinding()

0 commit comments

Comments
 (0)