Skip to content

Cleaning up XXXes #7812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 0 additions & 2 deletions src/libstd/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ pub mod raw {
if capacity(*v) < n {
let ptr: *mut *mut Box<Vec<()>> = transmute(v);
let ty = intrinsics::get_tydesc::<T>();
// XXX transmute shouldn't be necessary
let ty = cast::transmute(ty);
return reserve_raw(ty, ptr, n);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rand/distributions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl Rand for StandardNormal {
let mut x = 1.0f64;
let mut y = 0.0f64;

// XXX infinities?
// FIXME #7755: infinities?
while -2.0 * y < x * x {
x = rng.gen::<f64>().ln() / ziggurat_tables::ZIG_NORM_R;
y = rng.gen::<f64>().ln();
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/rt/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! Only valid to call on linux. Mac and Windows use syscalls to
//! discover the command line arguments.
//!
//! XXX: Would be nice for this to not exist.
//! XXX: This has a lot of C glue for lack of globals.
//! FIXME #7756: Would be nice for this to not exist.
//! FIXME #7756: This has a lot of C glue for lack of globals.

use option::Option;

Expand Down
10 changes: 5 additions & 5 deletions src/libstd/rt/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ struct Packet<T> {
payload: Option<T>,
}

/// A one-shot channel.
/*
// A one-shot channel.
pub struct ChanOne<T> {
void_packet: *mut Void,
suppress_finalize: bool
Expand Down Expand Up @@ -681,7 +682,7 @@ impl<T> Clone for SharedPort<T> {
}
}

// XXX: Need better name
// FIXME #7760: Need better name
type MegaPipe<T> = (SharedPort<T>, SharedChan<T>);

pub fn megapipe<T: Send>() -> MegaPipe<T> {
Expand Down Expand Up @@ -1019,9 +1020,8 @@ mod test {
#[test]
fn shared_port_stress() {
do run_in_mt_newsched_task {
// XXX: Removing these type annotations causes an ICE
let (end_port, end_chan) = stream::<()>();
let (port, chan) = stream::<()>();
let (end_port, end_chan) = stream();
let (port, chan) = stream();
let end_chan = SharedChan::new(end_chan);
let port = SharedPort::new(port);
let total = stress_factor() + 100;
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/rt/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ use libc::c_void;
use cast::{transmute, transmute_mut_unsafe,
transmute_region, transmute_mut_region};

// XXX: Registers is boxed so that it is 16-byte aligned, for storing
// FIXME #7761: Registers is boxed so that it is 16-byte aligned, for storing
// SSE regs. It would be marginally better not to do this. In C++ we
// use an attribute on a struct.
// XXX: It would be nice to define regs as `~Option<Registers>` since
// FIXME #7761: It would be nice to define regs as `~Option<Registers>` since
// the registers are sometimes empty, but the discriminant would
// then misalign the regs again.
pub struct Context {
Expand All @@ -37,7 +37,7 @@ impl Context {

/// Create a new context that will resume execution by running ~fn()
pub fn new(start: ~fn(), stack: &mut StackSegment) -> Context {
// XXX: Putting main into a ~ so it's a thin pointer and can
// FIXME #7767: Putting main into a ~ so it's a thin pointer and can
// be passed to the spawn function. Another unfortunate
// allocation
let start = ~start;
Expand Down Expand Up @@ -206,7 +206,7 @@ fn align_down(sp: *mut uint) -> *mut uint {
}
}

// XXX: ptr::offset is positive ints only
// ptr::mut_offset is positive ints only
#[inline]
pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
use std::sys::size_of;
Expand Down
31 changes: 16 additions & 15 deletions src/libstd/rt/io/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,48 +827,49 @@ mod test {
assert!(buf == ~[10, 11]);
}

// XXX: Some problem with resolve here
/*#[test]
fn test_read_write_le() {
let uints = [0, 1, 2, 42, 10_123, 100_123_456, u64::max_value];

#[test]
fn test_read_write_le_mem() {
let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::max_value];

let mut writer = MemWriter::new();
for uints.each |i| {
writer.write_le_u64(*i);
for uints.iter().advance() |i| {
writer.write_le_u64_(*i);
}

let mut reader = MemReader::new(writer.inner());
for uints.each |i| {
for uints.iter().advance() |i| {
assert!(reader.read_le_u64() == *i);
}
}


#[test]
fn test_read_write_be() {
let uints = [0, 1, 2, 42, 10_123, 100_123_456, u64::max_value];
let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::max_value];

let mut writer = MemWriter::new();
for uints.each |i| {
writer.write_be_u64(*i);
for uints.iter().advance() |i| {
writer.write_be_u64_(*i);
}

let mut reader = MemReader::new(writer.inner());
for uints.each |i| {
for uints.iter().advance() |i| {
assert!(reader.read_be_u64() == *i);
}
}

#[test]
fn test_read_be_int_n() {
let ints = [i32::min_value, -123456, -42, -5, 0, 1, i32::max_value];
let ints = [::i32::min_value, -123456, -42, -5, 0, 1, ::i32::max_value];

let mut writer = MemWriter::new();
for ints.each |i| {
for ints.iter().advance() |i| {
writer.write_be_i32(*i);
}

let mut reader = MemReader::new(writer.inner());
for ints.each |i| {
for ints.iter().advance() |i| {
// this tests that the sign extension is working
// (comparing the values as i32 would not test this)
assert!(reader.read_be_int_n(4) == *i as i64);
Expand Down Expand Up @@ -899,6 +900,6 @@ mod test {
let mut reader = MemReader::new(writer.inner());
assert!(reader.read_be_f32() == 8.1250);
assert!(reader.read_le_f32() == 8.1250);
}*/
}

}
2 changes: 1 addition & 1 deletion src/libstd/rt/io/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::support::PathLike;
use super::{Reader, Writer, Seek};
use super::SeekStyle;

/// # XXX
/// # FIXME #7785
/// * Ugh, this is ridiculous. What is the best way to represent these options?
enum FileMode {
/// Opens an existing file. IoError if file does not exist.
Expand Down
1 change: 0 additions & 1 deletion src/libstd/rt/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ pub mod net {
pub mod ip;
#[cfg(unix)]
pub mod unix;
pub mod http;
}

/// Readers and Writers for memory buffers and strings.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ mod unicode;
#[path = "num/cmath.rs"]
mod cmath;

// XXX: This shouldn't be pub, and it should be reexported under 'unstable'
// FIXME #7809: This shouldn't be pub, and it should be reexported under 'unstable'
// but name resolution doesn't work without it being pub.
pub mod rt;

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ pub fn yield() {
use rt::local::Local;
use rt::sched::Scheduler;

// XXX: What does yield really mean in newsched?
// FIXME #6842: What does yield really mean in newsched?
// FIXME(#7544): Optimize this, since we know we won't block.
let sched = Local::take::<Scheduler>();
do sched.deschedule_running_task_and_then |sched, task| {
Expand Down
13 changes: 10 additions & 3 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4271,7 +4271,7 @@ impl Parser {
self.this_token_to_str()));
}

(ast::anonymous, None,
(ast::anonymous,
special_idents::clownshoes_foreign_mod)
}
};
Expand Down Expand Up @@ -5065,12 +5065,19 @@ impl Parser {
}
}

pub fn parse_str(&self) -> @str {
pub fn parse_optional_str(&self) -> Option<@str> {
match *self.token {
token::LIT_STR(s) => {
self.bump();
ident_to_str(&s)
Some(ident_to_str(&s))
}
_ => None
}
}

pub fn parse_str(&self) -> @str {
match self.parse_optional_str() {
Some(s) => { s }
_ => self.fatal("expected string literal")
}
}
Expand Down