Skip to content

Commit 140e2d3

Browse files
author
Lee Jeffery
committed
Miscellaneous cleanup for old issues.
1 parent fd38a75 commit 140e2d3

File tree

15 files changed

+44
-108
lines changed

15 files changed

+44
-108
lines changed

src/libcollectionstest/btree/set.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,9 @@ fn test_zip() {
148148
let y = y;
149149
let mut z = x.iter().zip(&y);
150150

151-
// FIXME: #5801: this needs a type hint to compile...
152-
let result: Option<(&usize, & &'static str)> = z.next();
153-
assert_eq!(result.unwrap(), (&5, &("bar")));
154-
155-
let result: Option<(&usize, & &'static str)> = z.next();
156-
assert_eq!(result.unwrap(), (&11, &("foo")));
157-
158-
let result: Option<(&usize, & &'static str)> = z.next();
159-
assert!(result.is_none());
151+
assert_eq!(z.next().unwrap(), (&5, &("bar")));
152+
assert_eq!(z.next().unwrap(), (&11, &("foo")));
153+
assert!(z.next().is_none());
160154
}
161155

162156
#[test]

src/libcoretest/cell.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,14 @@ fn unsafe_cell_unsized() {
248248
assert_eq!(unsafe { &mut *cell.get() }, comp);
249249
}
250250

251-
// FIXME(#25351) needs deeply nested coercions of DST structs.
252-
// #[test]
253-
// fn refcell_unsized() {
254-
// let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
255-
// {
256-
// let b = &mut *cell.borrow_mut();
257-
// b[0] = 4;
258-
// b[2] = 5;
259-
// }
260-
// let comp: &mut [i32] = &mut [4, 2, 5];
261-
// assert_eq!(&*cell.borrow(), comp);
262-
// }
251+
#[test]
252+
fn refcell_unsized() {
253+
let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
254+
{
255+
let b = &mut *cell.borrow_mut();
256+
b[0] = 4;
257+
b[2] = 5;
258+
}
259+
let comp: &mut [i32] = &mut [4, 2, 5];
260+
assert_eq!(&*cell.borrow(), comp);
261+
}

src/librustc/lint/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ macro_rules! lint_initializer {
8989
/// Declare a static item of type `&'static Lint`.
9090
#[macro_export]
9191
macro_rules! declare_lint {
92-
// FIXME(#14660): deduplicate
9392
(pub $name:ident, $level:ident, $desc:expr) => (
9493
pub static $name: &'static ::rustc::lint::Lint
9594
= &lint_initializer!($name, $level, $desc);

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub fn main_args(args: &[String]) -> isize {
211211
for &(name, _, description) in PASSES {
212212
println!("{:>20} - {}", name, description);
213213
}
214-
println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
214+
println!("\nDefault passes for rustdoc:");
215215
for &name in DEFAULT_PASSES {
216216
println!("{:>20}", name);
217217
}

src/libserialize/json.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
//! Create a struct called `TestStruct` and serialize and deserialize it to and from JSON using the
7777
//! serialization API, using the derived serialization code.
7878
//!
79-
//! ```notrust
80-
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
79+
//! ```rust
8180
//! extern crate serialize;
8281
//! use serialize::json;
8382
//!
@@ -111,8 +110,7 @@
111110
//!
112111
//! ### Simple example of `ToJson` usage
113112
//!
114-
//! ```notrust
115-
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
113+
//! ```rust
116114
//! extern crate serialize;
117115
//! use serialize::json::{self, ToJson, Json};
118116
//!
@@ -151,8 +149,7 @@
151149
//!
152150
//! ### Verbose example of `ToJson` usage
153151
//!
154-
//! ```notrust
155-
//! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment
152+
//! ```rust
156153
//! extern crate serialize;
157154
//! use std::collections::BTreeMap;
158155
//! use serialize::json::{self, Json, ToJson};

src/libstd/sync/mutex.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,15 @@ mod tests {
536536
assert_eq!(*lock, 2);
537537
}
538538

539-
// FIXME(#25351) needs deeply nested coercions of DST structs.
540-
// #[test]
541-
// fn test_mutex_unsized() {
542-
// let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
543-
// {
544-
// let b = &mut *mutex.lock().unwrap();
545-
// b[0] = 4;
546-
// b[2] = 5;
547-
// }
548-
// let comp: &[i32] = &[4, 2, 5];
549-
// assert_eq!(&*mutex.lock().unwrap(), comp);
550-
// }
539+
#[test]
540+
fn test_mutex_unsized() {
541+
let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]);
542+
{
543+
let b = &mut *mutex.lock().unwrap();
544+
b[0] = 4;
545+
b[2] = 5;
546+
}
547+
let comp: &[i32] = &[4, 2, 5];
548+
assert_eq!(&*mutex.lock().unwrap(), comp);
549+
}
551550
}

src/libstd/sync/rwlock.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,17 @@ mod tests {
578578
assert_eq!(*lock, 2);
579579
}
580580

581-
// FIXME(#25351) needs deeply nested coercions of DST structs.
582-
// #[test]
583-
// fn test_rwlock_unsized() {
584-
// let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]);
585-
// {
586-
// let b = &mut *rw.write().unwrap();
587-
// b[0] = 4;
588-
// b[2] = 5;
589-
// }
590-
// let comp: &[i32] = &[4, 2, 5];
591-
// assert_eq!(&*rw.read().unwrap(), comp);
592-
// }
581+
#[test]
582+
fn test_rwlock_unsized() {
583+
let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]);
584+
{
585+
let b = &mut *rw.write().unwrap();
586+
b[0] = 4;
587+
b[2] = 5;
588+
}
589+
let comp: &[i32] = &[4, 2, 5];
590+
assert_eq!(&*rw.read().unwrap(), comp);
591+
}
593592

594593
#[test]
595594
fn test_rwlock_try_write() {

src/libstd/sys/common/wtf8.rs

+1-31
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use core::str::next_code_point;
3131
use ascii::*;
3232
use borrow::Cow;
3333
use char;
34-
use cmp;
3534
use fmt;
3635
use hash::{Hash, Hasher};
3736
use iter::FromIterator;
@@ -375,6 +374,7 @@ impl Extend<CodePoint> for Wtf8Buf {
375374
///
376375
/// Similar to `&str`, but can additionally contain surrogate code points
377376
/// if they’re not in a surrogate pair.
377+
#[derive(Eq, Ord, PartialEq, PartialOrd)]
378378
pub struct Wtf8 {
379379
bytes: [u8]
380380
}
@@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 {
383383
fn as_inner(&self) -> &[u8] { &self.bytes }
384384
}
385385

386-
// FIXME: https://github.com/rust-lang/rust/issues/18805
387-
impl PartialEq for Wtf8 {
388-
fn eq(&self, other: &Wtf8) -> bool { self.bytes.eq(&other.bytes) }
389-
}
390-
391-
// FIXME: https://github.com/rust-lang/rust/issues/18805
392-
impl Eq for Wtf8 {}
393-
394-
// FIXME: https://github.com/rust-lang/rust/issues/18738
395-
impl PartialOrd for Wtf8 {
396-
#[inline]
397-
fn partial_cmp(&self, other: &Wtf8) -> Option<cmp::Ordering> {
398-
self.bytes.partial_cmp(&other.bytes)
399-
}
400-
#[inline]
401-
fn lt(&self, other: &Wtf8) -> bool { self.bytes.lt(&other.bytes) }
402-
#[inline]
403-
fn le(&self, other: &Wtf8) -> bool { self.bytes.le(&other.bytes) }
404-
#[inline]
405-
fn gt(&self, other: &Wtf8) -> bool { self.bytes.gt(&other.bytes) }
406-
#[inline]
407-
fn ge(&self, other: &Wtf8) -> bool { self.bytes.ge(&other.bytes) }
408-
}
409-
410-
// FIXME: https://github.com/rust-lang/rust/issues/18738
411-
impl Ord for Wtf8 {
412-
#[inline]
413-
fn cmp(&self, other: &Wtf8) -> cmp::Ordering { self.bytes.cmp(&other.bytes) }
414-
}
415-
416386
/// Format the slice with double quotes,
417387
/// and surrogates as `\u` followed by four hexadecimal digits.
418388
/// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800]

src/rustbook/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ mod javascript;
3939

4040
static EXIT_STATUS: AtomicIsize = ATOMIC_ISIZE_INIT;
4141

42-
#[cfg(not(test))] // thanks #12327
4342
fn main() {
4443
let mut term = Term::new();
4544
let cmd: Vec<_> = env::args().collect();

src/test/bench/core-map.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ fn main() {
126126

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

129-
// FIXME: #9970
130-
println!("{}", "\nBTreeMap:");
129+
println!("\nBTreeMap:");
131130

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

148-
// FIXME: #9970
149-
println!("{}", "\nHashMap:");
147+
println!("\nHashMap:");
150148

151149
{
152150
let mut map: HashMap<usize,usize> = HashMap::new();

src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs

-3
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,9 @@ fn assign_field4<'a>(x: &'a mut Own<Point>) {
111111
x.y = 3; //~ ERROR cannot borrow
112112
}
113113

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

121118
fn deref_mut_method1(x: Own<Point>) {
122119
x.set(0, 0); //~ ERROR cannot borrow

src/test/compile-fail/feature-gated-feature-in-macro-arg.rs

-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// FIXME #20661: format_args! emits calls to the unstable std::fmt::rt
12-
// module, so the compiler has some hacks to make that possible
13-
// (in span_is_internal). Unnfortunately those hacks defeat this
14-
// particular scenario of checking feature gates in arguments to
15-
// println!().
16-
17-
// ignore-test
18-
1911
// tests that input to a macro is checked for use of gated features. If this
2012
// test succeeds due to the acceptance of a feature, pick a new feature to
2113
// test. Not ideal, but oh well :(

src/test/run-pass/issue-5060.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ macro_rules! print_hd_tl {
1616
print!("{}", stringify!($field_tl));
1717
print!(", ");
1818
)+
19-
// FIXME: #9970
20-
print!("{}", "]\n");
19+
print!("]\n");
2120
})
2221
}
2322

src/test/run-pass/lambda-var-hygiene.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test #9383
12-
1311
// shouldn't affect evaluation of $ex:
1412
macro_rules! bad_macro {
1513
($ex:expr) => ({(|_x| { $ex }) (9) })

src/test/rustdoc/hidden-line.rs

-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
/// retained.
1313
///
1414
/// ```rust
15-
/// mod to_make_deriving_work { // FIXME #4913
16-
///
1715
/// # #[derive(PartialEq)] // invisible
1816
/// # struct Foo; // invisible
1917
///
@@ -24,8 +22,6 @@
2422
/// let x = Bar(Foo);
2523
/// assert_eq!(x, x); // check that the derivings worked
2624
/// }
27-
///
28-
/// }
2925
/// ```
3026
pub fn foo() {}
3127

0 commit comments

Comments
 (0)