about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-05 15:22:48 +0000
committerbors <bors@rust-lang.org>2015-02-05 15:22:48 +0000
commit2c05354211b04a52cc66a0b8ad8b2225eaf9e972 (patch)
treed9e86702774074efe4d9f44aba0fad8355e1655e /src/libsyntax/parse
parent2bd8ec2d197809fc0f0efccf1de14419ffb17b2b (diff)
parent92f11e938a80a719badcd2168a2e38a2a800fcb6 (diff)
Auto merge of #21843 - japaric:kindless, r=alexcrichton
This needs a snapshot that includes #21805 before it can be merged.

There are some places where type inference regressed after I removed the annotations (see `FIXME`s). cc @nikomatsakis.

r? @eddyb or anyone
(I'll remove the `FIXME`s before merging, as they are only intended to point out regressions)
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/mod.rs10
-rw-r--r--src/libsyntax/parse/parser.rs8
2 files changed, 8 insertions, 10 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index eecd7d87185..6ea2ffa507d 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -244,7 +244,7 @@ pub fn new_parser_from_tts<'a>(sess: &'a ParseSess,
 /// add the path to the session's codemap and return the new filemap.
 pub fn file_to_filemap(sess: &ParseSess, path: &Path, spanopt: Option<Span>)
     -> Rc<FileMap> {
-    let err = |&: msg: &str| {
+    let err = |msg: &str| {
         match spanopt {
             Some(sp) => sess.span_diagnostic.span_fatal(sp, msg),
             None => sess.span_diagnostic.handler().fatal(msg),
@@ -406,7 +406,7 @@ pub fn char_lit(lit: &str) -> (char, isize) {
         .map(|x| (x, len as isize))
     }
 
-    let unicode_escape = |&: | -> Option<(char, isize)>
+    let unicode_escape = || -> Option<(char, isize)>
         if lit.as_bytes()[2] == b'{' {
             let idx = lit.find('}').expect(msg2);
             let subslice = &lit[3..idx];
@@ -433,7 +433,7 @@ pub fn str_lit(lit: &str) -> String {
     let mut res = String::with_capacity(lit.len());
 
     // FIXME #8372: This could be a for-loop if it didn't borrow the iterator
-    let error = |&: i| format!("lexer should have rejected {} at {}", lit, i);
+    let error = |i| format!("lexer should have rejected {} at {}", lit, i);
 
     /// Eat everything up to a non-whitespace
     fn eat<'a>(it: &mut iter::Peekable<str::CharIndices<'a>>) {
@@ -568,7 +568,7 @@ pub fn float_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) -> a
 
 /// Parse a string representing a byte literal into its final form. Similar to `char_lit`
 pub fn byte_lit(lit: &str) -> (u8, usize) {
-    let err = |&: i| format!("lexer accepted invalid byte literal {} step {}", lit, i);
+    let err = |i| format!("lexer accepted invalid byte literal {} step {}", lit, i);
 
     if lit.len() == 1 {
         (lit.as_bytes()[0], 1)
@@ -602,7 +602,7 @@ pub fn binary_lit(lit: &str) -> Rc<Vec<u8>> {
     let mut res = Vec::with_capacity(lit.len());
 
     // FIXME #8372: This could be a for-loop if it didn't borrow the iterator
-    let error = |&: i| format!("lexer should have rejected {} at {}", lit, i);
+    let error = |i| format!("lexer should have rejected {} at {}", lit, i);
 
     /// Eat everything up to a non-whitespace
     fn eat<'a, I: Iterator<Item=(usize, u8)>>(it: &mut iter::Peekable<I>) {
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 2cb265033c3..26433d06482 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1139,7 +1139,7 @@ impl<'a> Parser<'a> {
 
     /// Parses an obsolete closure kind (`&:`, `&mut:`, or `:`).
     pub fn parse_obsolete_closure_kind(&mut self) {
-        // let lo = self.span.lo;
+         let lo = self.span.lo;
         if
             self.check(&token::BinOp(token::And)) &&
             self.look_ahead(1, |t| t.is_keyword(keywords::Mut)) &&
@@ -1163,10 +1163,8 @@ impl<'a> Parser<'a> {
             return;
         }
 
-        // SNAP 474b324
-        // Enable these obsolete errors after snapshot:
-        // let span = mk_sp(lo, self.span.hi);
-        // self.obsolete(span, ObsoleteSyntax::ClosureKind);
+         let span = mk_sp(lo, self.span.hi);
+         self.obsolete(span, ObsoleteSyntax::ClosureKind);
     }
 
     pub fn parse_ty_bare_fn_or_ty_closure(&mut self, lifetime_defs: Vec<LifetimeDef>) -> Ty_ {