diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-07-05 16:14:47 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-07-10 07:12:28 -0400 |
| commit | a573d143a2b7ef9d04a8fe6904667762e47157bc (patch) | |
| tree | 68744454d57ec33a961a12bbe5d4e782eb82521b | |
| parent | 44839802853954ca0eea629bb9d94068966f2960 (diff) | |
| download | rust-a573d143a2b7ef9d04a8fe6904667762e47157bc.tar.gz rust-a573d143a2b7ef9d04a8fe6904667762e47157bc.zip | |
Remove unused boxes vector
| -rw-r--r-- | src/librustc/hir/print.rs | 15 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 12 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 827bbea7bd2..137f20d6c32 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<Vec<comments::Comment>>, cur_cmnt: usize, - boxes: Vec<pp::Breaks>, 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<pp::Breaks> { - &mut self.boxes - } - fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> { &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<F>(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<S: Into<Cow<'static, str>>>(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 1d28b52362c..4c86300b805 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<Vec<comments::Comment>>, cur_cmnt: usize, - boxes: Vec<pp::Breaks>, 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: 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<pp::Breaks>; fn comments(&mut self) -> &mut Option<Vec<comments::Comment>>; 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<pp::Breaks> { - &mut self.boxes - } - fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> { &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); } |
