-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #112711 - Emilgardis:lit_byte_char, r=dtolnay
implement Literal::byte_character without this, the only way to create a `LitKind::Byte` is by doing `"b'a'".parse::<Literal>()`, this solves that by enabling `Literal::byte_character(b'a')` cc #71358 The tracking issue is #115268
- Loading branch information
Showing
5 changed files
with
34 additions
and
0 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
10 changes: 10 additions & 0 deletions
10
tests/ui/feature-gates/feature-gate-proc_macro_byte_character.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,10 @@ | ||
// force-host | ||
#![crate_type = "proc-macro"] | ||
|
||
extern crate proc_macro; | ||
|
||
use proc_macro::Literal; | ||
|
||
fn test() { | ||
Literal::byte_character(b'a'); //~ ERROR use of unstable library feature 'proc_macro_byte_character' | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/ui/feature-gates/feature-gate-proc_macro_byte_character.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,12 @@ | ||
error[E0658]: use of unstable library feature 'proc_macro_byte_character' | ||
--> $DIR/feature-gate-proc_macro_byte_character.rs:9:5 | ||
| | ||
LL | Literal::byte_character(b'a'); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #115268 <https://github.com/rust-lang/rust/issues/115268> for more information | ||
= help: add `#![feature(proc_macro_byte_character)]` to the crate attributes to enable | ||
|
||
error: aborting due to 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