Skip to content

Commit a048447

Browse files
committed
Add test case for issue #64732
1 parent 5418e15 commit a048447

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/test/ui/issues/issue-64732.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![allow(unused)]
2+
fn main() {
3+
let _foo = b'hello\0';
4+
//~^ ERROR character literal may only contain one codepoint
5+
//~| HELP if you meant to write a byte string literal, use double quotes
6+
let _bar = 'hello';
7+
//~^ ERROR character literal may only contain one codepoint
8+
//~| HELP if you meant to write a `str` literal, use double quotes
9+
}

src/test/ui/issues/issue-64732.stderr

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error: character literal may only contain one codepoint
2+
--> $DIR/issue-64732.rs:3:17
3+
|
4+
LL | let _foo = b'hello\0';
5+
| ^^^^^^^^^
6+
help: if you meant to write a byte string literal, use double quotes
7+
|
8+
LL | let _foo = b"hello\0";
9+
| ^^^^^^^^^
10+
11+
error: character literal may only contain one codepoint
12+
--> $DIR/issue-64732.rs:6:16
13+
|
14+
LL | let _bar = 'hello';
15+
| ^^^^^^^
16+
help: if you meant to write a `str` literal, use double quotes
17+
|
18+
LL | let _bar = "hello";
19+
| ^^^^^^^
20+
21+
error: aborting due to 2 previous errors
22+

0 commit comments

Comments
 (0)