Skip to content

Commit a573d14

Browse files
Remove unused boxes vector
1 parent 4483980 commit a573d14

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/librustc/hir/print.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ pub struct State<'a> {
7474
cm: Option<&'a SourceMap>,
7575
comments: Option<Vec<comments::Comment>>,
7676
cur_cmnt: usize,
77-
boxes: Vec<pp::Breaks>,
7877
ann: &'a (dyn PpAnn + 'a),
7978
}
8079

@@ -83,10 +82,6 @@ impl<'a> PrintState<'a> for State<'a> {
8382
&mut self.s
8483
}
8584

86-
fn boxes(&mut self) -> &mut Vec<pp::Breaks> {
87-
&mut self.boxes
88-
}
89-
9085
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> {
9186
&mut self.comments
9287
}
@@ -141,7 +136,6 @@ impl<'a> State<'a> {
141136
cm: Some(cm),
142137
comments,
143138
cur_cmnt: 0,
144-
boxes: Vec::new(),
145139
ann,
146140
}
147141
}
@@ -157,7 +151,6 @@ pub fn to_string<F>(ann: &dyn PpAnn, f: F) -> String
157151
cm: None,
158152
comments: None,
159153
cur_cmnt: 0,
160-
boxes: Vec::new(),
161154
ann,
162155
};
163156
f(&mut printer);
@@ -175,7 +168,6 @@ pub fn visibility_qualified<S: Into<Cow<'static, str>>>(vis: &hir::Visibility, w
175168

176169
impl<'a> State<'a> {
177170
pub fn cbox(&mut self, u: usize) {
178-
self.boxes.push(pp::Breaks::Consistent);
179171
self.s.cbox(u);
180172
}
181173

@@ -226,13 +218,6 @@ impl<'a> State<'a> {
226218
self.bclose_(span, indent_unit)
227219
}
228220

229-
pub fn in_cbox(&self) -> bool {
230-
match self.boxes.last() {
231-
Some(&last_box) => last_box == pp::Breaks::Consistent,
232-
None => false,
233-
}
234-
}
235-
236221
pub fn space_if_not_bol(&mut self) {
237222
if !self.is_bol() {
238223
self.s.space();

src/libsyntax/print/pprust.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub struct State<'a> {
4848
cm: Option<&'a SourceMap>,
4949
comments: Option<Vec<comments::Comment>>,
5050
cur_cmnt: usize,
51-
boxes: Vec<pp::Breaks>,
5251
ann: &'a (dyn PpAnn+'a),
5352
is_expanded: bool
5453
}
@@ -113,7 +112,6 @@ impl<'a> State<'a> {
113112
cm: Some(cm),
114113
comments,
115114
cur_cmnt: 0,
116-
boxes: Vec::new(),
117115
ann,
118116
is_expanded,
119117
}
@@ -130,7 +128,6 @@ pub fn to_string<F>(f: F) -> String where
130128
cm: None,
131129
comments: None,
132130
cur_cmnt: 0,
133-
boxes: Vec::new(),
134131
ann: &NoAnn,
135132
is_expanded: false
136133
};
@@ -426,7 +423,6 @@ fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
426423

427424
pub trait PrintState<'a> {
428425
fn writer(&mut self) -> &mut pp::Printer<'a>;
429-
fn boxes(&mut self) -> &mut Vec<pp::Breaks>;
430426
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>>;
431427
fn cur_cmnt(&mut self) -> &mut usize;
432428

@@ -466,17 +462,14 @@ pub trait PrintState<'a> {
466462

467463
// "raw box"
468464
fn rbox(&mut self, u: usize, b: pp::Breaks) {
469-
self.boxes().push(b);
470465
self.writer().rbox(u, b)
471466
}
472467

473468
fn ibox(&mut self, u: usize) {
474-
self.boxes().push(pp::Breaks::Inconsistent);
475469
self.writer().ibox(u);
476470
}
477471

478472
fn end(&mut self) {
479-
self.boxes().pop().unwrap();
480473
self.writer().end()
481474
}
482475

@@ -763,10 +756,6 @@ impl<'a> PrintState<'a> for State<'a> {
763756
&mut self.s
764757
}
765758

766-
fn boxes(&mut self) -> &mut Vec<pp::Breaks> {
767-
&mut self.boxes
768-
}
769-
770759
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> {
771760
&mut self.comments
772761
}
@@ -778,7 +767,6 @@ impl<'a> PrintState<'a> for State<'a> {
778767

779768
impl<'a> State<'a> {
780769
pub fn cbox(&mut self, u: usize) {
781-
self.boxes.push(pp::Breaks::Consistent);
782770
self.s.cbox(u);
783771
}
784772

0 commit comments

Comments
 (0)