about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-16 04:00:24 +0000
committerbors <bors@rust-lang.org>2017-08-16 04:00:24 +0000
commit6f4ab9458a7ad06c8ce630604f533c8c0c0acef4 (patch)
tree8b1076cf97b6482b624b3655e078a4530a460cb3 /src/libsyntax/parse/lexer
parente40dc66f47614eb2d1c8026d112a27b6f8b291d0 (diff)
parent1b6c9605e41b7c7dc23e0e6f633f05912d0463dd (diff)
Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
use field init shorthand EVERYWHERE

Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_.

r? @Mark-Simulacrum
Diffstat (limited to 'src/libsyntax/parse/lexer')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs6
-rw-r--r--src/libsyntax/parse/lexer/mod.rs10
-rw-r--r--src/libsyntax/parse/lexer/tokentrees.rs2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index 8b545d3b909..f65fffebe33 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -192,7 +192,7 @@ fn read_line_comments(rdr: &mut StringReader,
     if !lines.is_empty() {
         comments.push(Comment {
             style: if code_to_the_left { Trailing } else { Isolated },
-            lines: lines,
+            lines,
             pos: p,
         });
     }
@@ -306,8 +306,8 @@ fn read_block_comment(rdr: &mut StringReader,
     }
     debug!("<<< block comment");
     comments.push(Comment {
-        style: style,
-        lines: lines,
+        style,
+        lines,
         pos: p,
     });
 }
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 09cdf26bf1f..527d2e41396 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -160,18 +160,18 @@ impl<'a> StringReader<'a> {
         let source_text = (*filemap.src.as_ref().unwrap()).clone();
 
         StringReader {
-            sess: sess,
+            sess,
             next_pos: filemap.start_pos,
             pos: filemap.start_pos,
             col: CharPos(0),
             ch: Some('\n'),
-            filemap: filemap,
+            filemap,
             terminator: None,
             save_new_lines_and_multibyte: true,
             // dummy values; not read
             peek_tok: token::Eof,
             peek_span: syntax_pos::DUMMY_SP,
-            source_text: source_text,
+            source_text,
             fatal_errs: Vec::new(),
             token: token::Eof,
             span: syntax_pos::DUMMY_SP,
@@ -546,7 +546,7 @@ impl<'a> StringReader<'a> {
                             };
 
                             Some(TokenAndSpan {
-                                tok: tok,
+                                tok,
                                 sp: self.mk_sp(start_bpos, self.pos),
                             })
                         })
@@ -675,7 +675,7 @@ impl<'a> StringReader<'a> {
             };
 
             Some(TokenAndSpan {
-                tok: tok,
+                tok,
                 sp: self.mk_sp(start_bpos, self.pos),
             })
         })
diff --git a/src/libsyntax/parse/lexer/tokentrees.rs b/src/libsyntax/parse/lexer/tokentrees.rs
index 63a396c14db..ad389ab510a 100644
--- a/src/libsyntax/parse/lexer/tokentrees.rs
+++ b/src/libsyntax/parse/lexer/tokentrees.rs
@@ -114,7 +114,7 @@ impl<'a> StringReader<'a> {
                 }
 
                 Ok(TokenTree::Delimited(span, Delimited {
-                    delim: delim,
+                    delim,
                     tts: tts.into(),
                 }))
             },