Stabilize Literal::c_string
This commit is contained in:
parent
61ac7812c6
commit
fbc56dfac1
4 changed files with 1 additions and 26 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue