提交 140e2d3a 编写于 作者: L Lee Jeffery 提交者: Eljay

Miscellaneous cleanup for old issues.

上级 fd38a750
......@@ -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]
......
......@@ -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);
}
......@@ -89,7 +89,6 @@ pub fn name_lower(&self) -> String {
/// 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);
......
......@@ -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);
}
......
......@@ -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;
//!
......@@ -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};
//!
......@@ -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};
......
......@@ -536,16 +536,15 @@ fn drop(&mut self) {
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);
}
}
......@@ -578,18 +578,17 @@ fn drop(&mut self) {
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() {
......
......@@ -31,7 +31,6 @@
use ascii::*;
use borrow::Cow;
use char;
use cmp;
use fmt;
use hash::{Hash, Hasher};
use iter::FromIterator;
......@@ -375,6 +374,7 @@ fn extend<T: IntoIterator<Item=CodePoint>>(&mut self, iterable: T) {
///
/// 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]
}
......@@ -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]
......
......@@ -39,7 +39,6 @@
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();
......
......@@ -126,8 +126,7 @@ fn main() {
println!("{} keys", n_keys);
// FIXME: #9970
println!("{}", "\nBTreeMap:");
println!("\nBTreeMap:");
{
let mut map: BTreeMap<usize,usize> = BTreeMap::new();
......@@ -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();
......
......@@ -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
......
......@@ -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 :(
......
......@@ -16,8 +16,7 @@
print!("{}", stringify!($field_tl));
print!(", ");
)+
// FIXME: #9970
print!("{}", "]\n");
print!("]\n");
})
}
......
......@@ -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) })
......
......@@ -12,8 +12,6 @@
/// retained.
///
/// ```rust
/// mod to_make_deriving_work { // FIXME #4913
///
/// # #[derive(PartialEq)] // invisible
/// # struct Foo; // invisible
///
......@@ -24,8 +22,6 @@
/// let x = Bar(Foo);
/// assert_eq!(x, x); // check that the derivings worked
/// }
///
/// }
/// ```
pub fn foo() {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册