Add test case for issue #64732
This commit is contained in:
parent
5418e15a50
commit
a048447ff4
2 changed files with 31 additions and 0 deletions
9
src/test/ui/issues/issue-64732.rs
Normal file
9
src/test/ui/issues/issue-64732.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#![allow(unused)]
|
||||
fn main() {
|
||||
let _foo = b'hello\0';
|
||||
//~^ ERROR character literal may only contain one codepoint
|
||||
//~| HELP if you meant to write a byte string literal, use double quotes
|
||||
let _bar = 'hello';
|
||||
//~^ ERROR character literal may only contain one codepoint
|
||||
//~| HELP if you meant to write a `str` literal, use double quotes
|
||||
}
|
22
src/test/ui/issues/issue-64732.stderr
Normal file
22
src/test/ui/issues/issue-64732.stderr
Normal file
|
@ -0,0 +1,22 @@
|
|||
error: character literal may only contain one codepoint
|
||||
--> $DIR/issue-64732.rs:3:17
|
||||
|
|
||||
LL | let _foo = b'hello\0';
|
||||
| ^^^^^^^^^
|
||||
help: if you meant to write a byte string literal, use double quotes
|
||||
|
|
||||
LL | let _foo = b"hello\0";
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: character literal may only contain one codepoint
|
||||
--> $DIR/issue-64732.rs:6:16
|
||||
|
|
||||
LL | let _bar = 'hello';
|
||||
| ^^^^^^^
|
||||
help: if you meant to write a `str` literal, use double quotes
|
||||
|
|
||||
LL | let _bar = "hello";
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue