Skip to content

Commit ebef09f

Browse files
committed
---
yaml --- r: 151325 b: refs/heads/try2 c: acf9d42 h: refs/heads/master i: 151323: 8c5ba01 v: v3
1 parent e3a4a8b commit ebef09f

File tree

24 files changed

+1206
-103
lines changed

24 files changed

+1206
-103
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: 90449abcb30ed8b0fd1bab84f45630769f668247
8+
refs/heads/try2: acf9d421467f6279ad3839f2e99a950b84eb2b17
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: 2 additions & 1 deletion
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
54+
workcache url log regex graphviz
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
@@ -67,6 +67,7 @@ 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
7071
DEPS_glob := std
7172
DEPS_serialize := std collections log
7273
DEPS_term := std collections

branches/try2/src/doc/tutorial.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -468,19 +468,16 @@ 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 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.
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.
484481

485482
~~~
486483
# let my_number = 1;
@@ -1416,7 +1413,7 @@ contains a point, but allocated in a different location:
14161413
14171414
~~~
14181415
# struct Point { x: f64, y: f64 }
1419-
let on_the_stack : Point = Point { x: 3.0, y: 4.0 };
1416+
let on_the_stack : Point = Point { x: 3.0, y: 4.0 };
14201417
let owned_box : ~Point = ~Point { x: 7.0, y: 9.0 };
14211418
~~~
14221419
@@ -2587,11 +2584,18 @@ for `Eq` and can be used with the equality operators, and that a value
25872584
of type `ABC` can be randomly generated and converted to a string:
25882585

25892586
~~~
2587+
extern crate rand;
2588+
25902589
#[deriving(Eq)]
25912590
struct Circle { radius: f64 }
25922591
2593-
#[deriving(Clone, Show)]
2592+
#[deriving(Rand, Show)]
25942593
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+
}
25952599
~~~
25962600

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

branches/try2/src/libarena/lib.rs

Lines changed: 5 additions & 4 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, transmute_mut_lifetime};
29+
use std::cast::{transmute, 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: Borrow check
285-
let this = transmute_mut(self);
284+
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
285+
let this: &mut Arena = transmute::<&_, &mut _>(self);
286286
if intrinsics::needs_drop::<T>() {
287287
this.alloc_noncopy(op)
288288
} else {
@@ -438,7 +438,8 @@ impl<T> TypedArena<T> {
438438
#[inline]
439439
pub fn alloc<'a>(&'a self, object: T) -> &'a T {
440440
unsafe {
441-
let this = cast::transmute_mut(self);
441+
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
442+
let this: &mut TypedArena<T> = cast::transmute::<&_, &mut _>(self);
442443
if this.ptr == this.end {
443444
this.grow()
444445
}

0 commit comments

Comments
 (0)