Skip to content

Commit 8ede6e3

Browse files
committed
---
yaml --- r: 79398 b: refs/heads/snap-stage3 c: 7baff57 h: refs/heads/master v: v3
1 parent d7e8c12 commit 8ede6e3

File tree

241 files changed

+5237
-7235
lines changed

Some content is hidden

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

241 files changed

+5237
-7235
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 124eb2119c78651cfaaa7a046a101fa2e20f83ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fcc7aff62b23f85e8b12bfefb47bc073f49e8e8f
4+
refs/heads/snap-stage3: 7baff57f268eff79cd8ed6a8d7fd48d4b3f81878
55
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rust.md

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ code_. They are defined in the same way as any other Rust function,
10381038
except that they have the `extern` modifier.
10391039

10401040
~~~
1041-
// Declares an extern fn, the ABI defaults to "C"
1041+
// Declares an extern fn, the ABI defaults to "C"
10421042
extern fn new_vec() -> ~[int] { ~[] }
10431043
10441044
// Declares an extern fn with "stdcall" ABI
@@ -1723,62 +1723,6 @@ Supported traits for `deriving` are:
17231723
each constituent field of the type must also implement `ToStr` and will have
17241724
`field.to_str()` invoked to build up the result.
17251725

1726-
### Stability
1727-
One can indicate the stability of an API using the following attributes:
1728-
1729-
* `deprecated`: This item should no longer be used, e.g. it has been
1730-
replaced. No guarantee of backwards-compatibility.
1731-
* `experimental`: This item was only recently introduced or is
1732-
otherwise in a state of flux. It may change significantly, or even
1733-
be removed. No guarantee of backwards-compatibility.
1734-
* `unstable`: This item is still under development, but requires more
1735-
testing to be considered stable. No guarantee of backwards-compatibility.
1736-
* `stable`: This item is considered stable, and will not change
1737-
significantly. Guarantee of backwards-compatibility.
1738-
* `frozen`: This item is very stable, and is unlikely to
1739-
change. Guarantee of backwards-compatibility.
1740-
* `locked`: This item will never change unless a serious bug is
1741-
found. Guarantee of backwards-compatibility.
1742-
1743-
These levels are directly inspired by
1744-
[Node.js' "stability index"](http://nodejs.org/api/documentation.html).
1745-
1746-
There are lints for disallowing items marked with certain levels:
1747-
`deprecated`, `experimental` and `unstable`; the first two will warn
1748-
by default. Items with not marked with a stability are considered to
1749-
be unstable for the purposes of the lint. One can give an optional
1750-
string that will be displayed when the lint flags the use of an item.
1751-
1752-
~~~ {.xfail-test}
1753-
#[warn(unstable)];
1754-
1755-
#[deprecated="replaced by `best`"]
1756-
fn bad() {
1757-
// delete everything
1758-
}
1759-
1760-
fn better() {
1761-
// delete fewer things
1762-
}
1763-
1764-
#[stable]
1765-
fn best() {
1766-
// delete nothing
1767-
}
1768-
1769-
fn main() {
1770-
bad(); // "warning: use of deprecated item: replaced by `best`"
1771-
1772-
better(); // "warning: use of unmarked item"
1773-
1774-
best(); // no warning
1775-
}
1776-
~~~
1777-
1778-
> **Note:** Currently these are only checked when applied to
1779-
> individual functions, structs, methods and enum variants, *not* to
1780-
> entire modules, traits, impls or enums themselves.
1781-
17821726
# Statements and expressions
17831727

17841728
Rust is _primarily_ an expression language. This means that most forms of

branches/snap-stage3/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ RUNTIME_CXXS_$(1)_$(2) := \
7676
rt/rust_upcall.cpp \
7777
rt/rust_uv.cpp \
7878
rt/rust_crate_map.cpp \
79+
rt/rust_log.cpp \
7980
rt/isaac/randport.cpp \
8081
rt/miniz.cpp \
8182
rt/memory_region.cpp \

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
extern mod extra;
1717

1818
use std::os;
19-
use std::rt;
2019
use std::f64;
2120

2221
use extra::getopts;
@@ -224,10 +223,6 @@ pub fn mode_str(mode: mode) -> ~str {
224223
pub fn run_tests(config: &config) {
225224
let opts = test_opts(config);
226225
let tests = make_tests(config);
227-
// sadly osx needs some file descriptor limits raised for running tests in
228-
// parallel (especially when we have lots and lots of child processes).
229-
// For context, see #8904
230-
rt::test::prepare_for_lots_of_tests();
231226
let res = test::run_tests_console(&opts, tests);
232227
if !res { fail!("Some tests failed"); }
233228
}
@@ -307,9 +302,8 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
307302
// Try to elide redundant long paths
308303
fn shorten(path: &Path) -> ~str {
309304
let filename = path.filename();
310-
let p = path.pop();
311-
let dir = p.filename();
312-
fmt!("%s/%s", dir.unwrap_or_default(""), filename.unwrap_or_default(""))
305+
let dir = path.pop().filename();
306+
fmt!("%s/%s", dir.unwrap_or_default(~""), filename.unwrap_or_default(~""))
313307
}
314308

315309
test::DynTestName(fmt!("[%s] %s",

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
use common::config;
1212
use common;
13-
use util;
1413

1514
use std::io;
15+
use std::os;
1616

1717
pub struct TestProps {
1818
// Lines that should be expected, in order, on standard out
@@ -89,13 +89,13 @@ pub fn load_props(testfile: &Path) -> TestProps {
8989
}
9090

9191
pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
92-
fn xfail_target(config: &config) -> ~str {
93-
~"xfail-" + util::get_os(config.target)
92+
fn xfail_target() -> ~str {
93+
~"xfail-" + os::SYSNAME
9494
}
9595
9696
let val = do iter_header(testfile) |ln| {
9797
if parse_name_directive(ln, "xfail-test") { false }
98-
else if parse_name_directive(ln, xfail_target(config)) { false }
98+
else if parse_name_directive(ln, xfail_target()) { false }
9999
else if config.mode == common::mode_pretty &&
100100
parse_name_directive(ln, "xfail-pretty") { false }
101101
else { true }

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
880880
let dirs = os::list_dir_path(&Path(tstr));
881881
for file in dirs.iter() {
882882

883-
if (file.filetype() == Some(".so")) {
883+
if (file.filetype() == Some(~".so")) {
884884

885885
let copy_result = procsrv::run("", config.adb_path,
886886
[~"push", file.to_str(), config.adb_test_dir.clone()],

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ use common::config;
1313
use std::io;
1414
use std::os::getenv;
1515

16-
/// Conversion table from triple OS name to Rust SYSNAME
17-
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
18-
("mingw32", "win32"),
19-
("win32", "win32"),
20-
("darwin", "macos"),
21-
("android", "android"),
22-
("linux", "linux"),
23-
("freebsd", "freebsd"),
24-
];
25-
26-
pub fn get_os(triple: &str) -> &'static str {
27-
for &(triple_os, os) in OS_TABLE.iter() {
28-
if triple.contains(triple_os) {
29-
return os
30-
}
31-
}
32-
fail!("Cannot determine OS from triple");
33-
}
34-
3516
pub fn make_new_path(path: &str) -> ~str {
3617

3718
// Windows just uses PATH as the library search path, so we have to

branches/snap-stage3/src/etc/unicode.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ def emit_property_module(f, mod, tbl):
158158
keys.sort()
159159
emit_bsearch_range_table(f);
160160
for cat in keys:
161-
if cat == "Cs": continue
162161
f.write(" static %s_table : &'static [(char,char)] = &[\n" % cat)
163162
ix = 0
164163
for pair in tbl[cat]:

branches/snap-stage3/src/etc/vim/ftplugin/rust.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ else
2121
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
2222
endif
2323
setlocal commentstring=//%s
24-
setlocal formatoptions-=t formatoptions+=croqnl
25-
" j was only added in 7.3.541, so stop complaints about its nonexistence
26-
silent! setlocal formatoptions+=j
24+
setlocal formatoptions-=t formatoptions+=croqnlj
2725

2826
" This includeexpr isn't perfect, but it's a good start
2927
setlocal includeexpr=substitute(v:fname,'::','/','g')

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 34 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Sep 4
6+
" Last Change: 2013 Aug 1
77

88
if version < 600
99
syntax clear
1010
elseif exists("b:current_syntax")
1111
finish
1212
endif
1313

14-
" Syntax definitions {{{1
15-
" Basic keywords {{{2
1614
syn keyword rustConditional match if else
1715
syn keyword rustOperator as
1816

@@ -34,90 +32,47 @@ syn keyword rustStorage const mut ref static
3432
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3533
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3634

37-
" Reserved (but not yet used) keywords {{{2
35+
" reserved
3836
syn keyword rustKeyword be yield typeof
3937

40-
" Built-in types {{{2
4138
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
4239
syn keyword rustType f64 i8 i16 i32 i64 str Self
43-
44-
" Things from the prelude (src/libstd/prelude.rs) {{{2
45-
" This section is just straight transformation of the contents of the prelude,
46-
" to make it easy to update.
47-
48-
" Core operators {{{3
49-
syn keyword rustEnum Either
50-
syn keyword rustEnumVariant Left Right
51-
syn keyword rustTrait Sized
52-
syn keyword rustTrait Freeze Send
53-
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
54-
syn keyword rustTrait BitAnd BitOr BitXor
55-
syn keyword rustTrait Drop
56-
syn keyword rustTrait Shl Shr Index
57-
syn keyword rustEnum Option
58-
syn keyword rustEnumVariant Some None
59-
syn keyword rustEnum Result
60-
syn keyword rustEnumVariant Ok Err
61-
62-
" Functions {{{3
63-
"syn keyword rustFunction print println
64-
"syn keyword rustFunction range
65-
66-
" Types and traits {{{3
67-
syn keyword rustTrait ToCStr
68-
syn keyword rustTrait Clone DeepClone
69-
syn keyword rustTrait Eq ApproxEq Ord TotalEq TotalOrd Ordering Equiv
70-
syn keyword rustEnumVariant Less Equal Greater
71-
syn keyword rustTrait Char
72-
syn keyword rustTrait Container Mutable Map MutableMap Set MutableSet
73-
syn keyword rustTrait Hash
74-
syn keyword rustTrait Times
75-
syn keyword rustTrait FromIterator Extendable
76-
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator ClonableIterator
77-
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
78-
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
79-
syn keyword rustTrait Orderable Signed Unsigned Round
80-
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
81-
syn keyword rustTrait Integer Fractional Real RealExt
82-
syn keyword rustTrait Bitwise BitCount Bounded
83-
syn keyword rustTrait Primitive Int Float ToStrRadix
84-
syn keyword rustTrait GenericPath
85-
syn keyword rustTrait Path
86-
syn keyword rustTrait PosixPath
87-
syn keyword rustTrait WindowsPath
88-
syn keyword rustTrait RawPtr
89-
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
90-
syn keyword rustTrait Str StrVector StrSlice OwnedStr
91-
syn keyword rustTrait FromStr
92-
syn keyword rustTrait IterBytes
93-
syn keyword rustTrait ToStr ToStrConsume
94-
syn keyword rustTrait CopyableTuple ImmutableTuple
95-
syn keyword rustTrait CloneableTuple1 ImmutableTuple1
96-
syn keyword rustTrait CloneableTuple2 CloneableTuple3 CloneableTuple4 CloneableTuple5
97-
syn keyword rustTrait CloneableTuple6 CloneableTuple7 CloneableTuple8 CloneableTuple9
98-
syn keyword rustTrait CloneableTuple10 CloneableTuple11 CloneableTuple12
99-
syn keyword rustTrait ImmutableTuple2 ImmutableTuple3 ImmutableTuple4 ImmutableTuple5
100-
syn keyword rustTrait ImmutableTuple6 ImmutableTuple7 ImmutableTuple8 ImmutableTuple9
101-
syn keyword rustTrait ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
102-
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
103-
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCopyableVector
104-
syn keyword rustTrait OwnedVector OwnedCopyableVector OwnedEqVector MutableVector
105-
syn keyword rustTrait Reader ReaderUtil Writer WriterUtil
106-
syn keyword rustTrait Default
107-
108-
"syn keyword rustFunction stream
109-
syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable
110-
"syn keyword rustFunction spawn
40+
syn keyword rustType Option Either
41+
42+
" Types from libc
43+
syn keyword rustType c_float c_double c_void FILE fpos_t
44+
syn keyword rustType DIR dirent
45+
syn keyword rustType c_char c_schar c_uchar
46+
syn keyword rustType c_short c_ushort c_int c_uint c_long c_ulong
47+
syn keyword rustType size_t ptrdiff_t clock_t time_t
48+
syn keyword rustType c_longlong c_ulonglong intptr_t uintptr_t
49+
syn keyword rustType off_t dev_t ino_t pid_t mode_t ssize_t
50+
51+
syn keyword rustTrait Const Copy Send Owned Sized " inherent traits
52+
syn keyword rustTrait Clone Decodable Encodable IterBytes Rand ToStr
53+
syn keyword rustTrait Eq Ord TotalEq TotalOrd Num Ptr
54+
syn keyword rustTrait Drop Add Sub Mul Quot Rem Neg BitAnd BitOr
55+
syn keyword rustTrait BitXor Shl Shr Index
11156

11257
syn keyword rustSelf self
11358
syn keyword rustBoolean true false
11459

11560
syn keyword rustConstant Some None " option
11661
syn keyword rustConstant Left Right " either
11762
syn keyword rustConstant Ok Err " result
118-
syn keyword rustConstant Less Equal Greater " Ordering
119-
120-
" Other syntax {{{2
63+
syn keyword rustConstant Success Failure " task
64+
syn keyword rustConstant Cons Nil " list
65+
" syn keyword rustConstant empty node " tree
66+
67+
" Constants from libc
68+
syn keyword rustConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
69+
syn keyword rustConstant EOF SEEK_SET SEEK_CUR SEEK_END _IOFBF _IONBF
70+
syn keyword rustConstant _IOLBF BUFSIZ FOPEN_MAX FILENAME_MAX L_tmpnam
71+
syn keyword rustConstant TMP_MAX O_RDONLY O_WRONLY O_RDWR O_APPEND O_CREAT
72+
syn keyword rustConstant O_EXCL O_TRUNC S_IFIFO S_IFCHR S_IFBLK S_IFDIR
73+
syn keyword rustConstant S_IFREG S_IFMT S_IEXEC S_IWRITE S_IREAD S_IRWXU
74+
syn keyword rustConstant S_IXUSR S_IWUSR S_IRUSR F_OK R_OK W_OK X_OK
75+
syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
12176

12277
" If foo::bar changes to foo.bar, change this ("::" to "\.").
12378
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
@@ -147,8 +102,7 @@ syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
147102
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
148103
syn match rustFormat display "%%" contained
149104
syn match rustSpecial display contained /\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
150-
syn match rustStringContinuation display contained /\\\n\s*/
151-
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
105+
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial
152106

153107
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
154108
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
@@ -183,20 +137,18 @@ syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit
183137
syn match rustCharacter /'\([^'\\]\|\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
184138

185139
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
186-
syn region rustComment start="//" end="$" contains=rustTodo keepend
140+
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
187141
syn region rustCommentMLDoc start="/\*\%(!\|\*/\@!\)" end="\*/" contains=rustTodo
188-
syn region rustCommentDoc start="//[/!]" end="$" contains=rustTodo keepend
142+
syn region rustCommentDoc start="//[/!]" skip="\\$" end="$" contains=rustTodo keepend
189143

190144
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
191145

192-
" Folding rules {{{2
193146
" Trivial folding rules to begin with.
194147
" TODO: use the AST to make really good folding
195148
syn region rustFoldBraces start="{" end="}" transparent fold
196149
" If you wish to enable this, setlocal foldmethod=syntax
197150
" It's not enabled by default as it would drive some people mad.
198151

199-
" Default highlighting {{{1
200152
hi def link rustHexNumber rustNumber
201153
hi def link rustBinNumber rustNumber
202154
hi def link rustIdentifierPrime rustIdentifier
@@ -205,13 +157,10 @@ hi def link rustTrait rustType
205157
hi def link rustSigil StorageClass
206158
hi def link rustFormat Special
207159
hi def link rustSpecial Special
208-
hi def link rustStringContinuation Special
209160
hi def link rustString String
210161
hi def link rustCharacter Character
211162
hi def link rustNumber Number
212163
hi def link rustBoolean Boolean
213-
hi def link rustEnum rustType
214-
hi def link rustEnumVariant rustConstant
215164
hi def link rustConstant Constant
216165
hi def link rustSelf Constant
217166
hi def link rustFloat Float
@@ -222,7 +171,6 @@ hi def link rustIdentifier Identifier
222171
hi def link rustCapsIdent rustIdentifier
223172
hi def link rustModPath Include
224173
hi def link rustModPathSep Delimiter
225-
hi def link rustFunction Function
226174
hi def link rustFuncName Function
227175
hi def link rustFuncCall Function
228176
hi def link rustCommentMLDoc rustCommentDoc

0 commit comments

Comments
 (0)