Skip to content

Commit fc54e23

Browse files
committed
---
yaml --- r: 210459 b: refs/heads/try c: 00204e8 h: refs/heads/master i: 210457: a333428 210455: a0fc35a v: v3
1 parent e5c0d45 commit fc54e23

Some content is hidden

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

59 files changed

+297
-239
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: b210aea1d446dcc9d05d0072c439575f9649d9f9
5+
refs/heads/try: 00204e8a83c097d7a5ad4643ee6b138a1bb0de1a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ Luke Francl <[email protected]>
518518
Luke Metz <[email protected]>
519519
Luke Steensen <[email protected]>
520520
Luqman Aden <[email protected]>
521-
Łukasz Niemier <[email protected]>
522521
Magnus Auvinen <[email protected]>
523522
Mahmut Bulut <[email protected]>
524523
Makoto Nakashima <[email protected]>
@@ -998,4 +997,5 @@ xales <[email protected]>
998997
999998
1000999
1000+
Łukasz Niemier <[email protected]>
10011001

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ then
844844
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
845845
if [ $? -eq 0 ]
846846
then
847-
step_msg "on OS X >=10.9, forcing use of clang"
847+
step_msg "on OS X 10.9, forcing use of clang"
848848
CFG_ENABLE_CLANG=1
849849
else
850850
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then

branches/try/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PKG_FILES := \
5252
doc \
5353
driver \
5454
etc \
55+
error-index-generator \
5556
$(foreach crate,$(CRATES),lib$(crate)) \
5657
libcollectionstest \
5758
libcoretest \

branches/try/src/doc/trpl/guessing-game.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,11 @@ rand="0.3.0"
358358
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
359359
everything that follows it is part of it, until the next section starts.
360360
Cargo uses the dependencies section to know what dependencies on external
361-
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
362-
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
363-
numbers. If we wanted to use the latest version we could use `*` or we could use a range
364-
of versions. [Cargo’s documentation][cargodoc] contains more details.
361+
crates you have, and what versions you require. In this case, we’ve used `*`,
362+
which means that we’ll use the latest version of `rand`. Cargo understands
363+
[Semantic Versioning][semver], which is a standard for writing version
364+
numbers. If we wanted a specific version or range of versions, we could be
365+
more specific here. [Cargo’s documentation][cargodoc] contains more details.
365366

366367
[semver]: http://semver.org
367368
[cargodoc]: http://doc.crates.io/crates-io.html
@@ -409,7 +410,7 @@ $ cargo build
409410
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
410411
```
411412

412-
So, we told Cargo we wanted any `0.3.x` version of `rand`, and so it fetched the latest
413+
So, we told Cargo we wanted any version of `rand`, and so it fetched the latest
413414
version at the time this was written, `v0.3.8`. But what happens when next
414415
week, version `v0.3.9` comes out, with an important bugfix? While getting
415416
bugfixes is important, what if `0.3.9` contains a regression that breaks our

branches/try/src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn main() {
116116
}
117117
```
118118

119-
[structs]: structs.html
119+
[struct]: structs.html
120120

121121
As you can see, `struct`s can also have lifetimes. In a similar way to functions,
122122

