Skip to content

Commit 45cb7c6

Browse files
committed
Add ui test reverved-guarded-string-too-many-terminators-issue-140618
Signed-off-by: xizheyin <[email protected]>
1 parent 775e0c8 commit 45cb7c6

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//@ edition:2024
2+
3+
fn f0(){
4+
r#"ok0!"#;
5+
}
6+
7+
fn f1(){
8+
r#"ok1!"##;
9+
//~^ ERROR too many `#` when terminating raw string
10+
}
11+
12+
13+
fn f2(){
14+
r#"ok2!"###;
15+
//~^ ERROR reserved multi-hash token is forbidden
16+
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `##`
17+
}
18+
19+
fn f3(){
20+
#"ok3!"#;
21+
//~^ ERROR invalid string literal
22+
}
23+
24+
25+
fn f4(){
26+
#"ok4!"##;
27+
//~^ ERROR invalid string literal
28+
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `#`
29+
}
30+
31+
fn f5(){
32+
#"ok5!"###;
33+
//~^ ERROR invalid string literal
34+
//~| ERROR reserved multi-hash token is forbidden
35+
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `##`
36+
}
37+
38+
fn main() {}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
error: reserved multi-hash token is forbidden
2+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:14:14
3+
|
4+
LL | r#"ok2!"###;
5+
| ^^
6+
|
7+
= note: sequences of two or more # are reserved for future use since Rust 2024
8+
help: consider inserting whitespace here
9+
|
10+
LL | r#"ok2!"## #;
11+
| +
12+
13+
error: invalid string literal
14+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:20:5
15+
|
16+
LL | #"ok3!"#;
17+
| ^^^^^^^^
18+
|
19+
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
20+
help: consider inserting whitespace here
21+
|
22+
LL | # "ok3!"#;
23+
| +
24+
25+
error: invalid string literal
26+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:26:5
27+
|
28+
LL | #"ok4!"##;
29+
| ^^^^^^^^
30+
|
31+
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
32+
help: consider inserting whitespace here
33+
|
34+
LL | # "ok4!"##;
35+
| +
36+
37+
error: invalid string literal
38+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:32:5
39+
|
40+
LL | #"ok5!"###;
41+
| ^^^^^^^^
42+
|
43+
= note: unprefixed guarded string literals are reserved for future use since Rust 2024
44+
help: consider inserting whitespace here
45+
|
46+
LL | # "ok5!"###;
47+
| +
48+
49+
error: reserved multi-hash token is forbidden
50+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:32:13
51+
|
52+
LL | #"ok5!"###;
53+
| ^^
54+
|
55+
= note: sequences of two or more # are reserved for future use since Rust 2024
56+
help: consider inserting whitespace here
57+
|
58+
LL | #"ok5!"## #;
59+
| +
60+
61+
error: too many `#` when terminating raw string
62+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:8:14
63+
|
64+
LL | r#"ok1!"##;
65+
| ---------^ help: remove the extra `#`
66+
| |
67+
| this raw string started with 1 `#`
68+
69+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `##`
70+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:14:14
71+
|
72+
LL | r#"ok2!"###;
73+
| ^^ expected one of `.`, `;`, `?`, `}`, or an operator
74+
75+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `#`
76+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:26:13
77+
|
78+
LL | #"ok4!"##;
79+
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
80+
81+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `##`
82+
--> $DIR/reverved-guarded-string-too-many-terminators-issue-140618.rs:32:13
83+
|
84+
LL | #"ok5!"###;
85+
| ^^ expected one of `.`, `;`, `?`, `}`, or an operator
86+
87+
error: aborting due to 9 previous errors
88+

0 commit comments

Comments
 (0)