1
Fork 0

Stabilize C string literals

This commit is contained in:
John Millikin 2023-11-01 09:16:34 +09:00
parent a395214a3a
commit 0f41bc21b9
19 changed files with 41 additions and 90 deletions

View file

@ -19,8 +19,8 @@ fn invalid_type_err(
let snippet = cx.sess.source_map().span_to_snippet(span).ok();
match ast::LitKind::from_token_lit(token_lit) {
Ok(ast::LitKind::CStr(_, _)) => {
// FIXME(c_str_literals): should concatenation of C string literals
// include the null bytes in the end?
// Avoid ambiguity in handling of terminal `NUL` by refusing to
// concatenate C string literals as bytes.
cx.emit_err(errors::ConcatCStrLit { span: span });
}
Ok(ast::LitKind::Char(_)) => {