Skip to content

Commit ad300b6

Browse files
authored
Rollup merge of rust-lang#123431 - slanterns:literal_byte_character_c_string_stabilize, r=dtolnay
Stabilize `proc_macro_byte_character` and `proc_macro_c_str_literals` This PR stabilizes `proc_macro_byte_character` and `proc_macro_c_str_literals`: ```rust // proc_macro::Literal impl Literal { pub fn byte_character(byte: u8) -> Literal; pub fn c_string(string: &CStr) -> Literal } ``` <br> Tracking issue: rust-lang#115268, rust-lang#119750. Implementation PR: rust-lang#112711, rust-lang#119651. FCPs already completed in their respective tracking issues. Closes rust-lang#115268. Closes rust-lang#119750. r? libs-api
2 parents f254ab0 + fbc56df commit ad300b6

File tree

6 files changed

+2
-51
lines changed

6 files changed

+2
-51
lines changed

library/proc_macro/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ impl Literal {
13601360
}
13611361

13621362
/// Byte character literal.
1363-
#[unstable(feature = "proc_macro_byte_character", issue = "115268")]
1363+
#[stable(feature = "proc_macro_byte_character", since = "CURRENT_RUSTC_VERSION")]
13641364
pub fn byte_character(byte: u8) -> Literal {
13651365
let string = [byte].escape_ascii().to_string();
13661366
Literal::new(bridge::LitKind::Byte, &string, None)
@@ -1374,7 +1374,7 @@ impl Literal {
13741374
}
13751375

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

tests/ui/feature-gates/feature-gate-proc_macro_byte_character.rs

-10
This file was deleted.

tests/ui/feature-gates/feature-gate-proc_macro_byte_character.stderr

-13
This file was deleted.

tests/ui/feature-gates/feature-gate-proc_macro_c_str_literals.rs

-11
This file was deleted.

tests/ui/feature-gates/feature-gate-proc_macro_c_str_literals.stderr

-13
This file was deleted.

tests/ui/proc-macro/auxiliary/api/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#![crate_type = "proc-macro"]
66
#![crate_name = "proc_macro_api_tests"]
77
#![feature(proc_macro_span)]
8-
#![feature(proc_macro_byte_character)]
9-
#![feature(proc_macro_c_str_literals)]
108
#![deny(dead_code)] // catch if a test function is never called
119

1210
extern crate proc_macro;

0 commit comments

Comments
 (0)