Skip to content

Commit 467a62b

Browse files
committed
---
yaml --- r: 147023 b: refs/heads/try2 c: c00837e h: refs/heads/master i: 147021: 873dcac 147019: b7d0115 147015: 99d9466 147007: e295c74 v: v3
1 parent 05ad37b commit 467a62b

File tree

96 files changed

+612
-819
lines changed

Some content is hidden

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

96 files changed

+612
-819
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: 9b9cf9892b74dc376fe740ea56858042e9bd89de
8+
refs/heads/try2: c00837e90ade4baaae6639b4a89b26636ca01227
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ endif
134134
# static copies of libstd and libextra. We also generate dynamic versions of all
135135
# libraries, so in the interest of space, prefer dynamic linking throughout the
136136
# compilation process.
137-
RUSTFLAGS_STAGE0 += -Z prefer-dynamic
138137
RUSTFLAGS_STAGE1 += -Z prefer-dynamic
139138
RUSTFLAGS_STAGE2 += -Z prefer-dynamic
140139
RUSTFLAGS_STAGE3 += -Z prefer-dynamic

branches/try2/configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,11 +893,11 @@ do
893893
LLVM_CC_64="ccache clang -Qunused-arguments"
894894
;;
895895
("clang")
896-
LLVM_CXX_32="clang++ -m32 -Qunused-arguments"
897-
LLVM_CC_32="clang -m32 -Qunused-arguments"
896+
LLVM_CXX_32="clang++ -m32"
897+
LLVM_CC_32="clang -m32"
898898

899-
LLVM_CXX_64="clang++ -Qunused-arguments"
900-
LLVM_CC_64="clang -Qunused-arguments"
899+
LLVM_CXX_64="clang++"
900+
LLVM_CC_64="clang"
901901
;;
902902
("ccache gcc")
903903
LLVM_CXX_32="ccache g++ -m32"

branches/try2/doc/rust.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,32 +3225,6 @@ let bo: Binop = add;
32253225
x = bo(5,7);
32263226
~~~~
32273227

3228-
### Closure types
3229-
3230-
The type of a closure mapping an input of type `A` to an output of type `B` is `|A| -> B`. A closure with no arguments or return values has type `||`.
3231-
3232-
3233-
An example of creating and calling a closure:
3234-
3235-
```rust
3236-
let captured_var = 10;
3237-
3238-
let closure_no_args = || println!("captured_var={}", captured_var);
3239-
3240-
let closure_args = |arg: int| -> int {
3241-
println!("captured_var={}, arg={}", captured_var, arg);
3242-
arg // Note lack of semicolon after 'arg'
3243-
};
3244-
3245-
fn call_closure(c1: ||, c2: |int| -> int) {
3246-
c1();
3247-
c2(2);
3248-
}
3249-
3250-
call_closure(closure_no_args, closure_args);
3251-
3252-
```
3253-
32543228
### Object types
32553229

32563230
Every trait item (see [traits](#traits)) defines a type with the same name as the trait.

branches/try2/mk/platform.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ AR := ar
8888

8989
CFG_INFO := $(info cfg: using $(CFG_C_COMPILER))
9090
ifeq ($(CFG_C_COMPILER),clang)
91-
# The -Qunused-arguments sidesteps spurious warnings from clang
9291
ifeq ($(origin CC),default)
93-
CC=clang -Qunused-arguments
92+
CC=clang
9493
endif
9594
ifeq ($(origin CXX),default)
96-
CXX=clang++ -Qunused-arguments
95+
CXX=clang++
9796
endif
9897
ifeq ($(origin CPP),default)
99-
CPP=clang -Qunused-arguments
98+
CPP=clang
10099
endif
101100
else
102101
ifeq ($(CFG_C_COMPILER),gcc)

branches/try2/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,11 +920,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
920920

921921
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
922922
$(S)src/test/run-make/%/Makefile \
923-
$$(HSREQ$(1)_H_$(3))
923+
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
924924
@rm -rf $(3)/test/run-make/$$*
925925
@mkdir -p $(3)/test/run-make/$$*
926926
@echo maketest: $$*
927-
$$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
927+
$$(Q)python $(S)src/etc/maketest.py $$(dir $$<) \
928928
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
929929
$(3)/test/run-make/$$* \
930930
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))"

