Lines Matching refs:Ident
552 Ident(Ident),
565 TokenTree::Ident(t) => t.span(),
579 TokenTree::Ident(t) => t.set_span(span),
592 impl From<Ident> for TokenTree {
593 fn from(g: Ident) -> Self {
594 TokenTree::Ident(g)
618 TokenTree::Ident(t) => Display::fmt(t, f),
632 TokenTree::Ident(t) => {
633 let mut debug = f.debug_struct("Ident");
861 /// - The empty string is not an identifier. Use `Option<Ident>`.
864 /// An identifier constructed with `Ident::new` is permitted to be a Rust
866 /// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the
867 /// behaviour of `Ident::new`.
873 /// A new ident can be created from a string using the `Ident::new` function.
878 /// use proc_macro2::{Ident, Span};
881 /// let call_ident = Ident::new("calligraphy", Span::call_site());
890 /// use proc_macro2::{Ident, Span};
894 /// let ident = Ident::new("demo", Span::call_site());
900 /// let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
909 /// # use proc_macro2::{Ident, Span};
911 /// # let ident = Ident::new("another_identifier", Span::call_site());
920 pub struct Ident {
921 inner: imp::Ident,
925 impl Ident {
926 fn _new(inner: imp::Ident) -> Self {
927 Ident {
933 /// Creates a new `Ident` with the given `string` as well as the specified
962 /// style="padding-left:0;">::<Ident></code>
963 /// rather than `Ident::new`.
966 Ident::_new(imp::Ident::new_checked(string, span.inner))
969 /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). The
976 Ident::_new(imp::Ident::new_raw_checked(string, span.inner))
979 /// Returns the span of this `Ident`.
984 /// Configures the span of this `Ident`, possibly changing its hygiene
991 impl PartialEq for Ident {
992 fn eq(&self, other: &Ident) -> bool {
997 impl<T> PartialEq<T> for Ident
1006 impl Eq for Ident {}
1008 impl PartialOrd for Ident {
1009 fn partial_cmp(&self, other: &Ident) -> Option<Ordering> {
1014 impl Ord for Ident {
1015 fn cmp(&self, other: &Ident) -> Ordering {
1020 impl Hash for Ident {
1028 impl Display for Ident {
1034 impl Debug for Ident {
1045 /// `Ident`s.