Skip to content

Commit 9d7f622

Browse files
committed
---
yaml --- r: 208564 b: refs/heads/snap-stage3 c: 716f920 h: refs/heads/master v: v3
1 parent c4d3094 commit 9d7f622

File tree

19 files changed

+1944
-1578
lines changed

19 files changed

+1944
-1578
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 74f1818608f0e5055adb673a2798726403b6862a
4+
refs/heads/snap-stage3: 716f920b7e234b450f272346fea961832505c06e
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/doc/trpl/dining-philosophers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ let handles: Vec<_> = philosophers.into_iter().map(|p| {
396396
}).collect();
397397
```
398398

399-
While this is only five lines, they’re a dense four. Let’s break it down.
399+
While this is only five lines, they’re a dense five. Let’s break it down.
400400

401401
```rust,ignore
402402
let handles: Vec<_> =

branches/snap-stage3/src/doc/trpl/guessing-game.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Check out the generated `Cargo.toml`:
2727
[package]
2828

2929
name = "guessing_game"
30-
version = "0.0.1"
30+
version = "0.1.0"
3131
authors = ["Your Name <[email protected]>"]
3232
```
3333

@@ -46,7 +46,7 @@ Let’s try compiling what Cargo gave us:
4646

4747
```{bash}
4848
$ cargo build
49-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
49+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
5050
```
5151

5252
Excellent! Open up your `src/main.rs` again. We’ll be writing all of
@@ -58,7 +58,7 @@ Try it out:
5858

5959
```bash
6060
$ cargo run
61-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
61+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
6262
Running `target/debug/guessing_game`
6363
Hello, world!
6464
```
@@ -727,7 +727,7 @@ Let’s try our program out!
727727
728728
```bash
729729
$ cargo run
730-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
730+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
731731
Running `target/guessing_game`
732732
Guess the number!
733733
The secret number is: 58
@@ -792,7 +792,7 @@ and quit. Observe:
792792
793793
```bash
794794
$ cargo run
795-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
795+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
796796
Running `target/guessing_game`
797797
Guess the number!
798798
The secret number is: 59
@@ -929,7 +929,7 @@ Now we should be good! Let’s try:
929929
930930
```bash
931931
$ cargo run
932-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
932+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
933933
Running `target/guessing_game`
934934
Guess the number!
935935
The secret number is: 61

branches/snap-stage3/src/libcore/slice.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -665,14 +665,14 @@ macro_rules! iterator {
665665
#[inline]
666666
fn next(&mut self) -> Option<$elem> {
667667
// could be implemented with slices, but this avoids bounds checks
668-
if self.ptr == self.end {
669-
None
670-
} else {
671-
unsafe {
672-
if mem::size_of::<T>() != 0 {
673-
::intrinsics::assume(!self.ptr.is_null());
674-
::intrinsics::assume(!self.end.is_null());
675-
}
668+
unsafe {
669+
if mem::size_of::<T>() != 0 {
670+
assume(!self.ptr.is_null());
671+
assume(!self.end.is_null());
672+
}
673+
if self.ptr == self.end {
674+
None
675+
} else {
676676
let old = self.ptr;
677677
self.ptr = slice_offset!(self.ptr, 1);
678678
Some(slice_ref!(old))
@@ -710,15 +710,15 @@ macro_rules! iterator {
710710
#[inline]
711711
fn next_back(&mut self) -> Option<$elem> {
712712
// could be implemented with slices, but this avoids bounds checks
713-
if self.end == self.ptr {
714-
None
715-
} else {
716-
unsafe {
713+
unsafe {
714+
if mem::size_of::<T>() != 0 {
715+
assume(!self.ptr.is_null());
716+
assume(!self.end.is_null());
717+
}
718+
if self.end == self.ptr {
719+
None
720+
} else {
717721
self.end = slice_offset!(self.end, -1);
718-
if mem::size_of::<T>() != 0 {
719-
::intrinsics::assume(!self.ptr.is_null());
720-
::intrinsics::assume(!self.end.is_null());
721-
}
722722
Some(slice_ref!(self.end))
723723
}
724724
}

0 commit comments

Comments
 (0)