pprust: p1@p2 -> p1 @ p2

This commit is contained in:
Mazdak Farrokhzad 2019-10-14 18:12:04 +02:00
parent 3a9f8deb1d
commit 16266a5405
3 changed files with 6 additions and 5 deletions

View File

@ -2381,7 +2381,8 @@ impl<'a> State<'a> {
}
self.print_ident(ident);
if let Some(ref p) = *sub {
self.s.word("@");
self.s.space();
self.s.word_space("@");
self.print_pat(p);
}
}

View File

@ -15,7 +15,7 @@ fn main() {
//~| pattern on the left, should be on the right
//~| binding on the right, should be on the left
//~| HELP switch the order
//~| SUGGESTION y@Some(x)
//~| SUGGESTION y @ Some(x)
_ => {}
}
@ -34,7 +34,7 @@ fn main() {
//~| pattern on the left, should be on the right
//~| binding on the right, should be on the left
//~| HELP switch the order
//~| SUGGESTION e@1 ..=5
//~| SUGGESTION e @ 1 ..=5
_ => {}
}
}

View File

@ -6,7 +6,7 @@ LL | Some(x) @ y => {}
| | |
| | binding on the right, should be on the left
| pattern on the left, should be on the right
| help: switch the order: `y@Some(x)`
| help: switch the order: `y @ Some(x)`
error: left-hand side of `@` must be a binding
--> $DIR/intersection-patterns.rs:23:9
@ -27,7 +27,7 @@ LL | 1 ..= 5 @ e => {}
| | |
| | binding on the right, should be on the left
| pattern on the left, should be on the right
| help: switch the order: `e@1 ..=5`
| help: switch the order: `e @ 1 ..=5`
error: aborting due to 3 previous errors