Skip to content

Commit ffbc2e9

Browse files
committed
---
yaml --- r: 208574 b: refs/heads/snap-stage3 c: 6149e32 h: refs/heads/master v: v3
1 parent ce6fcbd commit ffbc2e9

File tree

9 files changed

+40
-73
lines changed

9 files changed

+40
-73
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: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4ce08a5d70a4dfc4da7ed0bc0098cfd2176b8411
4+
refs/heads/snap-stage3: 6149e32b0ba41b39d6d81b7f5d28908c86debf18
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# The Rust Programming Language
22

3-
Rust is a systems programming language that is fast, memory safe and
4-
multithreaded, but does not employ a garbage collector or otherwise
5-
impose significant runtime overhead.
6-
7-
This repo contains the code for `rustc`, the Rust compiler, as well
8-
as standard libraries, tools and documentation for Rust.
3+
This is a compiler for Rust, including standard libraries, tools and
4+
documentation. Rust is a systems programming language that is fast,
5+
memory safe and multithreaded, but does not employ a garbage collector
6+
or otherwise impose significant runtime overhead.
97

108
## Quick Start
119

branches/snap-stage3/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.1.0
16+
CFG_RELEASE_NUM=1.2.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

branches/snap-stage3/src/doc/trpl/const-and-static.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ static N: i32 = 5;
3131

3232
Unlike [`let`][let] bindings, you must annotate the type of a `static`.
3333

34+
[let]: variable-bindings.html
35+
3436
Statics live for the entire lifetime of a program, and therefore any
35-
reference stored in a constant has a [`'static` lifetime][lifetimes]:
37+
reference stored in a constant has a [`static` lifetime][lifetimes]:
3638

3739
```rust
3840
static NAME: &'static str = "Steve";

branches/snap-stage3/src/doc/trpl/nightly-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ $ sh rustup.sh --channel=nightly
2626
If you're on Windows, please download either the [32-bit installer][win32] or
2727
the [64-bit installer][win64] and run it.
2828

29-
[win32]: https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.msi
30-
[win64]: https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.msi
29+
[win32]: https://static.rust-lang.org/dist/rust-1.0.0-beta-i686-pc-windows-gnu.msi
30+
[win64]: https://static.rust-lang.org/dist/rust-1.0.0-beta-x86_64-pc-windows-gnu.msi
3131

3232
## Uninstalling
3333

branches/snap-stage3/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ let result = f.write("whatever".as_bytes());
208208

209209
This will compile without error.
210210

211-
This means that even if someone does something bad like add methods to `i32`,
211+
This means that even if someone does something bad like add methods to `int`,
212212
it won’t affect you, unless you `use` that trait.
213213

214214
There’s one more restriction on implementing traits. Either the trait or the

branches/snap-stage3/src/libsyntax/parse/lexer/mod.rs

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -403,51 +403,45 @@ impl<'a> StringReader<'a> {
403403
Some('/') => {
404404
self.bump();
405405
self.bump();
406-
407406
// line comments starting with "///" or "//!" are doc-comments
408-
let doc_comment = self.curr_is('/') || self.curr_is('!');
409-
let start_bpos = if doc_comment {
410-
self.pos - BytePos(3)
411-
} else {
412-
self.last_pos - BytePos(2)
413-
};
414-
415-
while !self.is_eof() {
416-
match self.curr.unwrap() {
417-
'\n' => break,
418-
'\r' => {
419-
if self.nextch_is('\n') {
420-
// CRLF
421-
break
422-
} else if doc_comment {
423-
self.err_span_(self.last_pos, self.pos,
424-
"bare CR not allowed in doc-comment");
407+
if self.curr_is('/') || self.curr_is('!') {
408+
let start_bpos = self.pos - BytePos(3);
409+
while !self.is_eof() {
410+
match self.curr.unwrap() {
411+
'\n' => break,
412+
'\r' => {
413+
if self.nextch_is('\n') {
414+
// CRLF
415+
break
416+
} else {
417+
self.err_span_(self.last_pos, self.pos,
418+
"bare CR not allowed in doc-comment");
419+
}
425420
}
421+
_ => ()
426422
}
427-
_ => ()
423+
self.bump();
428424
}
429-
self.bump();
430-
}
431-
432-
return if doc_comment {
433-
self.with_str_from(start_bpos, |string| {
434-
// comments with only more "/"s are not doc comments
425+
return self.with_str_from(start_bpos, |string| {
426+
// but comments with only more "/"s are not
435427
let tok = if is_doc_comment(string) {
436428
token::DocComment(token::intern(string))
437429
} else {
438430
token::Comment
439431
};
440432

441-
Some(TokenAndSpan {
433+
return Some(TokenAndSpan{
442434
tok: tok,
443435
sp: codemap::mk_sp(start_bpos, self.last_pos)
444-
})
445-
})
436+
});
437+
});
446438
} else {
447-
Some(TokenAndSpan {
439+
let start_bpos = self.last_pos - BytePos(2);
440+
while !self.curr_is('\n') && !self.is_eof() { self.bump(); }
441+
return Some(TokenAndSpan {
448442
tok: token::Comment,
449443
sp: codemap::mk_sp(start_bpos, self.last_pos)
450-
})
444+
});
451445
}
452446
}
453447
Some('*') => {
@@ -1569,13 +1563,4 @@ mod tests {
15691563
assert_eq!(lexer.next_token().tok, token::Literal(token::Char(token::intern("a")), None));
15701564
}
15711565

1572-
#[test] fn crlf_comments() {
1573-
let sh = mk_sh();
1574-
let mut lexer = setup(&sh, "// test\r\n/// test\r\n".to_string());
1575-
let comment = lexer.next_token();
1576-
assert_eq!(comment.tok, token::Comment);
1577-
assert_eq!(comment.sp, ::codemap::mk_sp(BytePos(0), BytePos(7)));
1578-
assert_eq!(lexer.next_token().tok, token::Whitespace);
1579-
assert_eq!(lexer.next_token().tok, token::DocComment(token::intern("/// test")));
1580-
}
15811566
}

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,8 +2026,7 @@ impl<'a> Parser<'a> {
20262026
return self.parse_block_expr(lo, DefaultBlock);
20272027
},
20282028
token::BinOp(token::Or) | token::OrOr => {
2029-
let lo = self.span.lo;
2030-
return self.parse_lambda_expr(lo, CaptureByRef);
2029+
return self.parse_lambda_expr(CaptureByRef);
20312030
},
20322031
token::Ident(id @ ast::Ident {
20332032
name: token::SELF_KEYWORD_NAME,
@@ -2082,8 +2081,7 @@ impl<'a> Parser<'a> {
20822081
return Ok(self.mk_expr(lo, hi, ExprPath(Some(qself), path)));
20832082
}
20842083
if try!(self.eat_keyword(keywords::Move) ){
2085-
let lo = self.last_span.lo;
2086-
return self.parse_lambda_expr(lo, CaptureByValue);
2084+
return self.parse_lambda_expr(CaptureByValue);
20872085
}
20882086
if try!(self.eat_keyword(keywords::If)) {
20892087
return self.parse_if_expr();
@@ -2842,9 +2840,10 @@ impl<'a> Parser<'a> {
28422840
}
28432841

28442842
// `|args| expr`
2845-
pub fn parse_lambda_expr(&mut self, lo: BytePos, capture_clause: CaptureClause)
2843+
pub fn parse_lambda_expr(&mut self, capture_clause: CaptureClause)
28462844
-> PResult<P<Expr>>
28472845
{
2846+
let lo = self.span.lo;
28482847
let decl = try!(self.parse_fn_block_decl());
28492848
let body = match decl.output {
28502849
DefaultReturn(_) => {

branches/snap-stage3/src/test/compile-fail/move-closure-span.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)