Skip to content

Commit 8c5ba01

Browse files
committed
---
yaml --- r: 151323 b: refs/heads/try2 c: 7adc485 h: refs/heads/master i: 151321: 1081201 151319: ba20495 v: v3
1 parent ad4e5f7 commit 8c5ba01

File tree

25 files changed

+111
-1272
lines changed

25 files changed

+111
-1272
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: bd3fb81e5e7cd19fe3a2812efffc750007d43852
8+
refs/heads/try2: 7adc48527fa0505a0cda6eaf1b6cafb01e434170
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz
54+
workcache url log regex
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
@@ -67,7 +67,6 @@ DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
6767
test time
6868
DEPS_flate := std native:miniz
6969
DEPS_arena := std collections
70-
DEPS_graphviz := std
7170
DEPS_glob := std
7271
DEPS_serialize := std collections log
7372
DEPS_term := std collections

branches/try2/src/doc/tutorial.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,19 @@ Unlike in C, there is no "falling through" between arms: only one arm
468468
executes, and it doesn't have to explicitly `break` out of the
469469
construct when it is finished.
470470

471-
A `match` arm consists of a *pattern*, then a fat arrow `=>`, followed
472-
by an *action* (expression). Each case is separated by commas. It is
473-
often convenient to use a block expression for each case, in which case
474-
the commas are optional as shown below. Literals are valid patterns and
475-
match only their own value. A single arm may match multiple different
476-
patterns by combining them with the pipe operator (`|`), so long as every
477-
pattern binds the same set of variables. Ranges of numeric literal
478-
patterns can be expressed with two dots, as in `M..N`. The underscore
479-
(`_`) is a wildcard pattern that matches any single value. (`..`) is a
480-
different wildcard that can match one or more fields in an `enum` variant.
471+
A `match` arm consists of a *pattern*, then an arrow `=>`, followed by
472+
an *action* (expression). Literals are valid patterns and match only
473+
their own value. A single arm may match multiple different patterns by
474+
combining them with the pipe operator (`|`), so long as every pattern
475+
binds the same set of variables. Ranges of numeric literal patterns
476+
can be expressed with two dots, as in `M..N`. The underscore (`_`) is
477+
a wildcard pattern that matches any single value. (`..`) is a different
478+
wildcard that can match one or more fields in an `enum` variant.
479+
480+
The patterns in a match arm are followed by a fat arrow, `=>`, then an
481+
expression to evaluate. Each case is separated by commas. It's often
482+
convenient to use a block expression for each case, in which case the
483+
commas are optional.
481484

482485
~~~
483486
# let my_number = 1;
@@ -1413,7 +1416,7 @@ contains a point, but allocated in a different location:
14131416
14141417
~~~
14151418
# struct Point { x: f64, y: f64 }
1416-
let on_the_stack : Point = Point { x: 3.0, y: 4.0 };
1419+
let on_the_stack : Point = Point { x: 3.0, y: 4.0 };
14171420
let owned_box : ~Point = ~Point { x: 7.0, y: 9.0 };
14181421
~~~
14191422
@@ -2584,18 +2587,11 @@ for `Eq` and can be used with the equality operators, and that a value
25842587
of type `ABC` can be randomly generated and converted to a string:
25852588

25862589
~~~
2587-
extern crate rand;
2588-
25892590
#[deriving(Eq)]
25902591
struct Circle { radius: f64 }
25912592
2592-
#[deriving(Rand, Show)]
2593+
#[deriving(Clone, Show)]
25932594
enum ABC { A, B, C }
2594-
2595-
fn main() {
2596-
// Use the Show trait to print "A, B, C."
2597-
println!("{}, {}, {}", A, B, C);
2598-
}
25992595
~~~
26002596

26012597
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,

branches/try2/src/libarena/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
extern crate collections;
2828

29-
use std::cast::{transmute, transmute_mut_lifetime};
29+
use std::cast::{transmute, transmute_mut, transmute_mut_lifetime};
3030
use std::cast;
3131
use std::cell::{Cell, RefCell};
3232
use std::mem;
@@ -281,8 +281,8 @@ impl Arena {
281281
#[inline]
282282
pub fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T {
283283
unsafe {
284-
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
285-
let this: &mut Arena = transmute::<&_, &mut _>(self);
284+
// FIXME: Borrow check
285+
let this = transmute_mut(self);
286286
if intrinsics::needs_drop::<T>() {
287287
this.alloc_noncopy(op)
288288
} else {
@@ -438,8 +438,7 @@ impl<T> TypedArena<T> {
438438
#[inline]
439439
pub fn alloc<'a>(&'a self, object: T) -> &'a T {
440440
unsafe {
441-
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
442-
let this: &mut TypedArena<T> = cast::transmute::<&_, &mut _>(self);
441+
let this = cast::transmute_mut(self);
443442
if this.ptr == this.end {
444443
this.grow()
445444
}

0 commit comments

Comments
 (0)