Skip to content

Commit c764d87

Browse files
---
yaml --- r: 274751 b: refs/heads/stable c: 84e0458 h: refs/heads/master i: 274749: 8af91b6 274747: 60a97fc 274743: a7156f6 274735: b852af0 274719: 704dbc7 274687: fe0a373
1 parent 98f9c37 commit c764d87

File tree

97 files changed

+1531
-1920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1531
-1920
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 060848c31534284ed06cd63c5dbb41e2e839d2b0
32+
refs/heads/stable: 84e0458c99b490d359facf6997db29399559c916
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ DEPS_rustc_passes := syntax rustc core rustc_front
106106
DEPS_rustc_mir := rustc rustc_front syntax
107107
DEPS_rustc_resolve := arena rustc rustc_front log syntax
108108
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
109-
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
109+
DEPS_rustc_plugin := rustc rustc_metadata syntax
110110
DEPS_rustc_privacy := rustc rustc_front log syntax
111111
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
112112
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics

branches/stable/src/doc/book/error-handling.md

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn map<F, T, A>(option: Option<T>, f: F) -> Option<A> where F: FnOnce(T) -> A {
265265
```
266266

267267
Indeed, `map` is [defined as a method][2] on `Option<T>` in the standard library.
268-
As a method, it has a slightly different signature: methods take `self`, `&self`,
268+
As a method, it has a slighly different signature: methods take `self`, `&self`,
269269
or `&mut self` as their first argument.
270270

271271
Armed with our new combinator, we can rewrite our `extension_explicit` method
@@ -1592,7 +1592,7 @@ fn print_usage(program: &str, opts: Options) {
15921592
15931593
fn main() {
15941594
let args: Vec<String> = env::args().collect();
1595-
let program = &args[0];
1595+
let program = args[0].clone();
15961596
15971597
let mut opts = Options::new();
15981598
opts.optflag("h", "help", "Show this usage message.");
@@ -1605,10 +1605,10 @@ fn main() {
16051605
print_usage(&program, opts);
16061606
return;
16071607
}
1608-
let data_path = &args[1];
1609-
let city = &args[2];
1608+
let data_path = args[1].clone();
1609+
let city = args[2].clone();
16101610
1611-
// Do stuff with information
1611+
// Do stuff with information
16121612
}
16131613
```
16141614

@@ -1640,6 +1640,7 @@ sure to add `extern crate csv;` to the top of your file.)
16401640

16411641
```rust,ignore
16421642
use std::fs::File;
1643+
use std::path::Path;
16431644
16441645
// This struct represents the data in each row of the CSV file.
16451646
// Type based decoding absolves us of a lot of the nitty gritty error
@@ -1665,7 +1666,7 @@ fn print_usage(program: &str, opts: Options) {
16651666
16661667
fn main() {
16671668
let args: Vec<String> = env::args().collect();
1668-
let program = &args[0];
1669+
let program = args[0].clone();
16691670
16701671
let mut opts = Options::new();
16711672
opts.optflag("h", "help", "Show this usage message.");
@@ -1677,24 +1678,25 @@ fn main() {
16771678
16781679
if matches.opt_present("h") {
16791680
print_usage(&program, opts);
1680-
return;
1681-
}
1681+
return;
1682+
}
16821683
1683-
let data_path = &args[1];
1684-
let city: &str = &args[2];
1684+
let data_file = args[1].clone();
1685+
let data_path = Path::new(&data_file);
1686+
let city = args[2].clone();
16851687
1686-
let file = File::open(data_path).unwrap();
1687-
let mut rdr = csv::Reader::from_reader(file);
1688+
let file = File::open(data_path).unwrap();
1689+
let mut rdr = csv::Reader::from_reader(file);
16881690
1689-
for row in rdr.decode::<Row>() {
1690-
let row = row.unwrap();
1691+
for row in rdr.decode::<Row>() {
1692+
let row = row.unwrap();
16911693
1692-
if row.city == city {
1693-
println!("{}, {}: {:?}",
1694-
row.city, row.country,
1695-
row.population.expect("population count"));
1696-
}
1697-
}
1694+
if row.city == city {
1695+
println!("{}, {}: {:?}",
1696+
row.city, row.country,
1697+
row.population.expect("population count"));
1698+
}
1699+
}
16981700
}
16991701
```
17001702

@@ -1743,8 +1745,6 @@ Note that we opt to handle the possibility of a missing population count by
17431745
simply ignoring that row.
17441746

17451747
```rust,ignore
1746-
use std::path::Path;
1747-
17481748
struct Row {
17491749
// unchanged
17501750
}
@@ -1782,26 +1782,27 @@ fn search<P: AsRef<Path>>(file_path: P, city: &str) -> Vec<PopulationCount> {
17821782
}
17831783
17841784
fn main() {
1785-
let args: Vec<String> = env::args().collect();
1786-
let program = &args[0];
1785+
let args: Vec<String> = env::args().collect();
1786+
let program = args[0].clone();
17871787
1788-
let mut opts = Options::new();
1789-
opts.optflag("h", "help", "Show this usage message.");
1788+
let mut opts = Options::new();
1789+
opts.optflag("h", "help", "Show this usage message.");
17901790
1791-
let matches = match opts.parse(&args[1..]) {
1792-
Ok(m) => { m }
1793-
Err(e) => { panic!(e.to_string()) }
1794-
};
1795-
if matches.opt_present("h") {
1796-
print_usage(&program, opts);
1797-
return;
1798-
}
1791+
let matches = match opts.parse(&args[1..]) {
1792+
Ok(m) => { m }
1793+
Err(e) => { panic!(e.to_string()) }
1794+
};
1795+
if matches.opt_present("h") {
1796+
print_usage(&program, opts);
1797+
return;
1798+
}
17991799
1800-
let data_path = &args[1];
1801-
let city = &args[2];
1802-
for pop in search(data_path, city) {
1803-
println!("{}, {}: {:?}", pop.city, pop.country, pop.count);
1804-
}
1800+
let data_file = args[1].clone();
1801+
let data_path = Path::new(&data_file);
1802+
let city = args[2].clone();
1803+
for pop in search(&data_path, &city) {
1804+
println!("{}, {}: {:?}", pop.city, pop.country, pop.count);
1805+
}
18051806
}
18061807
18071808
```
@@ -1911,7 +1912,7 @@ First, here's the new usage:
19111912

19121913
```rust,ignore
19131914
fn print_usage(program: &str, opts: Options) {
1914-
println!("{}", opts.usage(&format!("Usage: {} [options] <city>", program)));
1915+
println!("{}", opts.usage(&format!("Usage: {} [options] <city>", program)));
19151916
}
19161917
```
19171918
The next part is going to be only a little harder:
@@ -1923,16 +1924,16 @@ opts.optopt("f", "file", "Choose an input file, instead of using STDIN.", "NAME"
19231924
opts.optflag("h", "help", "Show this usage message.");
19241925
...
19251926
let file = matches.opt_str("f");
1926-
let data_file = &file.as_ref().map(Path::new);
1927+
let data_file = file.as_ref().map(Path::new);
19271928
19281929
let city = if !matches.free.is_empty() {
1929-
&matches.free[0]
1930+
matches.free[0].clone()
19301931
} else {
1931-
print_usage(&program, opts);
1932-
return;
1932+
print_usage(&program, opts);
1933+
return;
19331934
};
19341935
1935-
match search(data_file, city) {
1936+
match search(&data_file, &city) {
19361937
Ok(pops) => {
19371938
for pop in pops {
19381939
println!("{}, {}: {:?}", pop.city, pop.country, pop.count);

branches/stable/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Arc<T> {
879879
}
880880

881881
#[stable(feature = "rust1", since = "1.0.0")]
882-
impl<T: ?Sized> fmt::Pointer for Arc<T> {
882+
impl<T> fmt::Pointer for Arc<T> {
883883
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
884884
fmt::Pointer::fmt(&*self._ptr, f)
885885
}

branches/stable/src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ impl<T: fmt::Debug + ?Sized> fmt::Debug for Box<T> {
442442
}
443443

444444
#[stable(feature = "rust1", since = "1.0.0")]
445-
impl<T: ?Sized> fmt::Pointer for Box<T> {
445+
impl<T> fmt::Pointer for Box<T> {
446446
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
447447
// It's not possible to extract the inner Uniq directly from the Box,
448448
// instead we cast it to a *const which aliases the Unique

branches/stable/src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Rc<T> {
688688
}
689689

690690
#[stable(feature = "rust1", since = "1.0.0")]
691-
impl<T: ?Sized> fmt::Pointer for Rc<T> {
691+
impl<T> fmt::Pointer for Rc<T> {
692692
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
693693
fmt::Pointer::fmt(&*self._ptr, f)
694694
}

branches/stable/src/libbacktrace/ansidecl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ANSI and traditional C compatibility macros
1+
/* ANSI and traditional C compatability macros
22
Copyright (C) 1991-2015 Free Software Foundation, Inc.
33
This file is part of the GNU C Library.
44

branches/stable/src/libcollections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// }
2929
// ```
3030
//
31-
// Since Rust doesn't actually have dependent types and polymorphic recursion,
31+
// Since Rust doesn't acutally have dependent types and polymorphic recursion,
3232
// we make do with lots of unsafety.
3333

3434
use alloc::heap;

branches/stable/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ impl str {
18081808
// Σ maps to σ, except at the end of a word where it maps to ς.
18091809
// This is the only conditional (contextual) but language-independent mapping
18101810
// in `SpecialCasing.txt`,
1811-
// so hard-code it rather than have a generic "condition" mechanism.
1811+
// so hard-code it rather than have a generic "condition" mechanim.
18121812
// See https://github.com/rust-lang/rust/issues/26035
18131813
map_uppercase_sigma(self, i, &mut s)
18141814
} else {

branches/stable/src/libcollections/string.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ use boxed::Box;
193193
/// mem::forget(story);
194194
///
195195
/// // We can re-build a String out of ptr, len, and capacity. This is all
196-
/// // unsafe because we are responsible for making sure the components are
196+
/// // unsafe becuase we are responsible for making sure the components are
197197
/// // valid:
198198
/// let s = unsafe { String::from_raw_parts(ptr as *mut _, len, capacity) } ;
199199
///
@@ -1842,12 +1842,6 @@ impl fmt::Write for String {
18421842
}
18431843

18441844
/// A draining iterator for `String`.
1845-
///
1846-
/// This struct is created by the [`drain()`] method on [`String`]. See its
1847-
/// documentation for more.
1848-
///
1849-
/// [`drain()`]: struct.String.html#method.drain
1850-
/// [`String`]: struct.String.html
18511845
#[stable(feature = "drain", since = "1.6.0")]
18521846
pub struct Drain<'a> {
18531847
/// Will be used as &'a mut String in the destructor

branches/stable/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,39 +1968,7 @@ impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
19681968
#[stable(feature = "rust1", since = "1.0.0")]
19691969
impl<A: PartialEq> PartialEq for VecDeque<A> {
19701970
fn eq(&self, other: &VecDeque<A>) -> bool {
1971-
if self.len() != other.len() {
1972-
return false;
1973-
}
1974-
let (sa, sb) = self.as_slices();
1975-
let (oa, ob) = other.as_slices();
1976-
if sa.len() == oa.len() {
1977-
sa == oa && sb == ob
1978-
} else if sa.len() < oa.len() {
1979-
// Always divisible in three sections, for example:
1980-
// self: [a b c|d e f]
1981-
// other: [0 1 2 3|4 5]
1982-
// front = 3, mid = 1,
1983-
// [a b c] == [0 1 2] && [d] == [3] && [e f] == [4 5]
1984-
let front = sa.len();
1985-
let mid = oa.len() - front;
1986-
1987-
let (oa_front, oa_mid) = oa.split_at(front);
1988-
let (sb_mid, sb_back) = sb.split_at(mid);
1989-
debug_assert_eq!(sa.len(), oa_front.len());
1990-
debug_assert_eq!(sb_mid.len(), oa_mid.len());
1991-
debug_assert_eq!(sb_back.len(), ob.len());
1992-
sa == oa_front && sb_mid == oa_mid && sb_back == ob
1993-
} else {
1994-
let front = oa.len();
1995-
let mid = sa.len() - front;
1996-
1997-
let (sa_front, sa_mid) = sa.split_at(front);
1998-
let (ob_mid, ob_back) = ob.split_at(mid);
1999-
debug_assert_eq!(sa_front.len(), oa.len());
2000-
debug_assert_eq!(sa_mid.len(), ob_mid.len());
2001-
debug_assert_eq!(sb.len(), ob_back.len());
2002-
sa_front == oa && sa_mid == ob_mid && sb == ob_back
2003-
}
1971+
self.len() == other.len() && self.iter().zip(other).all(|(a, b)| a.eq(b))
20041972
}
20051973
}
20061974

branches/stable/src/libcollectionstest/vec_deque.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -624,33 +624,6 @@ fn test_hash_after_rotation() {
624624
}
625625
}
626626

627-
#[test]
628-
fn test_eq_after_rotation() {
629-
// test that two deques are equal even if elements are laid out differently
630-
let len = 28;
631-
let mut ring: VecDeque<i32> = (0..len as i32).collect();
632-
let mut shifted = ring.clone();
633-
for _ in 0..10 {
634-
// shift values 1 step to the right by pop, sub one, push
635-
ring.pop_front();
636-
for elt in &mut ring {
637-
*elt -= 1;
638-
}
639-
ring.push_back(len - 1);
640-
}
641-
642-
// try every shift
643-
for _ in 0..shifted.capacity() {
644-
shifted.pop_front();
645-
for elt in &mut shifted {
646-
*elt -= 1;
647-
}
648-
shifted.push_back(len - 1);
649-
assert_eq!(shifted, ring);
650-
assert_eq!(ring, shifted);
651-
}
652-
}
653-
654627
#[test]
655628
fn test_ord() {
656629
let x = VecDeque::new();

branches/stable/src/libcore/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//!
2020
//! - Impl the `As*` traits for reference-to-reference conversions
2121
//! - Impl the `Into` trait when you want to consume the value in the conversion
22-
//! - The `From` trait is the most flexible, useful for values _and_ references conversions
22+
//! - The `From` trait is the most flexible, usefull for values _and_ references conversions
2323
//!
2424
//! As a library writer, you should prefer implementing `From<T>` rather than
2525
//! `Into<U>`, as `From` provides greater flexibility and offer the equivalent `Into`

branches/stable/src/libcore/fmt/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ impl Display for char {
13841384
}
13851385

13861386
#[stable(feature = "rust1", since = "1.0.0")]
1387-
impl<T: ?Sized> Pointer for *const T {
1387+
impl<T> Pointer for *const T {
13881388
fn fmt(&self, f: &mut Formatter) -> Result {
13891389
let old_width = f.width;
13901390
let old_flags = f.flags;
@@ -1402,7 +1402,7 @@ impl<T: ?Sized> Pointer for *const T {
14021402
}
14031403
f.flags |= 1 << (FlagV1::Alternate as u32);
14041404

1405-
let ret = LowerHex::fmt(&(*self as *const () as usize), f);
1405+
let ret = LowerHex::fmt(&(*self as usize), f);
14061406

14071407
f.width = old_width;
14081408
f.flags = old_flags;
@@ -1412,21 +1412,21 @@ impl<T: ?Sized> Pointer for *const T {
14121412
}
14131413

14141414
#[stable(feature = "rust1", since = "1.0.0")]
1415-
impl<T: ?Sized> Pointer for *mut T {
1415+
impl<T> Pointer for *mut T {
14161416
fn fmt(&self, f: &mut Formatter) -> Result {
14171417
Pointer::fmt(&(*self as *const T), f)
14181418
}
14191419
}
14201420

14211421
#[stable(feature = "rust1", since = "1.0.0")]
1422-
impl<'a, T: ?Sized> Pointer for &'a T {
1422+
impl<'a, T> Pointer for &'a T {
14231423
fn fmt(&self, f: &mut Formatter) -> Result {
14241424
Pointer::fmt(&(*self as *const T), f)
14251425
}
14261426
}
14271427

14281428
#[stable(feature = "rust1", since = "1.0.0")]
1429-
impl<'a, T: ?Sized> Pointer for &'a mut T {
1429+
impl<'a, T> Pointer for &'a mut T {
14301430
fn fmt(&self, f: &mut Formatter) -> Result {
14311431
Pointer::fmt(&(&**self as *const T), f)
14321432
}

0 commit comments

Comments
 (0)