]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/unicode-character-literal.fixed
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / parser / unicode-character-literal.fixed
1 // Regression test for #88684: Improve diagnostics for combining marks
2 // in character literals.
3
4 // run-rustfix
5
6 fn main() {
7     let _spade = "♠️";
8     //~^ ERROR: character literal may only contain one codepoint
9     //~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}`
10     //~| HELP: if you meant to write a `str` literal, use double quotes
11
12     let _s = "ṩ̂̊";
13     //~^ ERROR: character literal may only contain one codepoint
14     //~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}`
15     //~| HELP: if you meant to write a `str` literal, use double quotes
16
17     let _a = 'Å';
18     //~^ ERROR: character literal may only contain one codepoint
19     //~| NOTE: this `A` is followed by the combining mark `\u{30a}`
20     //~| HELP: consider using the normalized form `\u{c5}` of this character
21 }