Commit b09af8e
lex: Emit E0768 for empty non-decimal literals
Previously, the lexer evaluated empty non-decimal literals (like 0x, 0b, 0o) as 0.
Now, it emits error E0768 when there are no valid digits.
gcc/rust/ChangeLog:
* lex/rust-lex.cc (Lexer::parse_non_decimal_int_literal): Emit E0768.
gcc/testsuite/ChangeLog:
* rust/compile/empty-non-decimal.rs: New test.
Signed-off-by: Enes Cevik <nsvke@proton.me>1 parent b992076 commit b09af8e
2 files changed
Lines changed: 26 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2150 | 2150 | | |
2151 | 2151 | | |
2152 | 2152 | | |
2153 | | - | |
| 2153 | + | |
| 2154 | + | |
2154 | 2155 | | |
2155 | 2156 | | |
2156 | 2157 | | |
2157 | | - | |
2158 | | - | |
2159 | 2158 | | |
2160 | | - | |
| 2159 | + | |
2161 | 2160 | | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
2162 | 2169 | | |
2163 | 2170 | | |
2164 | 2171 | | |
| |||
2176 | 2183 | | |
2177 | 2184 | | |
2178 | 2185 | | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
2179 | 2191 | | |
2180 | 2192 | | |
2181 | 2193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments