Skip to content

Commit 689c6ed

Browse files
authored
Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors
Implement RFC 3348, `c"foo"` literals RFC: rust-lang/rfcs#3348 Tracking issue: #105723
2 parents 4a0cefa + 4582b0f commit 689c6ed

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/src/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ use crate::str;
7979
///
8080
/// [str]: prim@str "str"
8181
#[derive(Hash)]
82-
#[cfg_attr(not(test), rustc_diagnostic_item = "CStr")]
8382
#[stable(feature = "core_c_str", since = "1.64.0")]
8483
#[rustc_has_incoherent_inherent_impls]
84+
#[cfg_attr(not(bootstrap), lang = "CStr")]
8585
// FIXME:
8686
// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
8787
// on `CStr` being layout-compatible with `[u8]`.

proc_macro/src/bridge/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ pub enum LitKind {
337337
StrRaw(u8),
338338
ByteStr,
339339
ByteStrRaw(u8),
340+
CStr,
341+
CStrRaw(u8),
340342
Err,
341343
}
342344

@@ -350,6 +352,8 @@ rpc_encode_decode!(
350352
StrRaw(n),
351353
ByteStr,
352354
ByteStrRaw(n),
355+
CStr,
356+
CStrRaw(n),
353357
Err,
354358
}
355359
);

0 commit comments

Comments
 (0)