@@ -5,18 +5,25 @@ use std::iter;
5
5
6
6
fn main ( ) {
7
7
format ! ( "A number: {}" . iter:: once( 42 ) . next( ) . unwrap( ) ) ;
8
- //~^ ERROR expected token: `, `
8
+ //~^ ERROR expected `,`, found `. `
9
9
10
10
// Other kind of types are also checked:
11
11
12
12
format ! ( "A number: {}" / iter:: once( 42 ) . next( ) . unwrap( ) ) ;
13
- //~^ ERROR expected token: `, `
13
+ //~^ ERROR expected `,`, found `/ `
14
14
15
15
format ! ( "A number: {}" ; iter:: once( 42 ) . next( ) . unwrap( ) ) ;
16
- //~^ ERROR expected token: `, `
16
+ //~^ ERROR expected `,`, found `; `
17
17
18
18
// Note: this character is an COMBINING COMMA BELOW unicode char
19
19
format ! ( "A number: {}" ̦ iter:: once( 42 ) . next( ) . unwrap( ) ) ;
20
- //~^ ERROR expected token: `, `
20
+ //~^ ERROR expected `,`, found `iter `
21
21
//~^^ ERROR unknown start of token: \u{326}
22
+
23
+ // Here recovery is tested.
24
+ // If the `compile_error!` is emitted, then the parser is able to recover
25
+ // from the incorrect first separator.
26
+ format ! ( "{}" . compile_error!( "fail" ) ) ;
27
+ //~^ ERROR expected `,`, found `.`
28
+ //~^^ ERROR fail
22
29
}
0 commit comments