diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 827bbea7bd2a..137f20d6c32b 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -74,7 +74,6 @@ pub struct State<'a> { cm: Option<&'a SourceMap>, comments: Option>, cur_cmnt: usize, - boxes: Vec, ann: &'a (dyn PpAnn + 'a), } @@ -83,10 +82,6 @@ impl<'a> PrintState<'a> for State<'a> { &mut self.s } - fn boxes(&mut self) -> &mut Vec { - &mut self.boxes - } - fn comments(&mut self) -> &mut Option> { &mut self.comments } @@ -141,7 +136,6 @@ impl<'a> State<'a> { cm: Some(cm), comments, cur_cmnt: 0, - boxes: Vec::new(), ann, } } @@ -157,7 +151,6 @@ pub fn to_string(ann: &dyn PpAnn, f: F) -> String cm: None, comments: None, cur_cmnt: 0, - boxes: Vec::new(), ann, }; f(&mut printer); @@ -175,7 +168,6 @@ pub fn visibility_qualified>>(vis: &hir::Visibility, w impl<'a> State<'a> { pub fn cbox(&mut self, u: usize) { - self.boxes.push(pp::Breaks::Consistent); self.s.cbox(u); } @@ -226,13 +218,6 @@ impl<'a> State<'a> { self.bclose_(span, indent_unit) } - pub fn in_cbox(&self) -> bool { - match self.boxes.last() { - Some(&last_box) => last_box == pp::Breaks::Consistent, - None => false, - } - } - pub fn space_if_not_bol(&mut self) { if !self.is_bol() { self.s.space(); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 1d28b52362c1..4c86300b8056 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -48,7 +48,6 @@ pub struct State<'a> { cm: Option<&'a SourceMap>, comments: Option>, cur_cmnt: usize, - boxes: Vec, ann: &'a (dyn PpAnn+'a), is_expanded: bool } @@ -113,7 +112,6 @@ impl<'a> State<'a> { cm: Some(cm), comments, cur_cmnt: 0, - boxes: Vec::new(), ann, is_expanded, } @@ -130,7 +128,6 @@ pub fn to_string(f: F) -> String where cm: None, comments: None, cur_cmnt: 0, - boxes: Vec::new(), ann: &NoAnn, is_expanded: false }; @@ -426,7 +423,6 @@ fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String { pub trait PrintState<'a> { fn writer(&mut self) -> &mut pp::Printer<'a>; - fn boxes(&mut self) -> &mut Vec; fn comments(&mut self) -> &mut Option>; fn cur_cmnt(&mut self) -> &mut usize; @@ -466,17 +462,14 @@ pub trait PrintState<'a> { // "raw box" fn rbox(&mut self, u: usize, b: pp::Breaks) { - self.boxes().push(b); self.writer().rbox(u, b) } fn ibox(&mut self, u: usize) { - self.boxes().push(pp::Breaks::Inconsistent); self.writer().ibox(u); } fn end(&mut self) { - self.boxes().pop().unwrap(); self.writer().end() } @@ -763,10 +756,6 @@ impl<'a> PrintState<'a> for State<'a> { &mut self.s } - fn boxes(&mut self) -> &mut Vec { - &mut self.boxes - } - fn comments(&mut self) -> &mut Option> { &mut self.comments } @@ -778,7 +767,6 @@ impl<'a> PrintState<'a> for State<'a> { impl<'a> State<'a> { pub fn cbox(&mut self, u: usize) { - self.boxes.push(pp::Breaks::Consistent); self.s.cbox(u); }