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:
Guillaume Gomez 2020-10-20 21:46:42 +02:00 committed by GitHub
commit 0c2dbb2a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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) }
})

View File

@ -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> {