From 834e28c9b4960a0acf4859f2739615cb7c5c1a55 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 12 Jul 2013 14:43:57 -0700 Subject: [PATCH 1/7] std: change XXX to NOTE --- src/libstd/at_vec.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libstd/at_vec.rs b/src/libstd/at_vec.rs index 31de7bf82f827..b45e9a544cb4e 100644 --- a/src/libstd/at_vec.rs +++ b/src/libstd/at_vec.rs @@ -255,8 +255,6 @@ pub mod raw { if capacity(*v) < n { let ptr: *mut *mut Box> = transmute(v); let ty = intrinsics::get_tydesc::(); - // XXX transmute shouldn't be necessary - let ty = cast::transmute(ty); return reserve_raw(ty, ptr, n); } } From 5fbd6e84362834dbb55cb9bb0b11ae4a0043bb6b Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 12 Jul 2013 16:42:04 -0700 Subject: [PATCH 2/7] std: Get rid of by-value-self workarounds; it works now --- src/libstd/rand/distributions.rs | 2 +- src/libstd/rt/args.rs | 4 ++-- src/libstd/rt/comm.rs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libstd/rand/distributions.rs b/src/libstd/rand/distributions.rs index 56eae0428751e..ba6f6cf75da83 100644 --- a/src/libstd/rand/distributions.rs +++ b/src/libstd/rand/distributions.rs @@ -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::().ln() / ziggurat_tables::ZIG_NORM_R; y = rng.gen::().ln(); diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 6f26e3bd9efe8..f7ac80b0464e6 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -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; diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index 42d59ccdf958e..10ff546408360 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -46,7 +46,8 @@ struct Packet { payload: Option, } -/// A one-shot channel. +/* +// A one-shot channel. pub struct ChanOne { void_packet: *mut Void, suppress_finalize: bool From 3515a0a5cab1caa4e231615f195f083b2e4d6282 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 12 Jul 2013 18:02:00 -0700 Subject: [PATCH 3/7] std: Remove type annotations, they're not needed anymore --- src/libstd/rt/comm.rs | 7 +++---- src/libsyntax/parse/parser.rs | 13 ++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index 10ff546408360..5a26e7f6179f6 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -682,7 +682,7 @@ impl Clone for SharedPort { } } -// XXX: Need better name +// FIXME #7760: Need better name type MegaPipe = (SharedPort, SharedChan); pub fn megapipe() -> MegaPipe { @@ -1020,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; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a2664dcf890ad..bd582ef6d0c66 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4271,7 +4271,7 @@ impl Parser { self.this_token_to_str())); } - (ast::anonymous, None, + (ast::anonymous, special_idents::clownshoes_foreign_mod) } }; @@ -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") } } From 88c8e96f070eefad7f6e1cb020c3705980c01256 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Sat, 13 Jul 2013 23:00:22 -0700 Subject: [PATCH 4/7] std: Comments --- src/libstd/rt/context.rs | 8 ++++---- src/libstd/rt/io/extensions.rs | 31 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs index 890ad061a6806..5aaddc68383f1 100644 --- a/src/libstd/rt/context.rs +++ b/src/libstd/rt/context.rs @@ -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` since +// FIXME #7761: It would be nice to define regs as `~Option` since // the registers are sometimes empty, but the discriminant would // then misalign the regs again. pub struct Context { @@ -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; @@ -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(ptr: *mut T, count: int) -> *mut T { use std::sys::size_of; diff --git a/src/libstd/rt/io/extensions.rs b/src/libstd/rt/io/extensions.rs index 2d21bf0f9dcf3..e144e07880857 100644 --- a/src/libstd/rt/io/extensions.rs +++ b/src/libstd/rt/io/extensions.rs @@ -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); @@ -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); - }*/ + } } From b3f624f68b8f28e9644e8f9c7397b2cd72bdc0d9 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Sun, 14 Jul 2013 00:24:44 -0700 Subject: [PATCH 5/7] std/extra: Move http module to extra --- src/{libstd/rt/io => libextra}/net/http.rs | 0 src/libstd/rt/io/file.rs | 2 +- src/libstd/rt/io/mod.rs | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) rename src/{libstd/rt/io => libextra}/net/http.rs (100%) diff --git a/src/libstd/rt/io/net/http.rs b/src/libextra/net/http.rs similarity index 100% rename from src/libstd/rt/io/net/http.rs rename to src/libextra/net/http.rs diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index a99f5da032c39..9128961165900 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -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. diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs index c980dc9d73efd..3d2a064dfc7ea 100644 --- a/src/libstd/rt/io/mod.rs +++ b/src/libstd/rt/io/mod.rs @@ -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. From c522e06d60693c64aadc5df264848951b1048cfc Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 15 Jul 2013 17:45:28 -0700 Subject: [PATCH 6/7] std: XXX to FIXME (comments only) --- src/libstd/std.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/std.rs b/src/libstd/std.rs index 9370e7b0e84c9..e39c5e8a23c51 100644 --- a/src/libstd/std.rs +++ b/src/libstd/std.rs @@ -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; From 4e4b30d2086e48bfaa2eb35e860584caddc42556 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 15 Jul 2013 17:47:51 -0700 Subject: [PATCH 7/7] std: Comments only --- src/libstd/task/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index c38e6f233130b..3ca4206cce98a 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -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::(); do sched.deschedule_running_task_and_then |sched, task| {