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.
This commit is contained in:
commit
0c2dbb2a18
@ -390,7 +390,7 @@ impl Printer {
|
||||
self.scan_stack.pop_front().unwrap()
|
||||
}
|
||||
|
||||
fn scan_top(&mut self) -> usize {
|
||||
fn scan_top(&self) -> usize {
|
||||
*self.scan_stack.front().unwrap()
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ impl Printer {
|
||||
self.pending_indentation += amount;
|
||||
}
|
||||
|
||||
fn get_top(&mut self) -> PrintStackElem {
|
||||
fn get_top(&self) -> PrintStackElem {
|
||||
*self.print_stack.last().unwrap_or({
|
||||
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
|
||||
})
|
||||
|
@ -63,7 +63,7 @@ impl<'a> Comments<'a> {
|
||||
}
|
||||
|
||||
pub fn trailing_comment(
|
||||
&mut self,
|
||||
&self,
|
||||
span: rustc_span::Span,
|
||||
next_pos: Option<BytePos>,
|
||||
) -> Option<Comment> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user