Skip to content

Commit 72f5973

Browse files
committed
Test fixes and rebase conflicts, round 3
1 parent 50b3ecf commit 72f5973

File tree

18 files changed

+156
-153
lines changed

18 files changed

+156
-153
lines changed

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#![feature(unsafe_no_drop_flag, filling_drop)]
7979
#![feature(core)]
8080
#![feature(unique)]
81-
#![feature(convert)]
8281
#![cfg_attr(test, feature(test, alloc, rustc_private))]
8382
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
8483
feature(libc))]

src/libcollections/str.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
//! Unicode string manipulation (the `str` type).
1414
//!
15-
//! Rust's `str` type is one of the core primitive types of the language. `&str` is the borrowed
16-
//! string type. This type of string can only be created from other strings, unless it is a
17-
//! `&'static str` (see below). It is not possible to move out of borrowed strings because they are
18-
//! owned elsewhere.
15+
//! Rust's `str` type is one of the core primitive types of the language. `&str`
16+
//! is the borrowed string type. This type of string can only be created from
17+
//! other strings, unless it is a `&'static str` (see below). It is not possible
18+
//! to move out of borrowed strings because they are owned elsewhere.
1919
//!
2020
//! # Examples
2121
//!
@@ -25,8 +25,9 @@
2525
//! let s = "Hello, world.";
2626
//! ```
2727
//!
28-
//! This `&str` is a `&'static str`, which is the type of string literals. They're `'static`
29-
//! because literals are available for the entire lifetime of the program.
28+
//! This `&str` is a `&'static str`, which is the type of string literals.
29+
//! They're `'static` because literals are available for the entire lifetime of
30+
//! the program.
3031
//!
3132
//! You can get a non-`'static` `&str` by taking a slice of a `String`:
3233
//!
@@ -37,12 +38,13 @@
3738
//!
3839
//! # Representation
3940
//!
40-
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a stream of UTF-8
41-
//! bytes. All [strings](../../reference.html#literals) are guaranteed to be validly encoded UTF-8
42-
//! sequences. Additionally, strings are not null-terminated and can thus contain null bytes.
41+
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as
42+
//! a stream of UTF-8 bytes. All [strings](../../reference.html#literals) are
43+
//! guaranteed to be validly encoded UTF-8 sequences. Additionally, strings are
44+
//! not null-terminated and can thus contain null bytes.
4345
//!
44-
//! The actual representation of `str`s have direct mappings to slices: `&str` is the same as
45-
//! `&[u8]`.
46+
//! The actual representation of `str`s have direct mappings to slices: `&str`
47+
//! is the same as `&[u8]`.
4648
4749
#![doc(primitive = "str")]
4850
#![stable(feature = "rust1", since = "1.0.0")]

src/libcore/iter.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141
//! }
4242
//!
4343
//! // Rough translation of the iteration without a `for` iterator.
44+
//! # let values = vec![1, 2, 3];
4445
//! let mut it = values.into_iter();
4546
//! loop {
4647
//! match it.next() {
47-
//! Some(&x) => {
48+
//! Some(x) => {
4849
//! println!("{}", x);
4950
//! }
5051
//! None => { break }

src/librbml/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
html_root_url = "http://doc.rust-lang.org/nightly/",
124124
html_playground_url = "http://play.rust-lang.org/")]
125125

126-
#![feature(io)]
127126
#![feature(core)]
128127
#![feature(rustc_private)]
129128
#![feature(staged_api)]

src/librustc/middle/ty.rs

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ use std::cmp;
7373
use std::fmt;
7474
use std::hash::{Hash, SipHasher, Hasher};
7575
use std::mem;
76-
use std::num::ToPrimitive;
7776
use std::ops;
7877
use std::rc::Rc;
7978
use std::vec::IntoIter;

