Skip to content

Commit 0c2dbb2

Browse files
Rollup merge of #78145 - LingMan:ast_pretty_mut, r=jonas-schievink
Drop unneeded `mut` These parameters don't get modified. Note that `trailing_comment` is pub and gets exported from `rustc_ast_pretty`. Is that considered to be a stable API? If yes, and you want to reserve the right to modify `self` in `trailing_comment` in the future, that hunk would need to be dropped.
2 parents ad218f9 + 13f0f49 commit 0c2dbb2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_ast_pretty/src/pp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ impl Printer {
390390
self.scan_stack.pop_front().unwrap()
391391
}
392392

393-
fn scan_top(&mut self) -> usize {
393+
fn scan_top(&self) -> usize {
394394
*self.scan_stack.front().unwrap()
395395
}
396396

@@ -484,7 +484,7 @@ impl Printer {
484484
self.pending_indentation += amount;
485485
}
486486

487-
fn get_top(&mut self) -> PrintStackElem {
487+
fn get_top(&self) -> PrintStackElem {
488488
*self.print_stack.last().unwrap_or({
489489
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
490490
})

compiler/rustc_ast_pretty/src/pprust/state.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a> Comments<'a> {
6363
}
6464

6565
pub fn trailing_comment(
66-
&mut self,
66+
&self,
6767
span: rustc_span::Span,
6868
next_pos: Option<BytePos>,
6969
) -> Option<Comment> {

0 commit comments

Comments
 (0)