1
Fork 0

Stabilize Literal::c_string

This commit is contained in:
Slanterns 2024-04-04 05:04:27 +08:00
parent 61ac7812c6
commit fbc56dfac1
No known key found for this signature in database
GPG key ID: 1AA37EE7FAAE433A
4 changed files with 1 additions and 26 deletions

View file

@ -1374,7 +1374,7 @@ impl Literal {
}
/// C string literal.
#[unstable(feature = "proc_macro_c_str_literals", issue = "119750")]
#[stable(feature = "proc_macro_c_str_literals", since = "CURRENT_RUSTC_VERSION")]
pub fn c_string(string: &CStr) -> Literal {
let string = string.to_bytes().escape_ascii().to_string();
Literal::new(bridge::LitKind::CStr, &string, None)