branches/try2/src/compiletest/procsrv.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ pub fn run(lib_path: &str,
6060
for input in input.iter() {
6161
process.input().write(input.as_bytes());
6262
}
63-
let run::ProcessOutput { status, output, error } = process.finish_with_output();
63+
let output = process.finish_with_output();
6464

6565
Result {
66-
status: status,
67-
out: str::from_utf8_owned(output),
68-
err: str::from_utf8_owned(error)
66+
status: output.status,
67+
out: str::from_utf8(output.output),
68+
err: str::from_utf8(output.error)
6969
}
7070
}
7171

@@ -90,3 +90,4 @@ pub fn run_background(lib_path: &str,
9090

9191
return process;
9292
}
93+

branches/try2/src/compiletest/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
298298

299299
let adb_arg = format!("export LD_LIBRARY_PATH={}; gdbserver :5039 {}/{}",
300300
config.adb_test_dir.clone(), config.adb_test_dir.clone(),
301-
str::from_utf8(exe_file.filename().unwrap()));
301+
str::from_utf8(exe_file.filename().unwrap())).clone();
302302

303303
let mut process = procsrv::run_background("", config.adb_path.clone(),
304304
[~"shell",adb_arg.clone()],~[(~"",~"")], Some(~""));
@@ -1151,3 +1151,4 @@ fn run_codegen_test(config: &config, props: &TestProps,
11511151
(base_lines as f64) / (clang_lines as f64),
11521152
0.001);
11531153
}
1154+

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

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Dec 04
6+
" Last Change: 2013 Oct 29
77

88
if version < 600
99
syntax clear
@@ -28,7 +28,6 @@ syn keyword rustKeyword use nextgroup=rustModPath skipwhite
2828
" FIXME: Scoped impl's name is also fallen in this category
2929
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
3030
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
31-
syn keyword rustKeyword proc
3231
syn keyword rustStorage const mut ref static
3332

3433
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -90,7 +89,6 @@ syn keyword rustTrait Orderable Signed Unsigned Round
9089
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
9190
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
9291
syn keyword rustTrait RawPtr
93-
syn keyword rustTrait Buffer Writer Reader Seek
9492
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9593
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9694
syn keyword rustTrait IterBytes
@@ -145,29 +143,38 @@ syn match rustOperator display "&&\|||"
145143
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
146144
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
147145

148-
syn match rustSpecialError display contained /\\./
146+
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
147+
syn match rustFormat display "%%" contained
149148
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
150149
syn match rustStringContinuation display contained /\\\n\s*/
151-
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation
150+
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
152151
syn region rustString start='r\z(#*\)"' end='"\z1'
153152

154153
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
155154
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
156155

157156
" Number literals
158-
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
159-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
160-
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
161-
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
162-
163-
" To mark it as a float, it must have at least one of the three things integral values don't have:
164-
" a decimal point and more numbers; an exponent; and a type suffix.
165-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
166-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
167-
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
168-
" Special case for numbers of the form "1." which are float literals, unless followed by
169-
" an identifier, which makes them integer literals with a method call or field access.
170-
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
157+
syn match rustNumber display "\<[0-9][0-9_]*\>"
158+
syn match rustNumber display "\<[0-9][0-9_]*\(u\|u8\|u16\|u32\|u64\)\>"
159+
syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
160+
161+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
162+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"
163+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(i8\|i16\|i32\|i64\)\>"
164+
syn match rustOctNumber display "\<0o[0-7_]\+\>"
165+
syn match rustOctNumber display "\<0o[0-7_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166+
syn match rustOctNumber display "\<0o[0-7_]\+\(i8\|i16\|i32\|i64\)\>"
167+
syn match rustBinNumber display "\<0b[01_]\+\>"
168+
syn match rustBinNumber display "\<0b[01_]\+\(u\|u8\|u16\|u32\|u64\)\>"
169+
syn match rustBinNumber display "\<0b[01_]\+\(i8\|i16\|i32\|i64\)\>"
170+
171+
syn match rustFloat display "\<[0-9][0-9_]*\(f\|f32\|f64\)\>"
172+
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\>"
173+
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
174+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\>"
175+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>"
176+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
177+
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
171178

