Skip to content

Commit ef47a41

Browse files
committed
---
yaml --- r: 56831 b: refs/heads/try c: bfeb6d1 h: refs/heads/master i: 56829: 30f70e7 56827: 9767613 56823: 6dafe4c 56815: a29b954 56799: e684294 56767: 245e3d3 56703: 42a58a8 56575: d8da569 56319: cb661b0 v: v3
1 parent d498902 commit ef47a41

File tree

166 files changed

+4960
-2484
lines changed

Some content is hidden

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

166 files changed

+4960
-2484
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: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: 995d44416b203b5b3ba619250ff8effdcf205049
5+
refs/heads/try: bfeb6d124dc924e52a218387a388caf87964162f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "src/llvm"]
22
path = src/llvm
3-
url = git://github.com/brson/llvm.git
3+
url = https://github.com/brson/llvm.git
44
[submodule "src/libuv"]
55
path = src/libuv
6-
url = git://github.com/brson/libuv.git
6+
url = https://github.com/brson/libuv.git

branches/try/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ then
533533
LLVM_VERSION=$($LLVM_CONFIG --version)
534534

535535
case $LLVM_VERSION in
536-
(3.2svn|3.2|3.1svn|3.1|3.0svn|3.0)
536+
(3.3|3.3svn|3.2|3.2svn)
537537
msg "found ok version of LLVM: $LLVM_VERSION"
538538
;;
539539
(*)
@@ -859,7 +859,7 @@ do
859859
LDFLAGS=$LLVM_LDFLAGS
860860

861861
LLVM_FLAGS="$LLVM_TARGETS $LLVM_OPTS $LLVM_BUILD \
862-
$LLVM_HOST $LLVM_TARGET"
862+
$LLVM_HOST $LLVM_TARGET --with-python=$CFG_PYTHON"
863863

864864
msg "configuring LLVM with:"
865865
msg "$LLVM_FLAGS"

branches/try/doc/rust.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,11 +1653,12 @@ Path expressions are [lvalues](#lvalues-rvalues-and-temporaries).
16531653

16541654
### Tuple expressions
16551655

1656-
Tuples are written by enclosing two or more comma-separated
1656+
Tuples are written by enclosing one or more comma-separated
16571657
expressions in parentheses. They are used to create [tuple-typed](#tuple-types)
16581658
values.
16591659

16601660
~~~~~~~~ {.tuple}
1661+
(0,);
16611662
(0f, 4.5f);
16621663
("a", 4u, true);
16631664
~~~~~~~~
@@ -2578,7 +2579,7 @@ to the record type-constructor. The differences are as follows:
25782579

25792580
Tuple types and values are denoted by listing the types or values of their
25802581
elements, respectively, in a parenthesized, comma-separated
2581-
list. Single-element tuples are not legal; all tuples have two or more values.
2582+
list.
25822583

25832584
The members of a tuple are laid out in memory contiguously, like a record, in
25842585
order specified by the tuple type.

branches/try/doc/tutorial.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,11 @@ omitted.
495495

496496
A powerful application of pattern matching is *destructuring*:
497497
matching in order to bind names to the contents of data
498-
types. Assuming that `(float, float)` is a tuple of two floats:
498+
types.
499+
500+
> ***Note:*** The following code makes use of tuples (`(float, float)`) which
501+
> are explained in section 5.3. For now you can think of tuples as a list of
502+
> items.
499503
500504
~~~~
501505
fn angle(vector: (float, float)) -> float {
@@ -747,7 +751,7 @@ fn area(sh: Shape) -> float {
747751

748752
Tuples in Rust behave exactly like structs, except that their fields
749753
do not have names. Thus, you cannot access their fields with dot notation.
750-
Tuples can have any arity except for 0 or 1 (though you may consider
754+
Tuples can have any arity except for 0 (though you may consider
751755
unit, `()`, as the empty tuple if you like).
752756

753757
~~~~
@@ -2320,7 +2324,7 @@ impl Shape for CircleStruct {
23202324
Notice that methods of `Circle` can call methods on `Shape`, as our
23212325
`radius` implementation calls the `area` method.
23222326
This is a silly way to compute the radius of a circle
2323-
(since we could just return the `circle` field), but you get the idea.
2327+
(since we could just return the `radius` field), but you get the idea.
23242328

23252329
In type-parameterized functions,
23262330
methods of the supertrait may be called on values of subtrait-bound type parameters.

branches/try/man/rustc.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
170170
<\fI[email protected]\fR> is the project leader.
171171

172172
.SH "COPYRIGHT"
173-
This work is licensed under MIT-like terms. See \fBLICENSE.txt\fR
174-
in the rust source distribution.
173+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
174+
file in the rust source distribution.

branches/try/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PKG_FILES := \
1818
$(S)COPYRIGHT \
1919
$(S)LICENSE-APACHE \
2020
$(S)LICENSE-MIT \
21+
$(S)AUTHORS.txt \
2122
$(S)README.md \
2223
$(S)configure $(S)Makefile.in \
2324
$(S)man \

branches/try/src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#[allow(deprecated_mode)];
1818
#[allow(deprecated_pattern)];
1919

20-
extern mod core(vers = "0.6");
21-
extern mod std(vers = "0.6");
20+
extern mod core(vers = "0.7-pre");
21+
extern mod std(vers = "0.7-pre");
2222

2323
use core::*;
2424

branches/try/src/driver/driver.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
// except according to those terms.
1010

1111
#[no_core];
12-
extern mod core(vers = "0.6");
12+
extern mod core(vers = "0.7-pre");
1313

1414
#[cfg(rustpkg)]
15-
extern mod this(name = "rustpkg", vers = "0.6");
15+
extern mod this(name = "rustpkg", vers = "0.7-pre");
1616

1717
#[cfg(fuzzer)]
18-
extern mod this(name = "fuzzer", vers = "0.6");
18+
extern mod this(name = "fuzzer", vers = "0.7-pre");
1919

2020
#[cfg(rustdoc)]
21-
extern mod this(name = "rustdoc", vers = "0.6");
21+
extern mod this(name = "rustdoc", vers = "0.7-pre");
2222

2323
#[cfg(rusti)]
24-
extern mod this(name = "rusti", vers = "0.6");
24+
extern mod this(name = "rusti", vers = "0.7-pre");
2525

2626
#[cfg(rust)]
27-
extern mod this(name = "rust", vers = "0.6");
27+
extern mod this(name = "rust", vers = "0.7-pre");
2828

2929
#[cfg(rustc)]
30-
extern mod this(name = "rustc", vers = "0.6");
30+
extern mod this(name = "rustc", vers = "0.7-pre");
3131

3232
fn main() { this::main() }

branches/try/src/etc/kate/rust.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
88
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
99
]>
10-
<language name="Rust" version="0.6" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.7-pre" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
1111
<highlighting>
1212
<list name="fn">
1313
<item> fn </item>

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
110110
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
111111
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
112112

113-
syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo
114-
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
113+
syn region rustCommentDoc start="/\*[\*!]" end="\*/"
114+
syn region rustCommentDoc start="//[/!]" skip="\\$" end="$" keepend
115+
syn match rustComment "/\*\*/"
116+
syn region rustComment start="/\*\([^\*!]\|$\)" end="\*/" contains=rustTodo
117+
syn region rustComment start="//\([^/!]\|$\)" skip="\\$" end="$" contains=rustTodo keepend
115118

116119
syn keyword rustTodo contained TODO FIXME XXX NB
117120

@@ -134,6 +137,7 @@ hi def link rustConditional Conditional
134137
hi def link rustIdentifier Identifier
135138
hi def link rustModPath Include
136139
hi def link rustFuncName Function
140+
hi def link rustCommentDoc SpecialComment
137141
hi def link rustComment Comment
138142
hi def link rustMacro Macro
139143
hi def link rustType Type

branches/try/src/libcore/char.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,10 @@ pub fn escape_unicode(c: char) -> ~str {
202202
else { ('U', 8u) });
203203
assert!(str::len(s) <= pad);
204204
let mut out = ~"\\";
205-
unsafe {
206-
str::push_str(&mut out, str::from_char(c));
207-
for uint::range(str::len(s), pad) |_i|
208-
{ str::push_str(&mut out, ~"0"); }
209-
str::push_str(&mut out, s);
210-
}
205+
str::push_str(&mut out, str::from_char(c));
206+
for uint::range(str::len(s), pad) |_i|
207+
{ str::push_str(&mut out, ~"0"); }
208+
str::push_str(&mut out, s);
211209
out
212210
}
213211

branches/try/src/libcore/clone.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In Rust, some simple types are "implicitly copyable" and when you
1414
assign them or pass them as arguments, the receiver will get a copy,
1515
leaving the original value in place. These types do not require
1616
allocation to copy and do not have finalizers (i.e. they do not
17-
contain owned pointers or implement `Drop`), so the compiler considers
17+
contain owned boxes or implement `Drop`), so the compiler considers
1818
them cheap and safe to copy and automatically implements the `Copy`
1919
trait for them. For other types copies must be made explicitly,
2020
by convention implementing the `Clone` trait and calling the
@@ -23,32 +23,38 @@ by convention implementing the `Clone` trait and calling the
2323
*/
2424

2525
pub trait Clone {
26+
/// Return a deep copy of the owned object tree. Managed boxes are cloned with a shallow copy.
2627
fn clone(&self) -> Self;
2728
}
2829

2930
impl Clone for () {
31+
/// Return a copy of the value.
3032
#[inline(always)]
3133
fn clone(&self) -> () { () }
3234
}
3335

3436
impl<T:Clone> Clone for ~T {
37+
/// Return a deep copy of the owned box.
3538
#[inline(always)]
3639
fn clone(&self) -> ~T { ~(**self).clone() }
3740
}
3841

39-
impl<T:Clone> Clone for @T {
42+
impl<T> Clone for @T {
43+
/// Return a shallow copy of the managed box.
4044
#[inline(always)]
41-
fn clone(&self) -> @T { @(**self).clone() }
45+
fn clone(&self) -> @T { *self }
4246
}
4347

44-
impl<T:Clone> Clone for @mut T {
48+
impl<T> Clone for @mut T {
49+
/// Return a shallow copy of the managed box.
4550
#[inline(always)]
46-
fn clone(&self) -> @mut T { @mut (**self).clone() }
51+
fn clone(&self) -> @mut T { *self }
4752
}
4853

4954
macro_rules! clone_impl(
5055
($t:ty) => {
5156
impl Clone for $t {
57+
/// Return a copy of the value.
5258
#[inline(always)]
5359
fn clone(&self) -> $t { *self }
5460
}
@@ -76,21 +82,23 @@ clone_impl!(char)
7682

7783
#[test]
7884
fn test_owned_clone() {
79-
let a : ~int = ~5i;
80-
let b : ~int = a.clone();
85+
let a: ~int = ~5i;
86+
let b: ~int = a.clone();
8187
assert!(a == b);
8288
}
8389

8490
#[test]
8591
fn test_managed_clone() {
86-
let a : @int = @5i;
87-
let b : @int = a.clone();
92+
let a: @int = @5i;
93+
let b: @int = a.clone();
8894
assert!(a == b);
8995
}
9096

9197
#[test]
9298
fn test_managed_mut_clone() {
93-
let a : @int = @5i;
94-
let b : @int = a.clone();
99+
let a: @mut int = @mut 5i;
100+
let b: @mut int = a.clone();
101+
assert!(a == b);
102+
*b = 10;
95103
assert!(a == b);
96104
}

branches/try/src/libcore/cmp.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,32 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
#[deriving(Eq)]
68-
pub enum Ordering { Less, Equal, Greater }
67+
#[deriving(Clone, Eq)]
68+
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
6969

7070
/// Trait for types that form a total order
7171
pub trait TotalOrd: TotalEq {
7272
fn cmp(&self, other: &Self) -> Ordering;
7373
}
7474

75+
impl TotalOrd for Ordering {
76+
#[inline(always)]
77+
fn cmp(&self, other: &Ordering) -> Ordering {
78+
(*self as int).cmp(&(*other as int))
79+
}
80+
}
81+
82+
impl Ord for Ordering {
83+
#[inline(always)]
84+
fn lt(&self, other: &Ordering) -> bool { (*self as int) < (*other as int) }
85+
#[inline(always)]
86+
fn le(&self, other: &Ordering) -> bool { (*self as int) <= (*other as int) }
87+
#[inline(always)]
88+
fn gt(&self, other: &Ordering) -> bool { (*self as int) > (*other as int) }
89+
#[inline(always)]
90+
fn ge(&self, other: &Ordering) -> bool { (*self as int) >= (*other as int) }
91+
}
92+
7593
macro_rules! totalord_impl(
7694
($t:ty) => {
7795
impl TotalOrd for $t {
@@ -180,4 +198,10 @@ mod test {
180198
assert!(5.equals(&5));
181199
assert!(!2.equals(&17));
182200
}
201+
202+
#[test]
203+
fn test_ordering_order() {
204+
assert!(Less < Equal);
205+
assert_eq!(Greater.cmp(&Less), Greater);
206+
}
183207
}

branches/try/src/libcore/container.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pub trait Map<K, V>: Mutable {
2929
/// Return true if the map contains a value for the specified key
3030
fn contains_key(&self, key: &K) -> bool;
3131

32+
// Visits all keys and values
33+
fn each(&self, f: &fn(&K, &V) -> bool);
34+
3235
/// Visit all keys
3336
fn each_key(&self, f: &fn(&K) -> bool);
3437

branches/try/src/libcore/core.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ they contained the following prologue:
4848

4949

5050
#[link(name = "core",
51-
vers = "0.6",
51+
vers = "0.7-pre",
5252
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
5353
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
5454

@@ -66,7 +66,7 @@ they contained the following prologue:
6666
#[allow(deprecated_drop)];
6767

6868
// Make core testable by not duplicating lang items. See #2912
69-
#[cfg(test)] extern mod realcore(name = "core", vers = "0.6");
69+
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");
7070
#[cfg(test)] pub use kinds = realcore::kinds;
7171
#[cfg(test)] pub use ops = realcore::ops;
7272
#[cfg(test)] pub use cmp = realcore::cmp;

0 commit comments

Comments
 (0)