Skip to content

Commit 7ebc67a

Browse files
committed
---
yaml --- r: 54154 b: refs/heads/dist-snap c: 7f5d7e1 h: refs/heads/master v: v3
1 parent c6ded1e commit 7ebc67a

Some content is hidden

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

50 files changed

+381
-543
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 4d745c288a01fbc59366b65a65e847efb50353b5
10+
refs/heads/dist-snap: 7f5d7e1c2e7464916694e55ba4f31bf5b8f9a4f9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/RELEASES.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 0.6 (March 2013)
22
---------------------------
33

4-
* ~??? changes, numerous bugfixes
4+
* ~2000 changes, numerous bugfixes
55

66
* TODO:
77
* Ord/Cmp
@@ -39,6 +39,11 @@ Version 0.6 (March 2013)
3939
* Newtype enums removed. Used tuple-structs.
4040
* Trait implementations no longer support visibility modifiers
4141
* Pattern matching over vectors improved and expanded
42+
* `const` renamed to `static` to correspond to lifetime name,
43+
and make room for future `static mut` unsafe mutable globals.
44+
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`
45+
* `Clone` implementations can be automatically generated with
46+
`#[deriving(Clone)]`
4247

4348
* Semantic changes
4449
* Types with owned pointers or custom destructors move by default,
@@ -52,8 +57,9 @@ Version 0.6 (March 2013)
5257
* Name resolution continues to be tweaked
5358
* Method visibility is inherited from the implementation declaration
5459
* Structural records have been removed
55-
* Many more types can be used in constants, including enums,
56-
`static lifetime pointers and vectors
60+
* Many more types can be used in static items, including enums
61+
'static-lifetime pointers and vectors
62+
* Pattern matching over vectors improved and expanded
5763
* Typechecking of closure types has been overhauled to
5864
improve inference and eliminate unsoundness
5965

@@ -85,6 +91,7 @@ Version 0.6 (March 2013)
8591
* Improved foreign function ABI implementation for x86, x86_64
8692
* Various memory usage improvements
8793
* Rust code may be embedded in foreign code under limited circumstances
94+
* Inline assembler supported by new asm!() syntax extension.
8895

8996
Version 0.5 (December 2012)
9097
---------------------------

branches/dist-snap/configure

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,13 @@ fi
444444

445445
if [ ! -z "$CFG_PANDOC" ]
446446
then
447-
PANDOC_VER_LINE=$(pandoc --version | grep '^pandoc ')
448-
PANDOC_VER=${PANDOC_VER_LINE#pandoc }
449-
PV_MAJOR_MINOR=${PANDOC_VER%.[0-9]*}
450-
PV_MAJOR=${PV_MAJOR_MINOR%%[.][0-9]*}
451-
PV_MINOR=${PV_MAJOR_MINOR#[0-9]*[.]}
452-
PV_MINOR=${PV_MINOR%%[.][0-9]*}
447+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc ' |
448+
# extract the first 2 version fields, ignore everything else
449+
sed 's/pandoc \([0-9]*\)\.\([0-9]*\).*/\1 \2/')
450+
451+
# these patterns are shell globs, *not* regexps
452+
PV_MAJOR=${PV_MAJOR_MINOR% *}
453+
PV_MINOR=${PV_MAJOR_MINOR#* }
453454
if [ "$PV_MAJOR" -lt "1" ] || [ "$PV_MINOR" -lt "8" ]
454455
then
455456
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. disabling"
@@ -574,6 +575,7 @@ fi
574575
CFG_PREFIX=${CFG_PREFIX%/}
575576
CFG_HOST_TRIPLES="$(echo $CFG_HOST_TRIPLES | tr ',' ' ')"
576577
CFG_TARGET_TRIPLES="$(echo $CFG_TARGET_TRIPLES | tr ',' ' ')"
578+
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed 's,^[^_]*_,,' | sed 's/\([^=]*\).*/\1/' | xargs)"
577579

578580
# copy host-triples to target-triples so that hosts are a subset of targets
579581
V_TEMP=""
@@ -586,8 +588,22 @@ CFG_TARGET_TRIPLES=$V_TEMP
586588
# check target-specific tool-chains
587589
for i in $CFG_TARGET_TRIPLES
588590
do
591+
L_CHECK=false
592+
for j in $CFG_SUPPORTED_TARGET_TRIPLES
593+
do
594+
if [ $i = $j ]
595+
then
596+
L_CHECK=true
597+
fi
598+
done
599+
600+
if [ $L_CHECK = false ]
601+
then
602+
err "unsupported target triples \"$i\" found"
603+
fi
604+
589605
case $i in
590-
arm-unknown-android)
606+
arm-linux-androideabi)
591607

592608
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-gcc ]
593609
then

branches/dist-snap/doc/rust.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ each of which may have some number of [attributes](#attributes) attached to it.
617617
## Items
618618

619619
~~~~~~~~ {.ebnf .gram}
620-
item : mod_item | fn_item | type_item | enum_item
621-
| const_item | trait_item | impl_item | foreign_mod_item ;
620+
item : mod_item | fn_item | type_item | struct_item | enum_item
621+
| static_item | trait_item | impl_item | foreign_mod_item ;
622622
~~~~~~~~
623623

624624
An _item_ is a component of a crate; some module items can be defined in crate
@@ -627,7 +627,7 @@ crate by a nested set of [modules](#modules). Every crate has a single
627627
"outermost" anonymous module; all further items within the crate have
628628
[paths](#paths) within the module tree of the crate.
629629

630-
Items are entirely determined at compile-time, remain constant during
630+
Items are entirely determined at compile-time, generally remain fixed during
631631
execution, and may reside in read-only memory.
632632

633633
There are several kinds of item:
@@ -637,7 +637,7 @@ There are several kinds of item:
637637
* [type definitions](#type-definitions)
638638
* [structures](#structures)
639639
* [enumerations](#enumerations)
640-
* [constants](#constants)
640+
* [static items](#static-items)
641641
* [traits](#traits)
642642
* [implementations](#implementations)
643643

@@ -1091,21 +1091,23 @@ a = Cat{ name: ~"Spotty", weight: 2.7 };
10911091
In this example, `Cat` is a _struct-like enum variant_,
10921092
whereas `Dog` is simply called an enum variant.
10931093

1094-
### Constants
1094+
### Static items
10951095

10961096
~~~~~~~~ {.ebnf .gram}
1097-
const_item : "const" ident ':' type '=' expr ';' ;
1097+
static_item : "static" ident ':' type '=' expr ';' ;
10981098
~~~~~~~~
10991099

1100-
A *constant* is a named value stored in read-only memory in a crate.
1101-
The value bound to a constant is evaluated at compile time.
1102-
Constants are declared with the `static` keyword.
1103-
A constant item must have an expression giving its definition.
1104-
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
1100+
A *static item* is a named _constant value_ stored in the global data section of a crate.
1101+
Immutable static items are stored in the read-only data section.
1102+
The constant value bound to a static item is, like all constant values, evaluated at compile time.
1103+
Static items have the `static` lifetime, which outlives all other lifetimes in a Rust program.
1104+
Static items are declared with the `static` keyword.
1105+
A static item must have a _constant expression_ giving its definition.
11051106

1106-
Constants must be explicitly typed. The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1107-
The derived types are borrowed pointers, static arrays, tuples, and structs.
1108-
Borrowed pointers must be have the `'static` lifetime.
1107+
Static items must be explicitly typed.
1108+
The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1109+
The derived types are borrowed pointers with the `'static` lifetime,
1110+
fixed-size arrays, tuples, and structs.
11091111

