Skip to content

Commit 16266a5

Browse files
committed
pprust: p1@p2 -> p1 @ p2
1 parent 3a9f8de commit 16266a5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/libsyntax/print/pprust.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,8 @@ impl<'a> State<'a> {
23812381
}
23822382
self.print_ident(ident);
23832383
if let Some(ref p) = *sub {
2384-
self.s.word("@");
2384+
self.s.space();
2385+
self.s.word_space("@");
23852386
self.print_pat(p);
23862387
}
23872388
}

src/test/ui/parser/intersection-patterns.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
//~| pattern on the left, should be on the right
1616
//~| binding on the right, should be on the left
1717
//~| HELP switch the order
18-
//~| SUGGESTION y@Some(x)
18+
//~| SUGGESTION y @ Some(x)
1919
_ => {}
2020
}
2121

@@ -34,7 +34,7 @@ fn main() {
3434
//~| pattern on the left, should be on the right
3535
//~| binding on the right, should be on the left
3636
//~| HELP switch the order
37-
//~| SUGGESTION e@1 ..=5
37+
//~| SUGGESTION e @ 1 ..=5
3838
_ => {}
3939
}
4040
}

src/test/ui/parser/intersection-patterns.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | Some(x) @ y => {}
66
| | |
77
| | binding on the right, should be on the left
88
| pattern on the left, should be on the right
9-
| help: switch the order: `y@Some(x)`
9+
| help: switch the order: `y @ Some(x)`
1010

1111
error: left-hand side of `@` must be a binding
1212
--> $DIR/intersection-patterns.rs:23:9
@@ -27,7 +27,7 @@ LL | 1 ..= 5 @ e => {}
2727
| | |
2828
| | binding on the right, should be on the left
2929
| pattern on the left, should be on the right
30-
| help: switch the order: `e@1 ..=5`
30+
| help: switch the order: `e @ 1 ..=5`
3131

3232
error: aborting due to 3 previous errors
3333

0 commit comments

Comments
 (0)