Miscellaneous cleanup for old issues.

This commit is contained in:
Lee Jeffery
2015-09-20 11:35:08 +01:00
committed by Eljay
parent fd38a75077
commit 140e2d3a09
15 changed files with 44 additions and 108 deletions

View File

@@ -148,15 +148,9 @@ fn test_zip() {
let y = y; let y = y;
let mut z = x.iter().zip(&y); let mut z = x.iter().zip(&y);
// FIXME: #5801: this needs a type hint to compile... assert_eq!(z.next().unwrap(), (&5, &("bar")));
let result: Option<(&usize, & &'static str)> = z.next(); assert_eq!(z.next().unwrap(), (&11, &("foo")));
assert_eq!(result.unwrap(), (&5, &("bar"))); assert!(z.next().is_none());
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());
} }
#[test] #[test]

View File

@@ -248,15 +248,14 @@ fn unsafe_cell_unsized() {
assert_eq!(unsafe { &mut *cell.get() }, comp); assert_eq!(unsafe { &mut *cell.get() }, comp);
} }
// FIXME(#25351) needs deeply nested coercions of DST structs. #[test]
// #[test] fn refcell_unsized() {
// fn refcell_unsized() { let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
// let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]); {
// { let b = &mut *cell.borrow_mut();
// let b = &mut *cell.borrow_mut(); b[0] = 4;
// b[0] = 4; b[2] = 5;
// b[2] = 5; }
// } let comp: &mut [i32] = &mut [4, 2, 5];
// let comp: &mut [i32] = &mut [4, 2, 5]; assert_eq!(&*cell.borrow(), comp);
// assert_eq!(&*cell.borrow(), comp); }
// }

View File

@@ -89,7 +89,6 @@ macro_rules! lint_initializer {
/// Declare a static item of type `&'static Lint`. /// Declare a static item of type `&'static Lint`.
#[macro_export] #[macro_export]
macro_rules! declare_lint { macro_rules! declare_lint {
// FIXME(#14660): deduplicate
(pub $name:ident, $level:ident, $desc:expr) => ( (pub $name:ident, $level:ident, $desc:expr) => (
pub static $name: &'static ::rustc::lint::Lint pub static $name: &'static ::rustc::lint::Lint
= &lint_initializer!($name, $level, $desc); = &lint_initializer!($name, $level, $desc);

View File

@@ -211,7 +211,7 @@ pub fn main_args(args: &[String]) -> isize {
for &(name, _, description) in PASSES { for &(name, _, description) in PASSES {
println!("{:>20} - {}", name, description); println!("{:>20} - {}", name, description);
} }
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970 println!("\nDefault passes for rustdoc:");
for &name in DEFAULT_PASSES { for &name in DEFAULT_PASSES {
println!("{:>20}", name); println!("{:>20}", name);
} }

View File

@@ -76,8 +76,7 @@
//! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the //! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the
//! serialization API, using the derived serialization code. //! serialization API, using the derived serialization code.
//! //!
//! ```notrust //! ```rust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! extern crate serialize; //! extern crate serialize;
//! use serialize::json; //! use serialize::json;
//! //!
@@ -111,8 +110,7 @@
//! //!
//! ### Simple example of `ToJson` usage //! ### Simple example of `ToJson` usage
//! //!
//! ```notrust //! ```rust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! extern crate serialize; //! extern crate serialize;
//! use serialize::json::{self, ToJson, Json}; //! use serialize::json::{self, ToJson, Json};
//! //!
@@ -151,8 +149,7 @@
//! //!
//! ### Verbose example of `ToJson` usage //! ### Verbose example of `ToJson` usage
//! //!
//! ```notrust //! ```rust
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
//! extern crate serialize; //! extern crate serialize;
//! use std::collections::BTreeMap; //! use std::collections::BTreeMap;
//! use serialize::json::{self, Json, ToJson}; //! use serialize::json::{self, Json, ToJson};

View File

@@ -536,16 +536,15 @@ mod tests {
assert_eq!(*lock, 2); assert_eq!(*lock, 2);
} }
// FIXME(#25351) needs deeply nested coercions of DST structs. #[test]
// #[test] fn test_mutex_unsized() {
// fn test_mutex_unsized() { let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
// let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]); {
// { let b = &mut *mutex.lock().unwrap();
// let b = &mut *mutex.lock().unwrap(); b[0] = 4;
// b[0] = 4; b[2] = 5;
// b[2] = 5; }
// } let comp: &[i32] = &[4, 2, 5];
// let comp: &[i32] = &[4, 2, 5]; assert_eq!(&*mutex.lock().unwrap(), comp);
// assert_eq!(&*mutex.lock().unwrap(), comp); }
// }
} }

View File

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

View File

@@ -31,7 +31,6 @@ use core::str::next_code_point;
use ascii::*; use ascii::*;
use borrow::Cow; use borrow::Cow;
use char; use char;
use cmp;
use fmt; use fmt;
use hash::{Hash, Hasher}; use hash::{Hash, Hasher};
use iter::FromIterator; use iter::FromIterator;
@@ -375,6 +374,7 @@ impl Extend<CodePoint> for Wtf8Buf {
/// ///
/// Similar to `&str`, but can additionally contain surrogate code points /// Similar to `&str`, but can additionally contain surrogate code points
/// if theyre not in a surrogate pair. /// if theyre not in a surrogate pair.
#[derive(Eq, Ord, PartialEq, PartialOrd)]
pub struct Wtf8 { pub struct Wtf8 {
bytes: [u8] bytes: [u8]
} }
@@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 {
fn as_inner(&self) -> &[u8] { &self.bytes } 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, /// Format the slice with double quotes,
/// and surrogates as `\u` followed by four hexadecimal digits. /// and surrogates as `\u` followed by four hexadecimal digits.
/// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800] /// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800]

View File

@@ -39,7 +39,6 @@ mod javascript;
static EXIT_STATUS: AtomicIsize = ATOMIC_ISIZE_INIT; static EXIT_STATUS: AtomicIsize = ATOMIC_ISIZE_INIT;
#[cfg(not(test))] // thanks #12327
fn main() { fn main() {
let mut term = Term::new(); let mut term = Term::new();
let cmd: Vec<_> = env::args().collect(); let cmd: Vec<_> = env::args().collect();

View File

@@ -126,8 +126,7 @@ fn main() {
println!("{} keys", n_keys); println!("{} keys", n_keys);
// FIXME: #9970 println!("\nBTreeMap:");
println!("{}", "\nBTreeMap:");
{ {
let mut map: BTreeMap<usize,usize> = BTreeMap::new(); let mut map: BTreeMap<usize,usize> = BTreeMap::new();
@@ -145,8 +144,7 @@ fn main() {
vector(&mut map, n_keys, &rand); vector(&mut map, n_keys, &rand);
} }
// FIXME: #9970 println!("\nHashMap:");
println!("{}", "\nHashMap:");
{ {
let mut map: HashMap<usize,usize> = HashMap::new(); let mut map: HashMap<usize,usize> = HashMap::new();

View File

@@ -111,12 +111,9 @@ fn assign_field4<'a>(x: &'a mut Own<Point>) {
x.y = 3; //~ ERROR cannot borrow x.y = 3; //~ ERROR cannot borrow
} }
// FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut.
/*
fn deref_imm_method(x: Own<Point>) { fn deref_imm_method(x: Own<Point>) {
let __isize = x.get(); let __isize = x.get();
} }
*/
fn deref_mut_method1(x: Own<Point>) { fn deref_mut_method1(x: Own<Point>) {
x.set(0, 0); //~ ERROR cannot borrow x.set(0, 0); //~ ERROR cannot borrow

View File

@@ -8,14 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // 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 // 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 succeeds due to the acceptance of a feature, pick a new feature to
// test. Not ideal, but oh well :( // test. Not ideal, but oh well :(

View File

@@ -16,8 +16,7 @@ macro_rules! print_hd_tl {
print!("{}", stringify!($field_tl)); print!("{}", stringify!($field_tl));
print!(", "); print!(", ");
)+ )+
// FIXME: #9970 print!("]\n");
print!("{}", "]\n");
}) })
} }

View File

@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-test #9383
// shouldn't affect evaluation of $ex: // shouldn't affect evaluation of $ex:
macro_rules! bad_macro { macro_rules! bad_macro {
($ex:expr) => ({(|_x| { $ex }) (9) }) ($ex:expr) => ({(|_x| { $ex }) (9) })

View File

@@ -12,8 +12,6 @@
/// retained. /// retained.
/// ///
/// ```rust /// ```rust
/// mod to_make_deriving_work { // FIXME #4913
///
/// # #[derive(PartialEq)] // invisible /// # #[derive(PartialEq)] // invisible
/// # struct Foo; // invisible /// # struct Foo; // invisible
/// ///
@@ -24,8 +22,6 @@
/// let x = Bar(Foo); /// let x = Bar(Foo);
/// assert_eq!(x, x); // check that the derivings worked /// assert_eq!(x, x); // check that the derivings worked
/// } /// }
///
/// }
/// ``` /// ```
pub fn foo() {} pub fn foo() {}