172179
" For the benefit of delimitMate
173180
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
@@ -176,24 +183,12 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
176183

177184
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
178185
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
179-
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
180-
181-
syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
182-
syn region rustCommentLine start="//" end="$" contains=rustTodo
183-
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo
184-
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment keepend extend
185-
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment keepend extend
186-
" FIXME: this is a really ugly and not fully correct implementation. Most
187-
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
188-
" a comment, but in practice at present it leaves comments open two levels
189-
" deep. But as long as you stay away from that particular case, I *believe*
190-
" the highlighting is correct. Due to the way Vim's syntax engine works
191-
" (greedy for start matches, unlike Rust's tokeniser which is searching for
192-
" the earliest-starting match, start or end), I believe this cannot be solved.
193-
" Oh you who would fix it, don't bother with things like duplicating the Block
194-
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
195-
" then you must deal with cases like ``/*/**/*/``. And don't try making it
196-
" worse with ``\%(/\@<!\*\)\@<!``, either...
186+
syn match rustCharacter /'\([^'\\]\|\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
187+
188+
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
189+
syn region rustComment start="//" end="$" contains=rustTodo keepend
190+
syn region rustCommentMLDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo
191+
syn region rustCommentDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo keepend
197192

198193
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
199194

@@ -205,16 +200,15 @@ syn region rustFoldBraces start="{" end="}" transparent fold
205200
" It's not enabled by default as it would drive some people mad.
206201

207202
" Default highlighting {{{1
208-
hi def link rustDecNumber rustNumber
209203
hi def link rustHexNumber rustNumber
210204
hi def link rustOctNumber rustNumber
211205
hi def link rustBinNumber rustNumber
212206
hi def link rustIdentifierPrime rustIdentifier
213207
hi def link rustTrait rustType
214208

215209
hi def link rustSigil StorageClass
210+
hi def link rustFormat Special
216211
hi def link rustSpecial Special
217-
hi def link rustSpecialError Error
218212
hi def link rustStringContinuation Special
219213
hi def link rustString String
220214
hi def link rustCharacter Character
@@ -235,10 +229,10 @@ hi def link rustModPathSep Delimiter
235229
hi def link rustFunction Function
236230
hi def link rustFuncName Function
237231
hi def link rustFuncCall Function
238-
hi def link rustCommentLine Comment
239-
hi def link rustCommentLineDoc SpecialComment
240-
hi def link rustCommentBlock rustCommentLine
241-
hi def link rustCommentBlockDoc rustCommentLineDoc
232+
hi def link rustCommentMLDoc rustCommentDoc
233+
hi def link rustCommentDoc SpecialComment
234+
hi def link rustCommentML rustComment
235+
hi def link rustComment Comment
242236
hi def link rustAssert PreCondit
243237
hi def link rustFail PreCondit
244238
hi def link rustMacro Macro

branches/try2/src/libextra/base64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'self> FromBase64 for &'self str {
162162
* Convert any base64 encoded string (literal, `@`, `&`, or `~`)
163163
* to the byte values it encodes.
164164
*
165-
* You can use the `from_utf8_owned` function in `std::str`
165+
* You can use the `from_utf8` function in `std::str`
166166
* to turn a `[u8]` into a string with characters corresponding to those
167167
* values.
168168
*
@@ -180,7 +180,7 @@ impl<'self> FromBase64 for &'self str {
180180
* println!("base64 output: {}", hello_str);
181181
* let res = hello_str.from_base64();
182182
* if res.is_ok() {
183-
* let optBytes = str::from_utf8_owned_opt(res.unwrap());
183+
* let optBytes = str::from_utf8_opt(res.unwrap());
184184
* if optBytes.is_some() {
185185
* println!("decoded from base64: {}", optBytes.unwrap());
186186
* }

0 commit comments

Comments
 (0)