Implement mut ref
/mut ref mut
This commit is contained in:
parent
10a7aa14fe
commit
e0da13f25f
51 changed files with 442 additions and 378 deletions
|
@ -1721,12 +1721,15 @@ impl<'a> State<'a> {
|
|||
PatKind::Wild => self.word("_"),
|
||||
PatKind::Never => self.word("!"),
|
||||
PatKind::Binding(BindingAnnotation(by_ref, mutbl), _, ident, sub) => {
|
||||
if by_ref == ByRef::Yes {
|
||||
self.word_nbsp("ref");
|
||||
}
|
||||
if mutbl.is_mut() {
|
||||
self.word_nbsp("mut");
|
||||
}
|
||||
if let ByRef::Yes(rmutbl) = by_ref {
|
||||
self.word_nbsp("ref");
|
||||
if rmutbl.is_mut() {
|
||||
self.word_nbsp("mut");
|
||||
}
|
||||
}
|
||||
self.print_ident(ident);
|
||||
if let Some(p) = sub {
|
||||
self.word("@");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue