Skip to content

Commit

Permalink
Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors
Browse files Browse the repository at this point in the history
Implement RFC 3348, `c"foo"` literals

RFC: rust-lang/rfcs#3348
Tracking issue: #105723
  • Loading branch information
Dylan-DPC committed May 5, 2023
2 parents 4a0cefa + 4582b0f commit 689c6ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ use crate::str;
///
/// [str]: prim@str "str"
#[derive(Hash)]
#[cfg_attr(not(test), rustc_diagnostic_item = "CStr")]
#[stable(feature = "core_c_str", since = "1.64.0")]
#[rustc_has_incoherent_inherent_impls]
#[cfg_attr(not(bootstrap), lang = "CStr")]
// FIXME:
// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
// on `CStr` being layout-compatible with `[u8]`.
Expand Down
4 changes: 4 additions & 0 deletions proc_macro/src/bridge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ pub enum LitKind {
StrRaw(u8),
ByteStr,
ByteStrRaw(u8),
CStr,
CStrRaw(u8),
Err,
}

Expand All @@ -350,6 +352,8 @@ rpc_encode_decode!(
StrRaw(n),
ByteStr,
ByteStrRaw(n),
CStr,
CStrRaw(n),
Err,
}
);
Expand Down

0 comments on commit 689c6ed

Please sign in to comment.