Skip to content

Commit 9a4a27e

Browse files
committed
---
yaml --- r: 69630 b: refs/heads/auto c: 887c656 h: refs/heads/master v: v3
1 parent d17d6ac commit 9a4a27e

Some content is hidden

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

44 files changed

+2646
-1406
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: 44cb1c3adba18ae36441649f7264ecb834ea2502
17+
refs/heads/auto: 887c65697056b23be69b9b11f41637d07327626e
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ compiler needs assistance, though, the arguments and return types may be
14551455
annotated.
14561456

14571457
~~~~
1458-
let square = |x: int| -> uint { x * x as uint };
1458+
let square = |x: int| -> uint { (x * x) as uint };
14591459
~~~~
14601460

14611461
There are several forms of closure, each with its own role. The most

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

Lines changed: 6 additions & 23 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 Aug 1
6+
" Last Change: 2013 Jul 10
77

88
if version < 600
99
syntax clear
@@ -17,7 +17,7 @@ syn keyword rustOperator as
1717
syn match rustAssert "\<assert\(\w\)*!" contained
1818
syn match rustFail "\<fail\(\w\)*!" contained
1919
syn keyword rustKeyword break copy do extern
20-
syn keyword rustKeyword foreach in if impl let log
20+
syn keyword rustKeyword for if impl let log
2121
syn keyword rustKeyword copy do extern
2222
syn keyword rustKeyword for impl let log
2323
syn keyword rustKeyword loop mod once priv pub
@@ -83,26 +83,12 @@ syn match rustModPathSep "::"
8383
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
8484
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
8585

86-
" This is merely a convention; note also the use of [A-Z], restricting it to
87-
" latin identifiers rather than the full Unicode uppercase. I have not used
88-
" [:upper:] as it depends upon 'noignorecase'
89-
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
90-
91-
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
92-
" This one isn't *quite* right, as we could have binary-& with a reference
93-
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
94-
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
95-
" This isn't actually correct; a closure with no arguments can be `|| { }`.
96-
" Last, because the & in && isn't a sigil
97-
syn match rustOperator display "&&\|||"
98-
9986
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
10087
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
10188

10289
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
10390
syn match rustFormat display "%%" contained
104-
syn match rustSpecial display contained /\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
105-
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial
91+
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat
10692

10793
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
10894
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
@@ -128,13 +114,13 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
128114
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
129115

130116
" For the benefit of delimitMate
131-
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
117+
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
132118
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
133-
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
119+
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
134120

135121
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
136122
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
137-
syn match rustCharacter /'\([^'\\]\|\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
123+
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
138124

139125
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
140126
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
@@ -154,9 +140,7 @@ hi def link rustBinNumber rustNumber
154140
hi def link rustIdentifierPrime rustIdentifier
155141
hi def link rustTrait rustType
156142

157-
hi def link rustSigil StorageClass
158143
hi def link rustFormat Special
159-
hi def link rustSpecial Special
160144
hi def link rustString String
161145
hi def link rustCharacter Character
162146
hi def link rustNumber Number
@@ -168,7 +152,6 @@ hi def link rustOperator Operator
168152
hi def link rustKeyword Keyword
169153
hi def link rustConditional Conditional
170154
hi def link rustIdentifier Identifier
171-
hi def link rustCapsIdent rustIdentifier
172155
hi def link rustModPath Include
173156
hi def link rustModPathSep Delimiter
174157
hi def link rustFuncName Function

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ use metadata::filesearch::FileSearch;
1717
use metadata::loader;
1818

1919
use std::hashmap::HashMap;
20+
use syntax::ast;
2021
use syntax::attr;
2122
use syntax::attr::AttrMetaMethods;
2223
use syntax::codemap::{span, dummy_sp};
2324
use syntax::diagnostic::span_handler;
2425
use syntax::parse::token;
2526
use syntax::parse::token::ident_interner;
26-
use syntax::visit;
27-
use syntax::ast;
27+
use syntax::oldvisit;
2828

2929
// Traverses an AST, reading all the information about use'd crates and extern
3030
// libraries necessary for later resolving, typechecking, linking, etc.
@@ -46,12 +46,12 @@ pub fn read_crates(diag: @span_handler,
4646
intr: intr
4747
};
4848
let v =
49-
visit::mk_simple_visitor(@visit::SimpleVisitor {
49+
oldvisit::mk_simple_visitor(@oldvisit::SimpleVisitor {
5050
visit_view_item: |a| visit_view_item(e, a),
5151
visit_item: |a| visit_item(e, a),
52-
.. *visit::default_simple_visitor()});
52+
.. *oldvisit::default_simple_visitor()});
5353
visit_crate(e, crate);
54-
visit::visit_crate(crate, ((), v));
54+
oldvisit::visit_crate(crate, ((), v));
5555
dump_crates(*e.crate_cache);
5656
warn_if_multiple_versions(e, diag, *e.crate_cache);
5757
}

branches/auto/src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use syntax::attr;
3939
use syntax::attr::AttrMetaMethods;
4040
use syntax::diagnostic::span_handler;
4141
use syntax::parse::token::special_idents;
42-
use syntax::{ast_util, visit};
42+
use syntax::{ast_util, oldvisit};
4343
use syntax::parse::token;
4444
use syntax;
4545
use writer = extra::ebml::writer;
@@ -1199,12 +1199,12 @@ fn encode_info_for_items(ecx: &EncodeContext,
11991199
// See comment in `encode_side_tables_for_ii` in astencode
12001200
let ecx_ptr : *() = unsafe { cast::transmute(ecx) };
12011201

1202-
visit::visit_crate(crate, ((), visit::mk_vt(@visit::Visitor {
1202+
oldvisit::visit_crate(crate, ((), oldvisit::mk_vt(@oldvisit::Visitor {
12031203
visit_expr: |_e, (_cx, _v)| { },
12041204
visit_item: {
12051205
let ebml_w = (*ebml_w).clone();
12061206
|i, (cx, v)| {
1207-
visit::visit_item(i, (cx, v));
1207+
oldvisit::visit_item(i, (cx, v));
12081208
match items.get_copy(&i.id) {
12091209
ast_map::node_item(_, pt) => {
12101210
let mut ebml_w = ebml_w.clone();
@@ -1219,7 +1219,7 @@ fn encode_info_for_items(ecx: &EncodeContext,
12191219
visit_foreign_item: {
12201220
let ebml_w = (*ebml_w).clone();
12211221
|ni, (cx, v)| {
1222-
visit::visit_foreign_item(ni, (cx, v));
1222+
oldvisit::visit_foreign_item(ni, (cx, v));
12231223
match items.get_copy(&ni.id) {
12241224
ast_map::node_foreign_item(_, abi, _, pt) => {
12251225
debug!("writing foreign item %s::%s",
@@ -1243,7 +1243,7 @@ fn encode_info_for_items(ecx: &EncodeContext,
12431243
}
12441244
}
12451245
},
1246-
..*visit::default_visitor()
1246+
..*oldvisit::default_visitor()
12471247
})));
12481248
ebml_w.end_tag();
12491249
return /*bad*/(*index).clone();

branches/auto/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use syntax::ast::{m_mutbl, m_imm, m_const};
2727
use syntax::ast;
2828
use syntax::ast_util;
2929
use syntax::codemap::span;
30-
use syntax::visit;
30+
use syntax::oldvisit;
3131
use util::ppaux::Repr;
3232

3333
#[deriving(Clone)]
@@ -54,12 +54,14 @@ pub fn check_loans(bccx: @BorrowckCtxt,
5454
reported: @mut HashSet::new(),
5555
};
5656

57-
let vt = visit::mk_vt(@visit::Visitor {visit_expr: check_loans_in_expr,
58-
visit_local: check_loans_in_local,
59-
visit_block: check_loans_in_block,
60-
visit_pat: check_loans_in_pat,
61-
visit_fn: check_loans_in_fn,
62-
.. *visit::default_visitor()});
57+
let vt = oldvisit::mk_vt(@oldvisit::Visitor {
58+
visit_expr: check_loans_in_expr,
59+
visit_local: check_loans_in_local,
60+
visit_block: check_loans_in_block,
61+
visit_pat: check_loans_in_pat,
62+
visit_fn: check_loans_in_fn,
63+
.. *oldvisit::default_visitor()
64+
});
6365
(vt.visit_block)(body, (clcx, vt));
6466
}
6567

@@ -612,27 +614,27 @@ impl<'self> CheckLoanCtxt<'self> {
612614
}
613615
}
614616

615-
fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
617+
fn check_loans_in_fn<'a>(fk: &oldvisit::fn_kind,
616618
decl: &ast::fn_decl,
617619
body: &ast::Block,
618620
sp: span,
619621
id: ast::NodeId,
620622
(this, visitor): (CheckLoanCtxt<'a>,
621-
visit::vt<CheckLoanCtxt<'a>>)) {
623+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
622624
match *fk {
623-
visit::fk_item_fn(*) |
624-
visit::fk_method(*) => {
625+
oldvisit::fk_item_fn(*) |
626+
oldvisit::fk_method(*) => {
625627
// Don't process nested items.
626628
return;
627629
}
628630

629-
visit::fk_anon(*) |
630-
visit::fk_fn_block(*) => {
631+
oldvisit::fk_anon(*) |
632+
oldvisit::fk_fn_block(*) => {
631633
check_captured_variables(this, id, sp);
632634
}
633635
}
634636

635-
visit::visit_fn(fk, decl, body, sp, id, (this, visitor));
637+
oldvisit::visit_fn(fk, decl, body, sp, id, (this, visitor));
636638

637639
fn check_captured_variables(this: CheckLoanCtxt,
638640
closure_id: ast::NodeId,
@@ -677,14 +679,14 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
677679

678680
fn check_loans_in_local<'a>(local: @ast::Local,
679681
(this, vt): (CheckLoanCtxt<'a>,
680-
visit::vt<CheckLoanCtxt<'a>>)) {
681-
visit::visit_local(local, (this, vt));
682+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
683+
oldvisit::visit_local(local, (this, vt));
682684
}
683685

684686
fn check_loans_in_expr<'a>(expr: @ast::expr,
685687
(this, vt): (CheckLoanCtxt<'a>,
686-
visit::vt<CheckLoanCtxt<'a>>)) {
687-
visit::visit_expr(expr, (this, vt));
688+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
689+
oldvisit::visit_expr(expr, (this, vt));
688690

689691
debug!("check_loans_in_expr(expr=%s)",
690692
expr.repr(this.tcx()));
@@ -737,17 +739,17 @@ fn check_loans_in_expr<'a>(expr: @ast::expr,
737739

738740
fn check_loans_in_pat<'a>(pat: @ast::pat,
739741
(this, vt): (CheckLoanCtxt<'a>,
740-
visit::vt<CheckLoanCtxt<'a>>))
742+
oldvisit::vt<CheckLoanCtxt<'a>>))
741743
{
742744
this.check_for_conflicting_loans(pat.id);
743745
this.check_move_out_from_id(pat.id, pat.span);
744-
visit::visit_pat(pat, (this, vt));
746+
oldvisit::visit_pat(pat, (this, vt));
745747
}
746748

747749
fn check_loans_in_block<'a>(blk: &ast::Block,
748750
(this, vt): (CheckLoanCtxt<'a>,
749-
visit::vt<CheckLoanCtxt<'a>>))
751+
oldvisit::vt<CheckLoanCtxt<'a>>))
750752
{
751-
visit::visit_block(blk, (this, vt));
753+
oldvisit::visit_block(blk, (this, vt));
752754
this.check_for_conflicting_loans(blk.id);
753755
}

0 commit comments

Comments
 (0)