Skip to content

Commit 4745fe0

Browse files
committed
---
yaml --- r: 56073 b: refs/heads/auto c: 82a8815 h: refs/heads/master i: 56071: 14c8d83 v: v3
1 parent c33b270 commit 4745fe0

File tree

197 files changed

+8635
-4226
lines changed

Some content is hidden

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

197 files changed

+8635
-4226
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 8158dd7e9a3469b8c0946035b457a953faf29d99
17+
refs/heads/auto: 82a8815b94bae752c3d96562d76eb7a54fb4a54a
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/.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/auto/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ need_cmd uname
237237
need_cmd date
238238
need_cmd tr
239239
need_cmd sed
240-
240+
need_cmd file
241241

242242
msg "inspecting environment"
243243

@@ -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/auto/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/auto/doc/tutorial.md

Lines changed: 39 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
~~~~
@@ -1067,6 +1071,28 @@ let mut d = @mut 5; // mutable variable, mutable box
10671071
d = @mut 15;
10681072
~~~~
10691073

1074+
A mutable variable and an immutable variable can refer to the same box, given
1075+
that their types are compatible. Mutability of a box is a property of its type,
1076+
however, so for example a mutable handle to an immutable box cannot be
1077+
assigned a reference to a mutable box.
1078+
1079+
~~~~
1080+
let a = @1; // immutable box
1081+
let b = @mut 2; // mutable box
1082+
1083+
let mut c : @int; // declare a variable with type managed immutable int
1084+
let mut d : @mut int; // and one of type managed mutable int
1085+
1086+
c = a; // box type is the same, okay
1087+
d = b; // box type is the same, okay
1088+
~~~~
1089+
1090+
~~~~ {.xfail-test}
1091+
// but b cannot be assigned to c, or a to d
1092+
c = b; // error
1093+
~~~~
1094+
1095+
10701096
# Move semantics
10711097

10721098
Rust uses a shallow copy for parameter passing, assignment and returning values
@@ -1081,6 +1107,16 @@ let y = x.clone(); // y is a newly allocated box
10811107
let z = x; // no new memory allocated, x can no longer be used
10821108
~~~~
10831109

1110+
Since in owned boxes mutability is a property of the owner, not the
1111+
box, mutable boxes may become immutable when they are moved, and vice-versa.
1112+
1113+
~~~~
1114+
let r = ~13;
1115+
let mut s = r; // box becomes mutable
1116+
*s += 1;
1117+
let t = s; // box becomes immutable
1118+
~~~~
1119+
10841120
# Borrowed pointers
10851121

10861122
Rust's borrowed pointers are a general purpose reference type. In contrast with
@@ -2288,7 +2324,7 @@ impl Shape for CircleStruct {
22882324
Notice that methods of `Circle` can call methods on `Shape`, as our
22892325
`radius` implementation calls the `area` method.
22902326
This is a silly way to compute the radius of a circle
2291-
(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.
22922328

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

branches/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/src/libcore/bool.rs

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
1211
//! Boolean logic
1312
13+
#[cfg(notest)]
14+
use cmp::{Eq, Ord, TotalOrd, Ordering};
1415
use option::{None, Option, Some};
1516
use from_str::FromStr;
1617

17-
#[cfg(notest)] use cmp;
18-
1918
/// Negation / inverse
2019
pub fn not(v: bool) -> bool { !v }
2120

@@ -73,40 +72,86 @@ pub fn all_values(blk: &fn(v: bool)) {
7372
}
7473

7574
/// converts truth value to an 8 bit byte
75+
#[inline(always)]
7676
pub fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
7777

7878
#[cfg(notest)]
79-
impl cmp::Eq for bool {
79+
impl Ord for bool {
80+
#[inline(always)]
81+
fn lt(&self, other: &bool) -> bool { to_bit(*self) < to_bit(*other) }
82+
#[inline(always)]
83+
fn le(&self, other: &bool) -> bool { to_bit(*self) <= to_bit(*other) }
84+
#[inline(always)]
85+
fn gt(&self, other: &bool) -> bool { to_bit(*self) > to_bit(*other) }
86+
#[inline(always)]
87+
fn ge(&self, other: &bool) -> bool { to_bit(*self) >= to_bit(*other) }
88+
}
89+
90+
#[cfg(notest)]
91+
impl TotalOrd for bool {
92+
#[inline(always)]
93+
fn cmp(&self, other: &bool) -> Ordering { to_bit(*self).cmp(&to_bit(*other)) }
94+
}
95+
96+
#[cfg(notest)]
97+
impl Eq for bool {
98+
#[inline(always)]
8099
fn eq(&self, other: &bool) -> bool { (*self) == (*other) }
100+
#[inline(always)]
81101
fn ne(&self, other: &bool) -> bool { (*self) != (*other) }
82102
}
83103

84-
#[test]
85-
pub fn test_bool_from_str() {
86-
use from_str::FromStr;
104+
#[cfg(test)]
105+
mod tests {
106+
use super::*;
107+
use prelude::*;
87108

88-
do all_values |v| {
89-
assert!(Some(v) == FromStr::from_str(to_str(v)))
109+
#[test]
110+
fn test_bool_from_str() {
111+
use from_str::FromStr;
112+
113+
do all_values |v| {
114+
assert!(Some(v) == FromStr::from_str(to_str(v)))
115+
}
90116
}
91-
}
92117

93-
#[test]
94-
pub fn test_bool_to_str() {
95-
assert!(to_str(false) == ~"false");
96-
assert!(to_str(true) == ~"true");
97-
}
118+
#[test]
119+
fn test_bool_to_str() {
120+
assert!(to_str(false) == ~"false");
121+
assert!(to_str(true) == ~"true");
122+
}
98123

99-
#[test]
100-
pub fn test_bool_to_bit() {
101-
do all_values |v| {
102-
assert!(to_bit(v) == if is_true(v) { 1u8 } else { 0u8 });
124+
#[test]
125+
fn test_bool_to_bit() {
126+
do all_values |v| {
127+
assert!(to_bit(v) == if is_true(v) { 1u8 } else { 0u8 });
128+
}
103129
}
104-
}
105130

106-
// Local Variables:
107-
// mode: rust;
108-
// fill-column: 78;
109-
// indent-tabs-mode: nil
110-
// c-basic-offset: 4
111-
// buffer-file-coding-system: utf-8-unix
112-
// End:
131+
#[test]
132+
fn test_bool_ord() {
133+
assert!(true > false);
134+
assert!(!(false > true));
135+
136+
assert!(false < true);
137+
assert!(!(true < false));
138+
139+
assert!(false <= false);
140+
assert!(false >= false);
141+
assert!(true <= true);
142+
assert!(true >= true);
143+
144+
assert!(false <= true);
145+
assert!(!(false >= true));
146+
assert!(true >= false);
147+
assert!(!(true <= false));
148+
}
149+
150+
#[test]
151+
fn test_bool_totalord() {
152+
assert_eq!(true.cmp(&true), Equal);
153+
assert_eq!(false.cmp(&false), Equal);
154+
assert_eq!(true.cmp(&false), Greater);
155+
assert_eq!(false.cmp(&true), Less);
156+
}
157+
}

branches/auto/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

0 commit comments

Comments
 (0)