Skip to content

Commit d6d8e16

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

File tree

2 files changed

+106
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)