Skip to content

Commit

Permalink
Miscellaneous cleanup for old issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Jeffery committed Sep 20, 2015
1 parent fd38a75 commit 140e2d3
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 108 deletions.
12 changes: 3 additions & 9 deletions src/libcollectionstest/btree/set.rs
Expand Up @@ -148,15 +148,9 @@ fn test_zip() {
let y = y;
let mut z = x.iter().zip(&y);

// FIXME: #5801: this needs a type hint to compile...
let result: Option<(&usize, & &'static str)> = z.next();
assert_eq!(result.unwrap(), (&5, &("bar")));

let result: Option<(&usize, & &'static str)> = z.next();
assert_eq!(result.unwrap(), (&11, &("foo")));

let result: Option<(&usize, & &'static str)> = z.next();
assert!(result.is_none());
assert_eq!(z.next().unwrap(), (&5, &("bar")));
assert_eq!(z.next().unwrap(), (&11, &("foo")));
assert!(z.next().is_none());
}

#[test]
Expand Down
23 changes: 11 additions & 12 deletions src/libcoretest/cell.rs
Expand Up @@ -248,15 +248,14 @@ fn unsafe_cell_unsized() {
assert_eq!(unsafe { &mut *cell.get() }, comp);
}

// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn refcell_unsized() {
// let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
// {
// let b = &mut *cell.borrow_mut();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &mut [i32] = &mut [4, 2, 5];
// assert_eq!(&*cell.borrow(), comp);
// }
#[test]
fn refcell_unsized() {
let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
{
let b = &mut *cell.borrow_mut();
b[0] = 4;
b[2] = 5;
}
let comp: &mut [i32] = &mut [4, 2, 5];
assert_eq!(&*cell.borrow(), comp);
}
1 change: 0 additions & 1 deletion src/librustc/lint/mod.rs
Expand Up @@ -89,7 +89,6 @@ macro_rules! lint_initializer {
/// Declare a static item of type `&'static Lint`.
#[macro_export]
macro_rules! declare_lint {
// FIXME(#14660): deduplicate
(pub $name:ident, $level:ident, $desc:expr) => (
pub static $name: &'static ::rustc::lint::Lint
= &lint_initializer!($name, $level, $desc);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Expand Up @@ -211,7 +211,7 @@ pub fn main_args(args: &[String]) -> isize {
for &(name, _, description) in PASSES {
println!("{:>20} - {}", name, description);
}
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
println!("\nDefault passes for rustdoc:");
for &name in DEFAULT_PASSES {
println!("{:>20}", name);
}
Expand Down
9 changes: 3 additions & 6 deletions src/libserialize/json.rs
Expand Up @@ -76,8 +76,7 @@
//! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the
//! serialization API, using the derived serialization code.
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use serialize::json;
//!
Expand Down Expand Up @@ -111,8 +110,7 @@
//!
//! ### Simple example of `ToJson` usage
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use serialize::json::{self, ToJson, Json};
//!
Expand Down Expand Up @@ -151,8 +149,7 @@
//!
//! ### Verbose example of `ToJson` usage
//!
//! ```notrust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! ```rust
//! extern crate serialize;
//! use std::collections::BTreeMap;
//! use serialize::json::{self, Json, ToJson};
Expand Down
23 changes: 11 additions & 12 deletions src/libstd/sync/mutex.rs
Expand Up @@ -536,16 +536,15 @@ mod tests {
assert_eq!(*lock, 2);
}

// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn test_mutex_unsized() {
// let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
// {
// let b = &mut *mutex.lock().unwrap();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &[i32] = &[4, 2, 5];
// assert_eq!(&*mutex.lock().unwrap(), comp);
// }
#[test]
fn test_mutex_unsized() {
let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
{
let b = &mut *mutex.lock().unwrap();
b[0] = 4;
b[2] = 5;
}
let comp: &[i32] = &[4, 2, 5];
assert_eq!(&*mutex.lock().unwrap(), comp);
}
}
23 changes: 11 additions & 12 deletions src/libstd/sync/rwlock.rs
Expand Up @@ -578,18 +578,17 @@ mod tests {
assert_eq!(*lock, 2);
}

// FIXME(#25351) needs deeply nested coercions of DST structs.
// #[test]
// fn test_rwlock_unsized() {
// let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]);
// {
// let b = &mut *rw.write().unwrap();
// b[0] = 4;
// b[2] = 5;
// }
// let comp: &[i32] = &[4, 2, 5];
// assert_eq!(&*rw.read().unwrap(), comp);
// }
#[test]
fn test_rwlock_unsized() {
let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]);
{
let b = &mut *rw.write().unwrap();
b[0] = 4;
b[2] = 5;
}
let comp: &[i32] = &[4, 2, 5];
assert_eq!(&*rw.read().unwrap(), comp);
}

#[test]
fn test_rwlock_try_write() {
Expand Down
32 changes: 1 addition & 31 deletions src/libstd/sys/common/wtf8.rs
Expand Up @@ -31,7 +31,6 @@ use core::str::next_code_point;
use ascii::*;
use borrow::Cow;
use char;
use cmp;
use fmt;
use hash::{Hash, Hasher};
use iter::FromIterator;
Expand Down Expand Up @@ -375,6 +374,7 @@ impl Extend<CodePoint> for Wtf8Buf {
///
/// Similar to `&str`, but can additionally contain surrogate code points
/// if they’re not in a surrogate pair.
#[derive(Eq, Ord, PartialEq, PartialOrd)]
pub struct Wtf8 {
bytes: [u8]
}
Expand All @@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 {
fn as_inner(&self) -> &[u8] { &self.bytes }
}

// FIXME: https://github.com/rust-lang/rust/issues/18805
impl PartialEq for Wtf8 {
fn eq(&self, other: &Wtf8) -> bool { self.bytes.eq(&other.bytes) }
}

// FIXME: https://github.com/rust-lang/rust/issues/18805
impl Eq for Wtf8 {}

// FIXME: https://github.com/rust-lang/rust/issues/18738
impl PartialOrd for Wtf8 {
#[inline]
fn partial_cmp(&self, other: &Wtf8) -> Option<cmp::Ordering> {
self.bytes.partial_cmp(&other.bytes)
}
#[inline]
fn lt(&self, other: &Wtf8) -> bool { self.bytes.lt(&other.bytes) }
#[inline]
fn le(&self, other: &Wtf8) -> bool { self.bytes.le(&other.bytes) }
#[inline]
fn gt(&self, other: &Wtf8) -> bool { self.bytes.gt(&other.bytes) }
#[inline]
fn ge(&self, other: &Wtf8) -> bool { self.bytes.ge(&other.bytes) }
}

// FIXME: https://github.com/rust-lang/rust/issues/18738
impl Ord for Wtf8 {
#[inline]
fn cmp(&self, other: &Wtf8) -> cmp::Ordering { self.bytes.cmp(&other.bytes) }
}

/// Format the slice with double quotes,
/// and surrogates as `\u` followed by four hexadecimal digits.
/// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800]
Expand Down
1 change: 0 additions & 1 deletion src/rustbook/main.rs
Expand Up @@ -39,7 +39,6 @@ mod javascript;

static EXIT_STATUS: AtomicIsize = ATOMIC_ISIZE_INIT;

#[cfg(not(test))] // thanks #12327
fn main() {
let mut term = Term::new();
let cmd: Vec<_> = env::args().collect();
Expand Down
6 changes: 2 additions & 4 deletions src/test/bench/core-map.rs
Expand Up @@ -126,8 +126,7 @@ fn main() {

println!("{} keys", n_keys);

// FIXME: #9970
println!("{}", "\nBTreeMap:");
println!("\nBTreeMap:");

{
let mut map: BTreeMap<usize,usize> = BTreeMap::new();
Expand All @@ -145,8 +144,7 @@ fn main() {
vector(&mut map, n_keys, &rand);
}

// FIXME: #9970
println!("{}", "\nHashMap:");
println!("\nHashMap:");

{
let mut map: HashMap<usize,usize> = HashMap::new();
Expand Down
Expand Up @@ -111,12 +111,9 @@ fn assign_field4<'a>(x: &'a mut Own<Point>) {
x.y = 3; //~ ERROR cannot borrow
}

// FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut.
/*
fn deref_imm_method(x: Own<Point>) {
let __isize = x.get();
}
*/

fn deref_mut_method1(x: Own<Point>) {
x.set(0, 0); //~ ERROR cannot borrow
Expand Down
8 changes: 0 additions & 8 deletions src/test/compile-fail/feature-gated-feature-in-macro-arg.rs
Expand Up @@ -8,14 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME #20661: format_args! emits calls to the unstable std::fmt::rt
// module, so the compiler has some hacks to make that possible
// (in span_is_internal). Unnfortunately those hacks defeat this
// particular scenario of checking feature gates in arguments to
// println!().

// ignore-test

// tests that input to a macro is checked for use of gated features. If this
// test succeeds due to the acceptance of a feature, pick a new feature to
// test. Not ideal, but oh well :(
Expand Down
3 changes: 1 addition & 2 deletions src/test/run-pass/issue-5060.rs
Expand Up @@ -16,8 +16,7 @@ macro_rules! print_hd_tl {
print!("{}", stringify!($field_tl));
print!(", ");
)+
// FIXME: #9970
print!("{}", "]\n");
print!("]\n");
})
}

Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/lambda-var-hygiene.rs
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-test #9383

// shouldn't affect evaluation of $ex:
macro_rules! bad_macro {
($ex:expr) => ({(|_x| { $ex }) (9) })
Expand Down
4 changes: 0 additions & 4 deletions src/test/rustdoc/hidden-line.rs
Expand Up @@ -12,8 +12,6 @@
/// retained.
///
/// ```rust
/// mod to_make_deriving_work { // FIXME #4913
///
/// # #[derive(PartialEq)] // invisible
/// # struct Foo; // invisible
///
Expand All @@ -24,8 +22,6 @@
/// let x = Bar(Foo);
/// assert_eq!(x, x); // check that the derivings worked
/// }
///
/// }
/// ```
pub fn foo() {}

Expand Down

0 comments on commit 140e2d3

Please sign in to comment.