Skip to content

Commit 5c29e68

Browse files
committed
---
yaml --- r: 208587 b: refs/heads/snap-stage3 c: fa28642 h: refs/heads/master i: 208585: 42a5da5 208583: 960656d v: v3
1 parent ac93c26 commit 5c29e68

19 files changed

+109
-217
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: 63b000b1b81ecc197112a60d9b79901cffa4e0bb
4+
refs/heads/snap-stage3: fa28642de9fc158613f294896e62e12c3067714e
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

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.2.0
16+
CFG_RELEASE_NUM=1.1.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/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ feature.
7979
A nice replacement is the [lazy constructor macro][lcm] by [Marvin
8080
Löbel][kim].
8181

82-
[fqa]: http://yosefk.com/c++fqa/ctors.html#fqa-10.12
82+
[fqa]: https://mail.mozilla.org/pipermail/rust-dev/2013-April/003815.html
8383
[elp]: http://ericlippert.com/2013/02/06/static-constructors-part-one/
8484
[lcm]: https://gist.github.com/Kimundi/8782487
8585
[kim]: https://github.com/Kimundi

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/method-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn main() {
156156

157157
This ‘associated function’ builds a new `Circle` for us. Note that associated
158158
functions are called with the `Struct::function()` syntax, rather than the
159-
`ref.method()` syntax. Some other languages call associated functions ‘static
159+
`ref.method()` syntax. Some other langauges call associated functions ‘static
160160
methods’.
161161

162162
# Builder Pattern

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/liballoc/rc.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,18 @@ impl<T: Default> Default for Rc<T> {
634634
}
635635

636636
#[stable(feature = "rust1", since = "1.0.0")]
637+
#[cfg(stage0)]
637638
impl<T: PartialEq> PartialEq for Rc<T> {
639+
#[inline(always)]
640+
fn eq(&self, other: &Rc<T>) -> bool { **self == **other }
641+
642+
#[inline(always)]
643+
fn ne(&self, other: &Rc<T>) -> bool { **self != **other }
644+
}
645+
646+
#[stable(feature = "rust1", since = "1.0.0")]
647+
#[cfg(not(stage0))]
648+
impl<T: ?Sized + PartialEq> PartialEq for Rc<T> {
638649
/// Equality for two `Rc<T>`s.
639650
///
640651
/// Two `Rc<T>`s are equal if their inner value are equal.
@@ -669,10 +680,35 @@ impl<T: PartialEq> PartialEq for Rc<T> {
669680
}
670681

671682
#[stable(feature = "rust1", since = "1.0.0")]
683+
#[cfg(stage0)]
672684
impl<T: Eq> Eq for Rc<T> {}
685+
#[stable(feature = "rust1", since = "1.0.0")]
686+
#[cfg(not(stage0))]
687+
impl<T: ?Sized + Eq> Eq for Rc<T> {}
673688

674689
#[stable(feature = "rust1", since = "1.0.0")]
690+
#[cfg(stage0)]
675691
impl<T: PartialOrd> PartialOrd for Rc<T> {
692+
#[inline(always)]
693+
fn partial_cmp(&self, other: &Rc<T>) -> Option<Ordering> {
694+
(**self).partial_cmp(&**other)
695+
}
696+
697+
#[inline(always)]
698+
fn lt(&self, other: &Rc<T>) -> bool { **self < **other }
699+
700+
#[inline(always)]
701+
fn le(&self, other: &Rc<T>) -> bool { **self <= **other }
702+
703+
#[inline(always)]
704+
fn gt(&self, other: &Rc<T>) -> bool { **self > **other }
705+
706+
#[inline(always)]
707+
fn ge(&self, other: &Rc<T>) -> bool { **self >= **other }
708+
}
709+
#[stable(feature = "rust1", since = "1.0.0")]
710+
#[cfg(not(stage0))]
711+
impl<T: ?Sized + PartialOrd> PartialOrd for Rc<T> {
676712
/// Partial comparison for two `Rc<T>`s.
677713
///
678714
/// The two are compared by calling `partial_cmp()` on their inner values.
@@ -757,7 +793,14 @@ impl<T: PartialOrd> PartialOrd for Rc<T> {
757793
}
758794

759795
#[stable(feature = "rust1", since = "1.0.0")]
796+
#[cfg(stage0)]
760797
impl<T: Ord> Ord for Rc<T> {
798+
#[inline]
799+
fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
800+
}
801+
#[stable(feature = "rust1", since = "1.0.0")]
802+
#[cfg(not(stage0))]
803+
impl<T: ?Sized + Ord> Ord for Rc<T> {
761804
/// Comparison for two `Rc<T>`s.
762805
///
763806
/// The two are compared by calling `cmp()` on their inner values.
@@ -1399,4 +1442,9 @@ mod tests {
13991442
assert_eq!(format!("{:?}", foo), "75");
14001443
}
14011444

1445+
#[test]
1446+
fn test_unsized() {
1447+
let foo: Rc<[i32]> = Rc::new([1, 2, 3]);
1448+
assert_eq!(foo, foo.clone());
1449+
}
14021450
}

branches/snap-stage3/src/libcollections/borrow.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ impl<'a, T: ?Sized> BorrowMut<T> for &'a mut T {
116116
fn borrow_mut(&mut self) -> &mut T { &mut **self }
117117
}
118118

119+
#[cfg(stage0)]
119120
impl<T> Borrow<T> for rc::Rc<T> {
120121
fn borrow(&self) -> &T { &**self }
121122
}
122123

124+
#[cfg(not(stage0))]
125+
impl<T: ?Sized> Borrow<T> for rc::Rc<T> {
126+
fn borrow(&self) -> &T { &**self }
127+
}
128+
123129
impl<T> Borrow<T> for arc::Arc<T> {
124130
fn borrow(&self) -> &T { &**self }
125131
}

branches/snap-stage3/src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
//! [`FromStr`](str/trait.FromStr.html) trait.
6161
//!
6262
//! Data may be shared by placing it in a reference-counted box or the
63-
//! [`Rc`](rc/index.html) type, and if further contained in a [`Cell`
63+
//! [`Rc`][rc/index.html] type, and if further contained in a [`Cell`
6464
//! or `RefCell`](cell/index.html), may be mutated as well as shared.
6565
//! Likewise, in a concurrent setting it is common to pair an
6666
//! atomically-reference-counted box, [`Arc`](sync/struct.Arc.html),

branches/snap-stage3/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 34 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -325,55 +325,42 @@ fn check_matcher<'a, I>(cx: &mut ExtCtxt, matcher: I, follow: &Token)
325325
last = match *token {
326326
TtToken(sp, MatchNt(ref name, ref frag_spec, _, _)) => {
327327
// ii. If T is a simple NT, look ahead to the next token T' in
328-
// M. If T' is in the set FOLLOW(NT), continue. Else; reject.
329-
if can_be_followed_by_any(frag_spec.as_str()) {
330-
continue
331-
} else {
332-
let next_token = match tokens.peek() {
333-
// If T' closes a complex NT, replace T' with F
334-
Some(&&TtToken(_, CloseDelim(_))) => follow.clone(),
335-
Some(&&TtToken(_, ref tok)) => tok.clone(),
336-
Some(&&TtSequence(sp, _)) => {
337-
// Be conservative around sequences: to be
338-
// more specific, we would need to
339-
// consider FIRST sets, but also the
340-
// possibility that the sequence occurred
341-
// zero times (in which case we need to
342-
// look at the token that follows the
343-
// sequence, which may itself a sequence,
344-
// and so on).
345-
cx.span_err(sp,
346-
&format!("`${0}:{1}` is followed by a \
347-
sequence repetition, which is not \
348-
allowed for `{1}` fragments",
349-
name.as_str(), frag_spec.as_str())
328+
// M.
329+
let next_token = match tokens.peek() {
330+
// If T' closes a complex NT, replace T' with F
331+
Some(&&TtToken(_, CloseDelim(_))) => follow.clone(),
332+
Some(&&TtToken(_, ref tok)) => tok.clone(),
333+
Some(&&TtSequence(sp, _)) => {
334+
cx.span_err(sp,
335+
&format!("`${0}:{1}` is followed by a \
336+
sequence repetition, which is not \
337+
allowed for `{1}` fragments",
338+
name.as_str(), frag_spec.as_str())
350339
);
351-
Eof
352-
},
353-
// die next iteration
354-
Some(&&TtDelimited(_, ref delim)) => delim.close_token(),
355-
// else, we're at the end of the macro or sequence
356-
None => follow.clone()
357-
};
358-
359-
let tok = if let TtToken(_, ref tok) = *token { tok } else { unreachable!() };
360-
361-
// If T' is in the set FOLLOW(NT), continue. Else, reject.
362-
match (&next_token, is_in_follow(cx, &next_token, frag_spec.as_str())) {
363-
(_, Err(msg)) => {
364-
cx.span_err(sp, &msg);
365-
continue
366-
}
367-
(&Eof, _) => return Some((sp, tok.clone())),
368-
(_, Ok(true)) => continue,
369-
(next, Ok(false)) => {
370-
cx.span_err(sp, &format!("`${0}:{1}` is followed by `{2}`, which \
371-
is not allowed for `{1}` fragments",
372-
name.as_str(), frag_spec.as_str(),
373-
token_to_string(next)));
374-
continue
375-
},
340+
Eof
341+
},
342+
// die next iteration
343+
Some(&&TtDelimited(_, ref delim)) => delim.close_token(),
344+
// else, we're at the end of the macro or sequence
345+
None => follow.clone()
346+
};
347+
348+
let tok = if let TtToken(_, ref tok) = *token { tok } else { unreachable!() };
349+
// If T' is in the set FOLLOW(NT), continue. Else, reject.
350+
match (&next_token, is_in_follow(cx, &next_token, frag_spec.as_str())) {
351+
(_, Err(msg)) => {
352+
cx.span_err(sp, &msg);
353+
continue
376354
}
355+
(&Eof, _) => return Some((sp, tok.clone())),
356+
(_, Ok(true)) => continue,
357+
(next, Ok(false)) => {
358+
cx.span_err(sp, &format!("`${0}:{1}` is followed by `{2}`, which \
359+
is not allowed for `{1}` fragments",
360+
name.as_str(), frag_spec.as_str(),
361+
token_to_string(next)));
362+
continue
363+
},
377364
}
378365
},
379366
TtSequence(sp, ref seq) => {
@@ -440,39 +427,8 @@ fn check_matcher<'a, I>(cx: &mut ExtCtxt, matcher: I, follow: &Token)
440427
last
441428
}
442429

443-
/// True if a fragment of type `frag` can be followed by any sort of
444-
/// token. We use this (among other things) as a useful approximation
445-
/// for when `frag` can be followed by a repetition like `$(...)*` or
446-
/// `$(...)+`. In general, these can be a bit tricky to reason about,
447-
/// so we adopt a conservative position that says that any fragment
448-
/// specifier which consumes at most one token tree can be followed by
449-
/// a fragment specifier (indeed, these fragments can be followed by
450-
/// ANYTHING without fear of future compatibility hazards).
451-
fn can_be_followed_by_any(frag: &str) -> bool {
452-
match frag {
453-
"item" | // always terminated by `}` or `;`
454-
"block" | // exactly one token tree
455-
"ident" | // exactly one token tree
456-
"meta" | // exactly one token tree
457-
"tt" => // exactly one token tree
458-
true,
459-
460-
_ =>
461-
false,
462-
}
463-
}
464-
465-
/// True if `frag` can legally be followed by the token `tok`. For
466-
/// fragments that can consume an unbounded numbe of tokens, `tok`
467-
/// must be within a well-defined follow set. This is intended to
468-
/// guarantee future compatibility: for example, without this rule, if
469-
/// we expanded `expr` to include a new binary operator, we might
470-
/// break macros that were relying on that binary operator as a
471-
/// separator.
472430
fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
473431
if let &CloseDelim(_) = tok {
474-
// closing a token tree can never be matched by any fragment;
475-
// iow, we always require that `(` and `)` match, etc.
476432
Ok(true)
477433
} else {
478434
match frag {

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

Lines changed: 9 additions & 6 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(_) => {
@@ -5267,7 +5266,11 @@ impl<'a> Parser<'a> {
52675266
return Ok(Some(try!(self.parse_item_foreign_mod(lo, opt_abi, visibility, attrs))));
52685267
}
52695268

5270-
try!(self.expect_one_of(&[], &[]));
5269+
let span = self.span;
5270+
let token_str = self.this_token_to_string();
5271+
return Err(self.span_fatal(span,
5272+
&format!("expected `{}` or `fn`, found `{}`", "{",
5273+
token_str)))
52715274
}
52725275

52735276
if try!(self.eat_keyword_noexpect(keywords::Virtual) ){

branches/snap-stage3/src/test/compile-fail/macro-followed-by-seq-bad.rs

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

branches/snap-stage3/src/test/compile-fail/macro-seq-followed-by-seq.rs

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

0 commit comments

Comments
 (0)