src/libstd/io/buffered.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -503,34 +503,34 @@ mod tests {
503503

504504
let mut buf = [0, 0, 0];
505505
let nread = reader.read(&mut buf);
506-
assert_eq!(Ok(3), nread);
506+
assert_eq!(nread.unwrap(), 3);
507507
let b: &[_] = &[5, 6, 7];
508508
assert_eq!(buf, b);
509509

510510
let mut buf = [0, 0];
511511
let nread = reader.read(&mut buf);
512-
assert_eq!(Ok(2), nread);
512+
assert_eq!(nread.unwrap(), 2);
513513
let b: &[_] = &[0, 1];
514514
assert_eq!(buf, b);
515515

516516
let mut buf = [0];
517517
let nread = reader.read(&mut buf);
518-
assert_eq!(Ok(1), nread);
518+
assert_eq!(nread.unwrap(), 1);
519519
let b: &[_] = &[2];
520520
assert_eq!(buf, b);
521521

522522
let mut buf = [0, 0, 0];
523523
let nread = reader.read(&mut buf);
524-
assert_eq!(Ok(1), nread);
524+
assert_eq!(nread.unwrap(), 1);
525525
let b: &[_] = &[3, 0, 0];
526526
assert_eq!(buf, b);
527527

528528
let nread = reader.read(&mut buf);
529-
assert_eq!(Ok(1), nread);
529+
assert_eq!(nread.unwrap(), 1);
530530
let b: &[_] = &[4, 0, 0];
531531
assert_eq!(buf, b);
532532

533-
assert_eq!(reader.read(&mut buf), Ok(0));
533+
assert_eq!(reader.read(&mut buf).unwrap(), 0);
534534
}
535535

536536
#[test]
@@ -592,7 +592,7 @@ mod tests {
592592
}
593593

594594
let mut stream = BufStream::new(S);
595-
assert_eq!(stream.read(&mut [0; 10]), Ok(0));
595+
assert_eq!(stream.read(&mut [0; 10]).unwrap(), 0);
596596
stream.write(&[0; 10]).unwrap();
597597
stream.flush().unwrap();
598598
}
@@ -658,41 +658,41 @@ mod tests {
658658
let in_buf: &[u8] = b"a\nb\nc";
659659
let reader = BufReader::with_capacity(2, in_buf);
660660
let mut it = reader.lines();
661-
assert_eq!(it.next(), Some(Ok("a".to_string())));
662-
assert_eq!(it.next(), Some(Ok("b".to_string())));
663-
assert_eq!(it.next(), Some(Ok("c".to_string())));
664-
assert_eq!(it.next(), None);
661+
assert_eq!(it.next().unwrap().unwrap(), "a".to_string());
662+
assert_eq!(it.next().unwrap().unwrap(), "b".to_string());
663+
assert_eq!(it.next().unwrap().unwrap(), "c".to_string());
664+
assert!(it.next().is_none());
665665
}
666666

667667
#[test]
668668
fn test_short_reads() {
669669
let inner = ShortReader{lengths: vec![0, 1, 2, 0, 1, 0]};
670670
let mut reader = BufReader::new(inner);
671671
let mut buf = [0, 0];
672-
assert_eq!(reader.read(&mut buf), Ok(0));
673-
assert_eq!(reader.read(&mut buf), Ok(1));
674-
assert_eq!(reader.read(&mut buf), Ok(2));
675-
assert_eq!(reader.read(&mut buf), Ok(0));
676-
assert_eq!(reader.read(&mut buf), Ok(1));
677-
assert_eq!(reader.read(&mut buf), Ok(0));
678-
assert_eq!(reader.read(&mut buf), Ok(0));
672+
assert_eq!(reader.read(&mut buf).unwrap(), 0);
673+
assert_eq!(reader.read(&mut buf).unwrap(), 1);
674+
assert_eq!(reader.read(&mut buf).unwrap(), 2);
675+
assert_eq!(reader.read(&mut buf).unwrap(), 0);
676+
assert_eq!(reader.read(&mut buf).unwrap(), 1);
677+
assert_eq!(reader.read(&mut buf).unwrap(), 0);
678+
assert_eq!(reader.read(&mut buf).unwrap(), 0);
679679
}
680680

681681
#[test]
682682
fn read_char_buffered() {
683683
let buf = [195, 159];
684684
let reader = BufReader::with_capacity(1, &buf[..]);
685-
assert_eq!(reader.chars().next(), Some(Ok('ß')));
685+
assert_eq!(reader.chars().next().unwrap().unwrap(), 'ß');
686686
}
687687

688688
#[test]
689689
fn test_chars() {
690690
let buf = [195, 159, b'a'];
691691
let reader = BufReader::with_capacity(1, &buf[..]);
692692
let mut it = reader.chars();
693-
assert_eq!(it.next(), Some(Ok('ß')));
694-
assert_eq!(it.next(), Some(Ok('a')));
695-
assert_eq!(it.next(), None);
693+
assert_eq!(it.next().unwrap().unwrap(), 'ß');
694+
assert_eq!(it.next().unwrap().unwrap(), 'a');
695+
assert!(it.next().is_none());
696696
}
697697

698698
#[test]

0 commit comments

Comments
 (0)