Skip to content

Commit 64be6ce

Browse files
authored
Rollup merge of rust-lang#75084 - Aaron1011:stabilize/ident-new-raw, r=petrochenkov
Stabilize Ident::new_raw Tracking issue: rust-lang#54723 This is a continuation of PR rust-lang#59002
2 parents 7014a2c + f857f5c commit 64be6ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

proc_macro/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ impl Ident {
848848
/// Creates a new `Ident` with the given `string` as well as the specified
849849
/// `span`.
850850
/// The `string` argument must be a valid identifier permitted by the
851-
/// language, otherwise the function will panic.
851+
/// language (including keywords, e.g. `self` or `fn`). Otherwise, the function will panic.
852852
///
853853
/// Note that `span`, currently in rustc, configures the hygiene information
854854
/// for this identifier.
@@ -870,7 +870,10 @@ impl Ident {
870870
}
871871

872872
/// Same as `Ident::new`, but creates a raw identifier (`r#ident`).
873-
#[unstable(feature = "proc_macro_raw_ident", issue = "54723")]
873+
/// The `string` argument be a valid identifier permitted by the language
874+
/// (including keywords, e.g. `fn`). Keywords which are usable in path segments
875+
/// (e.g. `self`, `super`) are not supported, and will cause a panic.
876+
#[stable(feature = "proc_macro_raw_ident", since = "1.47.0")]
874877
pub fn new_raw(string: &str, span: Span) -> Ident {
875878
Ident(bridge::client::Ident::new(string, span.0, true))
876879
}

0 commit comments

Comments
 (0)