From f7d86b2f4ace416a65e84603082c756b8b5dc43e Mon Sep 17 00:00:00 2001 From: Jakub Wieczorek Date: Fri, 6 Jun 2014 15:51:42 +0200 Subject: Remove the dead code identified by the new lint --- src/libsyntax/ext/build.rs | 15 +++------------ src/libsyntax/print/pprust.rs | 5 ----- 2 files changed, 3 insertions(+), 17 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 7b25f4db980..14769e3e510 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -21,11 +21,6 @@ use parse::token::special_idents; use parse::token::InternedString; use parse::token; -pub struct Field { - ident: ast::Ident, - ex: @ast::Expr -} - // Transitional reexports so qquote can find the paths it is looking for mod syntax { pub use ext; @@ -1000,9 +995,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { } } -struct Duplicator<'a> { - cx: &'a ExtCtxt<'a>, -} +struct Duplicator<'a>; impl<'a> Folder for Duplicator<'a> { fn new_id(&mut self, _: NodeId) -> NodeId { @@ -1021,10 +1014,8 @@ pub trait Duplicate { } impl Duplicate for @ast::Expr { - fn duplicate(&self, cx: &ExtCtxt) -> @ast::Expr { - let mut folder = Duplicator { - cx: cx, - }; + fn duplicate(&self, _: &ExtCtxt) -> @ast::Expr { + let mut folder = Duplicator; folder.fold_expr(*self) } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 05c2558da48..a4518617d3d 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -19,7 +19,6 @@ use codemap::{CodeMap, BytePos}; use codemap; use diagnostic; use parse::classify::expr_is_simple_block; -use parse::token::IdentInterner; use parse::token; use parse::lexer::comments; use parse; @@ -30,7 +29,6 @@ use print::pp; use std::io::{IoResult, MemWriter}; use std::io; use std::mem; -use std::rc::Rc; use std::str; use std::string::String; @@ -58,7 +56,6 @@ pub struct CurrentCommentAndLiteral { pub struct State<'a> { pub s: pp::Printer, cm: Option<&'a CodeMap>, - intr: Rc, comments: Option >, literals: Option >, cur_cmnt_and_lit: CurrentCommentAndLiteral, @@ -76,7 +73,6 @@ pub fn rust_printer_annotated<'a>(writer: Box, State { s: pp::mk_printer(writer, default_columns), cm: None, - intr: token::get_ident_interner(), comments: None, literals: None, cur_cmnt_and_lit: CurrentCommentAndLiteral { @@ -111,7 +107,6 @@ pub fn print_crate<'a>(cm: &'a CodeMap, let mut s = State { s: pp::mk_printer(out, default_columns), cm: Some(cm), - intr: token::get_ident_interner(), comments: Some(cmnts), // If the code is post expansion, don't use the table of // literals, since it doesn't correspond with the literals -- cgit 1.4.1-3-g733a5