Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f86a30d0f916da24794105853db7b8a86d6e2742
Choose a base ref
..
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75aeabf0f6646ccc1a554ed47d4bb59d302b0061
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +5 −5 library/proc_macro/src/lib.rs
10 changes: 5 additions & 5 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ use std::{error, fmt};

#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
pub use diagnostic::{Diagnostic, Level, MultiSpan};
#[stable(feature = "proc_macro_value", since = "1.86.0")]
#[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")]
pub use literal_escaper::EscapeError;
use literal_escaper::{MixedUnit, Mode, byte_from_char, unescape_mixed, unescape_unicode};
#[unstable(feature = "proc_macro_totokens", issue = "130977")]
@@ -60,7 +60,7 @@ pub use to_tokens::ToTokens;
use crate::escape::{EscapeOptions, escape_bytes};

/// Errors returned when trying to retrieve a literal unescaped value.
#[stable(feature = "proc_macro_value", since = "1.86.0")]
#[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")]
pub enum ConversionErrorKind {
/// The literal failed to be escaped, take a look at [`EscapeError`] for more information.
FailedToUnescape(EscapeError),
@@ -1465,7 +1465,7 @@ impl Literal {
}

/// Returns the unescaped string value if the current literal is a string or a string literal.
#[stable(feature = "proc_macro_value", since = "1.86.0")]
#[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")]
pub fn str_value(&self) -> Result<String, ConversionErrorKind> {
self.0.symbol.with(|symbol| match self.0.kind {
bridge::LitKind::Str => {
@@ -1500,7 +1500,7 @@ impl Literal {

/// Returns the unescaped string value if the current literal is a c-string or a c-string
/// literal.
#[stable(feature = "proc_macro_value", since = "1.86.0")]
#[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")]
pub fn cstr_value(&self) -> Result<Vec<u8>, ConversionErrorKind> {
self.0.symbol.with(|symbol| match self.0.kind {
bridge::LitKind::CStr => {
@@ -1539,7 +1539,7 @@ impl Literal {

/// Returns the unescaped string value if the current literal is a byte string or a byte string
/// literal.
#[stable(feature = "proc_macro_value", since = "1.86.0")]
#[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")]
pub fn byte_str_value(&self) -> Result<Vec<u8>, ConversionErrorKind> {
self.0.symbol.with(|symbol| match self.0.kind {
bridge::LitKind::ByteStr => {