branches/try/src/doc/trpl/method-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ struct CircleBuilder {
188188
189189
impl CircleBuilder {
190190
fn new() -> CircleBuilder {
191-
CircleBuilder { x: 0.0, y: 0.0, radius: 1.0, }
191+
CircleBuilder { x: 0.0, y: 0.0, radius: 0.0, }
192192
}
193193
194194
fn x(&mut self, coordinate: f64) -> &mut CircleBuilder {

branches/try/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ safety, and the mechanism by which Rust guarantees it, the
8585
> You may have one or the other of these two kinds of borrows, but not both at
8686
> the same time:
8787
>
88-
> * one or more references (`&T`) to a resource.
88+
> * 0 to N references (`&T`) to a resource.
8989
> * exactly one mutable reference (`&mut T`)
9090
9191
[ownership]: ownership.html

branches/try/src/doc/trpl/ownership.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This guide is one of three presenting Rust’s ownership system. This is one of
44
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
6-
memory safety. There are a few distinct concepts, each with its own
6+
memory safety. The there are a few distinct concepts, each with its own
77
chapter:
88

99
* ownership, which you’re reading now.
@@ -59,7 +59,6 @@ deterministically, at the end of the scope.
5959

6060
[vect]: ../std/vec/struct.Vec.html
6161
[heap]: the-stack-and-the-heap.html
62-
[bindings]: variable-bindings.html
6362

6463
# Move semantics
6564

@@ -123,7 +122,7 @@ let v2 = v;
123122

124123
The first line creates some data for the vector on the [stack][sh], `v`. The
125124
vector’s data, however, is stored on the [heap][sh], and so it contains a
126-
pointer to that data. When we move `v` to `v2`, it creates a copy of that pointer,
125+
pointer to that data. When we move `v` to `v2`, it creates a copy of that data,
127126
for `v2`. Which would mean two pointers to the contents of the vector on the
128127
heap. That would be a problem: it would violate Rust’s safety guarantees by
129128
introducing a data race. Therefore, Rust forbids using `v` after we’ve done the

branches/try/src/doc/trpl/references-and-borrowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This guide is one of three presenting Rust’s ownership system. This is one of
44
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
6-
memory safety. There are a few distinct concepts, each with its own
6+
memory safety. The there are a few distinct concepts, each with its own
77
chapter:
88

99
* [ownership][ownership], ownership, the key concept

branches/try/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Here’s the error:
192192
```text
193193
error: type `std::fs::File` does not implement any method in scope named `write`
194194
195-
let result = f.write(b"whatever");
195+
let result = f.write(bwhatever);
196196
^~~~~~~~~~~~~~~~~~
197197
```
198198

branches/try/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ impl<T> Vec<T> {
647647
// zero-size types consume no memory, so we can't rely on the
648648
// address space running out
649649
self.len = self.len.checked_add(1).expect("length overflow");
650-
mem::forget(value);
650+
unsafe { mem::forget(value); }
651651
return
652652
}
653653

@@ -994,7 +994,7 @@ impl<T> Vec<T> {
994994
num_u: 0,
995995
marker: PhantomData,
996996
};
997-
mem::forget(vec);
997+
unsafe { mem::forget(vec); }
998998

999999
while pv.num_t != 0 {
10001000
unsafe {

branches/try/src/libcore/intrinsics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ extern "rust-intrinsic" {
232232
pub fn uninit<T>() -> T;
233233

234234
/// Moves a value out of scope without running drop glue.
235+
///
236+
/// `forget` is unsafe because the caller is responsible for
237+
/// ensuring the argument is deallocated already.
238+
#[stable(feature = "rust1", since = "1.0.0")]
235239
pub fn forget<T>(_: T) -> ();
236240

237241
/// Unsafely transforms a value of one type into a value of another type.

branches/try/src/libcore/iter.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub trait Iterator {
137137
///
138138
/// ```
139139
/// let a = [1, 2, 3, 4, 5];
140-
/// assert_eq!(a.iter().last().unwrap(), &5);
140+
/// assert!(a.iter().last().unwrap() == &5);
141141
/// ```
142142
#[inline]
143143
#[stable(feature = "rust1", since = "1.0.0")]
@@ -155,8 +155,8 @@ pub trait Iterator {
155155
/// ```
156156
/// let a = [1, 2, 3, 4, 5];
157157
/// let mut it = a.iter();
158-
/// assert_eq!(it.nth(2).unwrap(), &3);
159-
/// assert_eq!(it.nth(2), None);
158+
/// assert!(it.nth(2).unwrap() == &3);
159+
/// assert!(it.nth(2) == None);
160160
/// ```
161161
#[inline]
162162
#[stable(feature = "rust1", since = "1.0.0")]
@@ -545,8 +545,8 @@ pub trait Iterator {
545545
/// let mut it = 0..10;
546546
/// // sum the first five values
547547
/// let partial_sum = it.by_ref().take(5).fold(0, |a, b| a + b);
548-
/// assert_eq!(partial_sum, 10);
549-
/// assert_eq!(it.next(), Some(5));
548+
/// assert!(partial_sum == 10);
549+
/// assert!(it.next() == Some(5));
550550
/// ```
551551
#[stable(feature = "rust1", since = "1.0.0")]
552552
fn by_ref(&mut self) -> &mut Self where Self: Sized { self }
@@ -608,7 +608,7 @@ pub trait Iterator {
608608
///
609609
/// ```
610610
/// let a = [1, 2, 3, 4, 5];
611-
/// assert_eq!(a.iter().fold(0, |acc, &item| acc + item), 15);
611+
/// assert!(a.iter().fold(0, |acc, &item| acc + item) == 15);
612612
/// ```
613613
#[inline]
614614
#[stable(feature = "rust1", since = "1.0.0")]
@@ -773,7 +773,7 @@ pub trait Iterator {
773773
///
774774
/// ```
775775
/// let a = [1, 2, 3, 4, 5];
776-
/// assert_eq!(a.iter().max().unwrap(), &5);
776+
/// assert!(a.iter().max().unwrap() == &5);
777777
/// ```
778778
#[inline]
779779
#[stable(feature = "rust1", since = "1.0.0")]
@@ -796,7 +796,7 @@ pub trait Iterator {
796796
///
797797
/// ```
798798
/// let a = [1, 2, 3, 4, 5];
799-
/// assert_eq!(a.iter().min().unwrap(), &1);
799+
/// assert!(a.iter().min().unwrap() == &1);
800800
/// ```
801801
#[inline]
802802
#[stable(feature = "rust1", since = "1.0.0")]
@@ -834,13 +834,13 @@ pub trait Iterator {
834834
/// assert_eq!(a.iter().min_max(), NoElements);
835835
///
836836
/// let a = [1];
837-
/// assert_eq!(a.iter().min_max(), OneElement(&1));
837+
/// assert!(a.iter().min_max() == OneElement(&1));
838838
///
839839
/// let a = [1, 2, 3, 4, 5];
840-
/// assert_eq!(a.iter().min_max(), MinMax(&1, &5));
840+
/// assert!(a.iter().min_max() == MinMax(&1, &5));
841841
///
842842
/// let a = [1, 1, 1, 1];
843-
/// assert_eq!(a.iter().min_max(), MinMax(&1, &1));
843+
/// assert!(a.iter().min_max() == MinMax(&1, &1));
844844
/// ```
845845
#[unstable(feature = "core", reason = "return type may change")]
846846
fn min_max(mut self) -> MinMaxResult<Self::Item> where Self: Sized, Self::Item: Ord
@@ -1058,7 +1058,7 @@ pub trait Iterator {
10581058
///
10591059
/// let a = [1, 2, 3, 4, 5];
10601060
/// let mut it = a.iter().cloned();
1061-
/// assert_eq!(it.sum::<i32>(), 15);
1061+
/// assert!(it.sum::<i32>() == 15);
10621062
/// ```
10631063
#[unstable(feature="core")]
10641064
fn sum<S=<Self as Iterator>::Item>(self) -> S where
@@ -1078,9 +1078,9 @@ pub trait Iterator {
10781078
/// fn factorial(n: u32) -> u32 {
10791079
/// (1..).take_while(|&i| i <= n).product()
10801080
/// }
1081-
/// assert_eq!(factorial(0), 1);
1082-
/// assert_eq!(factorial(1), 1);
1083-
/// assert_eq!(factorial(5), 120);
1081+
/// assert!(factorial(0) == 1);
1082+
/// assert!(factorial(1) == 1);
1083+
/// assert!(factorial(5) == 120);
10841084
/// ```
10851085
#[unstable(feature="core")]
10861086
fn product<P=<Self as Iterator>::Item>(self) -> P where

branches/try/src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ macro_rules! impls{
313313
/// mismatches by enforcing types in the method implementations:
314314
///
315315
/// ```
316-
/// # trait ResType { fn foo(&self); }
316+
/// # trait ResType { fn foo(&self); };
317317
/// # struct ParamType;
318318
/// # mod foreign_lib {
319319
/// # pub fn new(_: usize) -> *mut () { 42 as *mut () }

branches/try/src/libcore/mem.rs

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,54 +22,15 @@ use ptr;
2222
#[stable(feature = "rust1", since = "1.0.0")]
2323
pub use intrinsics::transmute;
2424

25-
/// Leaks a value into the void, consuming ownership and never running its
26-
/// destructor.
25+
/// Moves a thing into the void.
2726
///
28-
/// This function will take ownership of its argument, but is distinct from the
29-
/// `mem::drop` function in that it **does not run the destructor**, leaking the
30-
/// value and any resources that it owns.
27+
/// The forget function will take ownership of the provided value but neglect
28+
/// to run any required cleanup or memory management operations on it.
3129
///
32-
/// # Safety
33-
///
34-
/// This function is not marked as `unsafe` as Rust does not guarantee that the
35-
/// `Drop` implementation for a value will always run. Note, however, that
36-
/// leaking resources such as memory or I/O objects is likely not desired, so
37-
/// this function is only recommended for specialized use cases.
38-
///
39-
/// The safety of this function implies that when writing `unsafe` code
40-
/// yourself care must be taken when leveraging a destructor that is required to
41-
/// run to preserve memory safety. There are known situations where the
42-
/// destructor may not run (such as if ownership of the object with the
43-
/// destructor is returned) which must be taken into account.
44-
///
45-
/// # Other forms of Leakage
46-
///
47-
/// It's important to point out that this function is not the only method by
48-
/// which a value can be leaked in safe Rust code. Other known sources of
49-
/// leakage are:
50-
///
51-
/// * `Rc` and `Arc` cycles
52-
/// * `mpsc::{Sender, Receiver}` cycles (they use `Arc` internally)
53-
/// * Panicking destructors are likely to leak local resources
54-
///
55-
/// # Example
56-
///
57-
/// ```rust,no_run
58-
/// use std::mem;
59-
/// use std::fs::File;
60-
///
61-
/// // Leak some heap memory by never deallocating it
62-
/// let heap_memory = Box::new(3);
63-
/// mem::forget(heap_memory);
64-
///
65-
/// // Leak an I/O object, never closing the file
66-
/// let file = File::open("foo.txt").unwrap();
67-
/// mem::forget(file);
68-
/// ```
30+
/// This function is the unsafe version of the `drop` function because it does
31+
/// not run any destructors.
6932
#[stable(feature = "rust1", since = "1.0.0")]
70-
pub fn forget<T>(t: T) {
71-
unsafe { intrinsics::forget(t) }
72-
}
33+
pub use intrinsics::forget;
7334

7435
/// Returns the size of a type in bytes.
7536
///

branches/try/src/liblibc/lib.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#![cfg_attr(stage0, feature(custom_attribute))]
1313
#![crate_name = "libc"]
1414
#![crate_type = "rlib"]
15-
#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc",
16-
reason = "use `libc` from crates.io"))]
15+
#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc"))]
1716
#![cfg_attr(not(feature = "cargo-build"), feature(staged_api, core, no_std))]
1817
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
1918
#![cfg_attr(not(feature = "cargo-build"), no_std)]
@@ -3625,30 +3624,6 @@ pub mod consts {
36253624
pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
36263625

36273626
pub const TCP_NODELAY: c_int = 1;
3628-
pub const TCP_MAXSEG: c_int = 2;
3629-
pub const TCP_CORK: c_int = 3;
3630-
pub const TCP_KEEPIDLE: c_int = 4;
3631-
pub const TCP_KEEPINTVL: c_int = 5;
3632-
pub const TCP_KEEPCNT: c_int = 6;
3633-
pub const TCP_SYNCNT: c_int = 7;
3634-
pub const TCP_LINGER2: c_int = 8;
3635-
pub const TCP_DEFER_ACCEPT: c_int = 9;
3636-
pub const TCP_WINDOW_CLAMP: c_int = 10;
3637-
pub const TCP_INFO: c_int = 11;
3638-
pub const TCP_QUICKACK: c_int = 12;
3639-
pub const TCP_CONGESTION: c_int = 13;
3640-
pub const TCP_MD5SIG: c_int = 14;
3641-
pub const TCP_COOKIE_TRANSACTIONS: c_int = 15;
3642-
pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16;
3643-
pub const TCP_THIN_DUPACK: c_int = 17;
3644-
pub const TCP_USER_TIMEOUT: c_int = 18;
3645-
pub const TCP_REPAIR: c_int = 19;
3646-
pub const TCP_REPAIR_QUEUE: c_int = 20;
3647-
pub const TCP_QUEUE_SEQ: c_int = 21;
3648-
pub const TCP_REPAIR_OPTIONS: c_int = 22;
3649-
pub const TCP_FASTOPEN: c_int = 23;
3650-
pub const TCP_TIMESTAMP: c_int = 24;
3651-
36523627
pub const SOL_SOCKET: c_int = 65535;
36533628

36543629
pub const SO_DEBUG: c_int = 0x0001;

branches/try/src/librand/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
html_playground_url = "http://play.rust-lang.org/")]
2727
#![no_std]
2828
#![staged_api]
29-
#![unstable(feature = "rand",
30-
reason = "use `rand` from crates.io")]
29+
#![unstable(feature = "rand")]
3130
#![feature(core)]
3231
#![feature(no_std)]
3332
#![feature(staged_api)]

0 commit comments

Comments
 (0)