11101112
~~~~
11111113
static bit1: uint = 1 << 0;
@@ -1456,7 +1458,7 @@ The declared names may denote new slots or new items.
14561458

14571459
An _item declaration statement_ has a syntactic form identical to an
14581460
[item](#items) declaration within a module. Declaring an item -- a function,
1459-
enumeration, type, constant, trait, implementation or module -- locally
1461+
enumeration, structure, type, static, trait, implementation or module -- locally
14601462
within a statement block is simply a way of restricting its scope to a narrow
14611463
region containing all of its uses; it is otherwise identical in meaning to
14621464
declaring the item outside the statement block.
@@ -1669,6 +1671,10 @@ vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
16691671
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
16701672
more comma-separated expressions of uniform type in square brackets.
16711673

1674+
In the `[expr ',' ".." expr]` form, the expression after the `".."`
1675+
must be a constant expression that can be evaluated at compile time, such
1676+
as a [literal](#literals) or a [static item](#static-items).
1677+
16721678
~~~~
16731679
[1, 2, 3, 4];
16741680
["a", "b", "c", "d"];
@@ -2154,6 +2160,19 @@ do f |j| {
21542160
}
21552161
~~~~
21562162

2163+
In this example, both calls to the (binary) function `k` are equivalent:
2164+
2165+
~~~~
2166+
# fn k(x:int, f: &fn(int)) { }
2167+
# fn l(i: int) { }
2168+
2169+
k(3, |j| l(j));
2170+
2171+
do k(3) |j| {
2172+
l(j);
2173+
}
2174+
~~~~
2175+
21572176

21582177
### For expressions
21592178

@@ -2182,7 +2201,7 @@ and early boolean-valued returns from the `block` function,
21822201
such that the meaning of `break` and `loop` is preserved in a primitive loop
21832202
when rewritten as a `for` loop controlled by a higher order function.
21842203

2185-
An example a for loop:
2204+
An example of a for loop over the contents of a vector:
21862205

21872206
~~~~
21882207
# type foo = int;
@@ -2196,6 +2215,14 @@ for v.each |e| {
21962215
}
21972216
~~~~
21982217

2218+
An example of a for loop over a series of integers:
2219+
2220+
~~~~
2221+
# fn bar(b:uint) { }
2222+
for uint::range(0, 256) |i| {
2223+
bar(i);
2224+
}
2225+
~~~~
21992226

22002227
### If expressions
22012228

@@ -2472,6 +2499,7 @@ fail_unless!(b != "world");
24722499

24732500
The vector type constructor represents a homogeneous array of values of a given type.
24742501
A vector has a fixed size.
2502+
(Operations like `vec::push` operate solely on owned vectors.)
24752503
A vector type can be annotated with a _definite_ size,
24762504
written with a trailing asterisk and integer literal, such as `[int * 10]`.
24772505
Such a definite-sized vector type is a first-class type, since its size is known statically.
@@ -2482,6 +2510,10 @@ such as `&[T]`, `@[T]` or `~[T]`.
24822510
The kind of a vector type depends on the kind of its element type,
24832511
as with other simple structural types.
24842512

2513+
Expressions producing vectors of definite size cannot be evaluated in a
2514+
context expecting a vector of indefinite size; one must copy the
2515+
definite-sized vector contents into a distinct vector of indefinite size.
2516+
24852517
An example of a vector type and its use:
24862518

24872519
~~~~

branches/dist-snap/doc/tutorial-borrowed-ptr.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,10 @@ overwritten for the duration of the borrow. In fact, the compiler
468468
would accept the example we gave earlier. The example is safe because
469469
the shape pointer has type `&Shape`, which means "borrowed pointer to
470470
immutable memory containing a `shape`". If, however, the type of that
471-
pointer were `&const Shape` or `&mut Shape`, then the ref binding
472-
would be ill-typed. Just as with unique boxes, the compiler will
473-
permit `ref` bindings into data owned by the stack frame even if the
474-
data are mutable, but otherwise it requires that the data reside in
475-
immutable memory.
471+
pointer were `&mut Shape`, then the ref binding would be ill-typed.
472+
Just as with unique boxes, the compiler will permit `ref` bindings
473+
into data owned by the stack frame even if the data are mutable,
474+
but otherwise it requires that the data reside in immutable memory.
476475

477476
# Returning borrowed pointers
478477

branches/dist-snap/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ while count < 10 {
234234

235235
Although Rust can almost always infer the types of local variables, you
236236
can specify a variable's type by following it with a colon, then the type
237-
name. Constants, on the other hand, always require a type annotation.
237+
name. Static items, on the other hand, always require a type annotation.
238238

239239
~~~~
240240
static monster_factor: float = 57.8;

branches/dist-snap/src/etc/kate/rust.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<list name="keywords">
1919
<item> as </item>
2020
<item> break </item>
21-
<item> const </item>
2221
<item> copy </item>
2322
<item> do </item>
2423
<item> drop </item>
@@ -29,18 +28,17 @@
2928
<item> if </item>
3029
<item> impl </item>
3130
<item> let </item>
32-
<item> log </item>
3331
<item> loop </item>
3432
<item> match </item>
3533
<item> mod </item>
3634
<item> mut </item>
3735
<item> priv </item>
3836
<item> pub </item>
39-
<item> pure </item>
4037
<item> ref </item>
4138
<item> return </item>
4239
<item> static </item>
4340
<item> struct </item>
41+
<item> super </item>
4442
<item> trait </item>
4543
<item> unsafe </item>
4644
<item> use </item>

branches/dist-snap/src/libcore/container.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ pub trait Map<K, V>: Mutable {
3838
/// Iterate over the map and mutate the contained values
3939
fn mutate_values(&mut self, f: &fn(&K, &mut V) -> bool);
4040

41-
/// Return the value corresponding to the key in the map
41+
/// Return a reference to the value corresponding to the key
4242
fn find(&self, key: &K) -> Option<&'self V>;
4343

44+
/// Return a mutable reference to the value corresponding to the key
45+
fn find_mut(&mut self, key: &K) -> Option<&'self mut V>;
46+
4447
/// Insert a key-value pair into the map. An existing value for a
4548
/// key is replaced by the new value. Return true if the key did
4649
/// not already exist in the map.

branches/dist-snap/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Implicitly, all crates behave as if they included the following prologue:
5151
#[warn(vecs_implicitly_copyable)];
5252
#[deny(non_camel_case_types)];
5353
#[allow(deprecated_mutable_fields)];
54-
#[deny(deprecated_self)];
5554
#[allow(deprecated_drop)];
5655

5756
// On Linux, link to the runtime with -lrt.
@@ -231,6 +230,7 @@ pub mod rt;
231230
// can be resolved within libcore.
232231
#[doc(hidden)]
233232
pub mod core {
233+
pub use clone;
234234
pub use cmp;
235235
pub use condition;
236236
pub use option;

branches/dist-snap/src/libcore/either.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use result;
1717
use vec;
1818

1919
/// The either type
20-
#[deriving(Eq)]
20+
#[deriving(Clone, Eq)]
2121
pub enum Either<T, U> {
2222
Left(T),
2323
Right(U)

0 commit comments

Comments
 (0)