lifetime.rs
SHA-256957fcf3923f6cb27d9d6f7caf920fdf0882a131fe5ac3806eab68d934051c2a3
Malecule∅
Evidence
1use proc_macro2::{Ident, Span};
2use std::cmp::Ordering;
3use std::fmt::{self, Display};
4use std::hash::{Hash, Hasher};
5
6#[cfg(feature = "parsing")]
7use crate::lookahead;
8
9/// A Rust lifetime: `'a`.
10///
11/// Lifetime names must conform to the following rules:
12///
13/// - Must start with an apostrophe.
14/// - Must not consist of just an apostrophe: `'`.
15/// - Character after the apo …
57:36… ol[1..], span),
58 }
59 }
60}
61
62impl Display for Lifetime {
63 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
64 "'".fmt(f …
111:7… feature = "parsing")]
112pub mod parsing {
113 use super::*;
114 use crate::parse::{Parse, ParseStream, Result};
115
116 #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
117 impl Parse for Lifetime {
118 fn parse(inp …
129:8… nting {
130 use super::*;
131 use proc_macro2::{Punct, Spacing, TokenStream};
132 use quote::{ToTokens, TokenStreamExt};
133
134 #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
135 impl ToTokens for Lifetime {
136 f …