]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/lex-bad-char-literals.rs
* Introduce some changes by Angus Lees
[rustc.git] / src / test / compile-fail / lex-bad-char-literals.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11static c: char =
12 '\u539_' //~ ERROR: illegal character in numeric character escape
13 //~^ WARNING: \uABCD escapes are deprecated
14;
15
16static c2: char =
17 '\Uffffffff' //~ ERROR: illegal numeric character escape
18 //~^ WARNING: \uABCD escapes are deprecated
19;
20
21static c3: char =
22 '\x1' //~ ERROR: numeric character escape is too short
23;
24
25static c4: char =
26 '\u23q' //~ ERROR: illegal character in numeric character escape
27 //~^ WARNING: \uABCD escapes are deprecated
28;
29//~^^^ ERROR: numeric character escape is too short
30
31static s: &'static str =
32 "\x1" //~ ERROR: numeric character escape is too short
33;
34
35static s2: &'static str =
36 "\u23q" //~ ERROR: illegal character in numeric character escape
37 //~^ ERROR: numeric character escape is too short
38 //~^^ WARNING: \uABCD escapes are deprecated
39;
40
41static c: char =
42 '\●' //~ ERROR: unknown character escape
43;
44
45static s: &'static str =
46 "\●" //~ ERROR: unknown character escape
47;
48
49// THIS MUST BE LAST, since unterminated character constants kill the lexer
50
51static c: char =
52 '● //~ ERROR: unterminated character constant
53;