Skip to content

Commit 04123c2

Browse files
committed
Update re-enabled feature gate test, update features for functionality test
1 parent 821ff2a commit 04123c2

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

library/proc_macro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ impl Literal {
13531353
}
13541354

13551355
/// C string literal.
1356-
#[stable(feature = "c_str_literals", since = "1.76.0")]
1356+
#[unstable(feature = "proc_macro_c_str_literals", issue = "119750")]
13571357
pub fn c_string(string: &CStr) -> Literal {
13581358
let quoted = format!("{:?}", string);
13591359
assert!(quoted.starts_with('"') && quoted.ends_with('"'));

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

-12
This file was deleted.

tests/ui/feature-gates/feature-gate-c_string_literals.rs renamed to tests/ui/feature-gates/feature-gate-proc_macro_c_str_literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ extern crate proc_macro;
77
use proc_macro::Literal;
88

99
fn test() {
10-
Literal::c_string(c"a"); //~ ERROR use of unstable library feature 'c_str_literals'
10+
Literal::c_string(c"a"); //~ ERROR use of unstable library feature 'proc_macro_c_str_literals'
1111
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0658]: use of unstable library feature 'proc_macro_c_str_literals'
2+
--> $DIR/feature-gate-proc_macro_c_str_literals.rs:10:5
3+
|
4+
LL | Literal::c_string(c"a");
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #119750 <https://github.com/rust-lang/rust/issues/119750> for more information
8+
= help: add `#![feature(proc_macro_c_str_literals)]` to the crate attributes to enable
9+
10+
error: aborting due to 1 previous error
11+
12+
For more information about this error, try `rustc --explain E0658`.

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

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![crate_name = "proc_macro_api_tests"]
77
#![feature(proc_macro_span)]
88
#![feature(proc_macro_byte_character)]
9+
#![feature(proc_macro_c_str_literals)]
910
#![deny(dead_code)] // catch if a test function is never called
1011

1112
extern crate proc_macro;

0 commit comments

Comments
 (0)