Skip to content

Commit 2509948

Browse files
committed
Auto merge of #29610 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29416, #29537, #29538, #29539, #29567, #29568, #29571, #29579 - Failed merges:
2 parents 792a9f1 + 05cbfa4 commit 2509948

File tree

12 files changed

+853
-578
lines changed

12 files changed

+853
-578
lines changed

RELEASES.md

+179
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,182 @@
1+
Version 1.4.0 (2015-10-29)
2+
============================
3+
4+
* ~1200 changes, numerous bugfixes
5+
6+
Highlights
7+
----------
8+
9+
* Windows builds targeting the 64-bit MSVC ABI and linker (instead of
10+
GNU) are now supported and recommended for use.
11+
12+
Breaking Changes
13+
----------------
14+
15+
* [Several changes have been made to fix type soundness and improve
16+
the behavior of associated types][sound]. See [RFC 1214]. Although
17+
we have mostly introduced these changes as warnings this release, to
18+
become errors next release, there are still some scenarios that will
19+
see immediate breakage.
20+
* [The `str::lines` and `BufRead::lines` iterators treat `\r\n` as
21+
line breaks in addition to `\n`][crlf].
22+
* [Loans of `'static` lifetime extend to the end of a function][stat].
23+
* [`str::parse` no longer introduces avoidable rounding error when
24+
parsing floating point numbers. Together with earlier changes to
25+
float formatting/output, "round trips" like f.to_string().parse()
26+
now preserve the value of f exactly. Additionally, leading plus
27+
signs are now accepted][fp3].
28+
29+
30+
Language
31+
--------
32+
33+
* `use` statements that import multiple items [can now rename
34+
them][i], as in `use foo::{bar as kitten, baz as puppy}`.
35+
* [Binops work correctly on fat pointers][binfat].
36+
* `pub extern crate`, which does not behave as expected, [issues a
37+
warning][pec] until a better solution is found.
38+
39+
Libraries
40+
---------
41+
42+
* [Many APIs were stabilized][stab]: `<Box<str>>::into_string`,
43+
[`Arc::downgrade`], [`Arc::get_mut`], [`Arc::make_mut`],
44+
[`Arc::try_unwrap`], [`Box::from_raw`], [`Box::into_raw`], [`CStr::to_str`],
45+
[`CStr::to_string_lossy`], [`CString::from_raw`], [`CString::into_raw`],
46+
[`IntoRawFd::into_raw_fd`], [`IntoRawFd`],
47+
`IntoRawHandle::into_raw_handle`, `IntoRawHandle`,
48+
`IntoRawSocket::into_raw_socket`, `IntoRawSocket`, [`Rc::downgrade`],
49+
[`Rc::get_mut`], [`Rc::make_mut`], [`Rc::try_unwrap`], [`Result::expect`],
50+
[`String::into_boxed_str`], [`TcpStream::read_timeout`],
51+
[`TcpStream::set_read_timeout`], [`TcpStream::set_write_timeout`],
52+
[`TcpStream::write_timeout`], [`UdpSocket::read_timeout`],
53+
[`UdpSocket::set_read_timeout`], [`UdpSocket::set_write_timeout`],
54+
[`UdpSocket::write_timeout`], `Vec::append`, `Vec::split_off`,
55+
[`VecDeque::append`], [`VecDeque::retain`], [`VecDeque::split_off`],
56+
[`rc::Weak::upgrade`], [`rc::Weak`], [`slice::Iter::as_slice`],
57+
[`slice::IterMut::into_slice`], [`str::CharIndices::as_str`],
58+
[`str::Chars::as_str`], [`str::split_at_mut`], [`str::split_at`],
59+
[`sync::Weak::upgrade`], [`sync::Weak`], [`thread::park_timeout`],
60+
[`thread::sleep`].
61+
* [Some APIs were deprecated][dep]: `BTreeMap::with_b`,
62+
`BTreeSet::with_b`, `Option::as_mut_slice`, `Option::as_slice`,
63+
`Result::as_mut_slice`, `Result::as_slice`, `f32::from_str_radix`,
64+
`f64::from_str_radix`.
65+
* [Reverse-searching strings is faster with the 'two-way'
66+
algorithm][s].
67+
* [`std::io::copy` allows `?Sized` arguments][cc].
68+
* The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all
69+
[override `count`, `nth` and `last` with an O(1)
70+
implementation][it].
71+
* [`Default` is implemented for arrays up to `[T; 32]`][d].
72+
* [`IntoRawFd` has been added to the Unix-specific prelude,
73+
`IntoRawSocket` and `IntoRawHandle` to the Windows-specific
74+
prelude][pr].
75+
* [`Extend<String>` and `FromIterator<String` are both implemented for
76+
`String`][es].
77+
* [`IntoIterator` is implemented for references to `Option` and
78+
`Result`][into2].
79+
* [`HashMap` and `HashSet` implement `Extend<&T>` where `T:
80+
Copy`][ext] as part of [RFC 839]. This will cause type inferance
81+
breakage in rare situations.
82+
* [`BinaryHeap` implements `Debug`][bh2].
83+
* [`Borrow` and `BorrowMut` are implemented for fixed-size
84+
arrays][bm].
85+
* [`extern fn`s with the "Rust" and "C" ABIs implement common
86+
traits including `Eq`, `Ord`, `Debug`, `Hash`][fp].
87+
* [String comparison is faster][faststr].
88+
* `&mut T` where `T: std::fmt::Write` [also implements
89+
`std::fmt::Write`][mutw].
90+
* [A stable regression in `VecDeque::push_back` and other
91+
capicity-altering methods that caused panics for zero-sized types
92+
was fixed][vd].
93+
* [Function pointers implement traits for up to 12 parameters][fp2].
94+
95+
Miscellaneous
96+
-------------
97+
98+
* The compiler [no longer uses the 'morestack' feature to prevent
99+
stack overflow][mm]. Instead it uses guard pages and stack
100+
probes (though stack probes are not yet implemented on any platform
101+
but Windows).
102+
* [The compiler matches traits faster when projections are involved][p].
103+
* The 'improper_ctypes' lint [no longer warns about use of `isize` and
104+
`usize`][ffi].
105+
* [Cargo now displays useful information about what its doing during
106+
`cargo update`][cu].
107+
108+
[`Arc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.downgrade
109+
[`Arc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.make_mut
110+
[`Arc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.get_mut
111+
[`Arc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.try_unwrap
112+
[`Box::from_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.from_raw
113+
[`Box::into_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.into_raw
114+
[`CStr::to_str`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_str
115+
[`CStr::to_string_lossy`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_string_lossy
116+
[`CString::from_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.from_raw
117+
[`CString::into_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.into_raw
118+
[`IntoRawFd::into_raw_fd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html#tymethod.into_raw_fd
119+
[`IntoRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html
120+
[`Rc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.downgrade
121+
[`Rc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.get_mut
122+
[`Rc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.make_mut
123+
[`Rc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.try_unwrap
124+
[`Result::expect`]: http://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.expect
125+
[`String::into_boxed_str`]: http://doc.rust-lang.org/nightly/collections/string/struct.String.html#method.into_boxed_str
126+
[`TcpStream::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout
127+
[`TcpStream::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout
128+
[`TcpStream::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout
129+
[`TcpStream::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout
130+
[`UdpSocket::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout
131+
[`UdpSocket::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout
132+
[`UdpSocket::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout
133+
[`UdpSocket::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout
134+
[`VecDeque::append`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.append
135+
[`VecDeque::retain`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.retain
136+
[`VecDeque::split_off`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.split_off
137+
[`rc::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html#method.upgrade
138+
[`rc::Weak`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html
139+
[`slice::Iter::as_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#method.as_slice
140+
[`slice::IterMut::into_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.IterMut.html#method.into_slice
141+
[`str::CharIndices::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.as_str
142+
[`str::Chars::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.Chars.html#method.as_str
143+
[`str::split_at_mut`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut
144+
[`str::split_at`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at
145+
[`sync::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html#method.upgrade
146+
[`sync::Weak`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html
147+
[`thread::park_timeout`]: http://doc.rust-lang.org/nightly/std/thread/fn.park_timeout.html
148+
[`thread::sleep`]: http://doc.rust-lang.org/nightly/std/thread/fn.sleep.html
149+
[bh2]: https://github.com/rust-lang/rust/pull/28156
150+
[binfat]: https://github.com/rust-lang/rust/pull/28270
151+
[bm]: https://github.com/rust-lang/rust/pull/28197
152+
[cc]: https://github.com/rust-lang/rust/pull/27531
153+
[crlf]: https://github.com/rust-lang/rust/pull/28034
154+
[cu]: https://github.com/rust-lang/cargo/pull/1931
155+
[d]: https://github.com/rust-lang/rust/pull/27825
156+
[dep]: https://github.com/rust-lang/rust/pull/28339
157+
[es]: https://github.com/rust-lang/rust/pull/27956
158+
[ext]: https://github.com/rust-lang/rust/pull/28094
159+
[faststr]: https://github.com/rust-lang/rust/pull/28338
160+
[ffi]: https://github.com/rust-lang/rust/pull/28779
161+
[fp]: https://github.com/rust-lang/rust/pull/28268
162+
[fp2]: https://github.com/rust-lang/rust/pull/28560
163+
[fp3]: https://github.com/rust-lang/rust/pull/27307
164+
[i]: https://github.com/rust-lang/rust/pull/27451
165+
[into2]: https://github.com/rust-lang/rust/pull/28039
166+
[it]: https://github.com/rust-lang/rust/pull/27652
167+
[mm]: https://github.com/rust-lang/rust/pull/27338
168+
[mutw]: https://github.com/rust-lang/rust/pull/28368
169+
[sound]: https://github.com/rust-lang/rust/pull/27641
170+
[p]: https://github.com/rust-lang/rust/pull/27866
171+
[pec]: https://github.com/rust-lang/rust/pull/28486
172+
[pr]: https://github.com/rust-lang/rust/pull/27896
173+
[RFC 839]: https://github.com/rust-lang/rfcs/blob/master/text/0839-embrace-extend-extinguish.md
174+
[RFC 1214]: https://github.com/rust-lang/rfcs/blob/master/text/1214-projections-lifetimes-and-wf.md
175+
[s]: https://github.com/rust-lang/rust/pull/27474
176+
[stab]: https://github.com/rust-lang/rust/pull/28339
177+
[stat]: https://github.com/rust-lang/rust/pull/28321
178+
[vd]: https://github.com/rust-lang/rust/pull/28494
179+
1180
Version 1.3.0 (2015-09-17)
2181
==============================
3182

src/doc/trpl/SUMMARY.md

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Summary
22

33
* [Getting Started](getting-started.md)
4-
* [Installing Rust](installing-rust.md)
5-
* [Hello, world!](hello-world.md)
6-
* [Hello, Cargo!](hello-cargo.md)
74
* [Learn Rust](learn-rust.md)
85
* [Guessing Game](guessing-game.md)
96
* [Dining Philosophers](dining-philosophers.md)

src/doc/trpl/error-handling.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1605,14 +1605,11 @@ arguments.
16051605

16061606
## Writing the logic
16071607

1608-
We're all different in how we write code, but error handling is
1609-
usually the last thing we want to think about. This isn't very good
1610-
practice for good design, but it can be useful for rapidly
1611-
prototyping. In our case, because Rust forces us to be explicit about
1612-
error handling, it will also make it obvious what parts of our program
1613-
can cause errors. Why? Because Rust will make us call `unwrap`! This
1614-
can give us a nice bird's eye view of how we need to approach error
1615-
handling.
1608+
We all write code differently, but error handling is usually the last thing we
1609+
want to think about. This isn't great for the overall design of a program, but
1610+
it can be useful for rapid prototyping. Because Rust forces us to be explicit
1611+
about error handling (by making us call `unwrap`), it is easy to see which
1612+
parts of our program can cause errors.
16161613

16171614
In this case study, the logic is really simple. All we need to do is parse the
16181615
CSV data given to us and print out a field in matching rows. Let's do it. (Make

0 commit comments

Comments
 (0)