forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#119651 - novafacing:proc_macro_c_str_literals…
…, r=Amanieu proc_macro: Add Literal::c_string constructor Adds a constructor for C string literals, hopefully starts addressing rust-lang#118560. Tracking issue: rust-lang#119750
- Loading branch information
Showing
6 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/ui/feature-gates/feature-gate-proc_macro_c_str_literals.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// edition: 2021 | ||
// force-host | ||
#![crate_type = "proc-macro"] | ||
|
||
extern crate proc_macro; | ||
|
||
use proc_macro::Literal; | ||
|
||
fn test() { | ||
Literal::c_string(c"a"); //~ ERROR use of unstable library feature 'proc_macro_c_str_literals' | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/ui/feature-gates/feature-gate-proc_macro_c_str_literals.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0658]: use of unstable library feature 'proc_macro_c_str_literals' | ||
--> $DIR/feature-gate-proc_macro_c_str_literals.rs:10:5 | ||
| | ||
LL | Literal::c_string(c"a"); | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #119750 <https://github.com/rust-lang/rust/issues/119750> for more information | ||
= help: add `#![feature(proc_macro_c_str_literals)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters