1#[cfg(feature = "parsing")]
92pub(crate) use self::private::CustomToken;
93use self::private::WithSpan;
94#[cfg(feature = "parsing")]
95use crate::buffer::Cursor;
96#[cfg(feature = "parsing")]
97use crate::error::Result;
98#[cfg(feature = "parsing")]
99use crate::lifetime::Lifetime;
100#[cfg(feature = "parsing")]
101use crate::parse::{Parse, ParseStream};
102use crate::span::IntoSpans;
103#[cfg(feature = "extra-traits")]
104use core::cmp;
105#[cfg(feature = "extra-traits")]
106use core::fmt::{self, Debug};
107#[cfg(feature = "extra-traits")]
108use core::hash::{Hash, Hasher};
109use core::ops::{Deref, DerefMut};
110use proc_macro2::extra::DelimSpan;
111use proc_macro2::Span;
112#[cfg(feature = "printing")]
113use proc_macro2::TokenStream;
114#[cfg(any(feature = "parsing", feature = "printing"))]
115use proc_macro2::{Delimiter, Ident};
116#[cfg(feature = "parsing")]
117use proc_macro2::{Literal, Punct, TokenTree};
118#[cfg(feature = "printing")]
119use quote::{ToTokens, TokenStreamExt as _};
120
121#[cfg(feature = "parsing")]
125pub trait Token: private::Sealed {
126 #[doc(hidden)]
128 fn peek(cursor: Cursor) -> bool;
129
130 #[doc(hidden)]
132 fn display() -> &'static str;
133}
134
135pub(crate) mod private {
136 #[cfg(feature = "parsing")]
137 use crate::buffer::Cursor;
138 use proc_macro2::Span;
139
140 #[cfg(feature = "parsing")]
141 pub trait Sealed {}
142
143 #[repr(transparent)]
146 #[allow(
147 unknown_lints,
148 renamed_and_removed_lints,
149 repr_transparent_non_zst_fields,
151 )]
152 pub struct WithSpan {
153 pub span: Span,
154 }
155
156 #[doc(hidden)]
158 #[cfg(feature = "parsing")]
159 pub trait CustomToken {
160 fn peek(cursor: Cursor) -> bool;
161 fn display() -> &'static str;
162 }
163}
164
165#[cfg(feature = "parsing")]
166impl private::Sealed for Ident {}
167
168macro_rules! impl_low_level_token {
169 ($display:literal $($path:ident)::+ $get:ident) => {
170 #[cfg(feature = "parsing")]
171 impl Token for $($path)::+ {
172 fn peek(cursor: Cursor) -> bool {
173 cursor.$get().is_some()
174 }
175
176 fn display() -> &'static str {
177 $display
178 }
179 }
180
181 #[cfg(feature = "parsing")]
182 impl private::Sealed for $($path)::+ {}
183 };
184}
185
186impl Token for Punct {
fn peek(cursor: Cursor) -> bool { cursor.punct().is_some() }
fn display() -> &'static str { "punctuation token" }
}
impl private::Sealed for Punct { }impl_low_level_token!("punctuation token" Punct punct);
187impl Token for Literal {
fn peek(cursor: Cursor) -> bool { cursor.literal().is_some() }
fn display() -> &'static str { "literal" }
}
impl private::Sealed for Literal { }impl_low_level_token!("literal" Literal literal);
188impl Token for TokenTree {
fn peek(cursor: Cursor) -> bool { cursor.token_tree().is_some() }
fn display() -> &'static str { "token" }
}
impl private::Sealed for TokenTree { }impl_low_level_token!("token" TokenTree token_tree);
189impl Token for proc_macro2::Group {
fn peek(cursor: Cursor) -> bool { cursor.any_group().is_some() }
fn display() -> &'static str { "group token" }
}
impl private::Sealed for proc_macro2::Group { }impl_low_level_token!("group token" proc_macro2::Group any_group);
190impl Token for Lifetime {
fn peek(cursor: Cursor) -> bool { cursor.lifetime().is_some() }
fn display() -> &'static str { "lifetime" }
}
impl private::Sealed for Lifetime { }impl_low_level_token!("lifetime" Lifetime lifetime);
191
192#[cfg(feature = "parsing")]
193impl<T: CustomToken> private::Sealed for T {}
194
195#[cfg(feature = "parsing")]
196impl<T: CustomToken> Token for T {
197 fn peek(cursor: Cursor) -> bool {
198 <Self as CustomToken>::peek(cursor)
199 }
200
201 fn display() -> &'static str {
202 <Self as CustomToken>::display()
203 }
204}
205
206macro_rules! define_keywords {
207 ($($token:literal pub struct $name:ident)*) => {
208 $(
209 #[doc = concat!('`', $token, '`')]
210 pub struct $name {
216 pub span: Span,
217 }
218
219 #[doc(hidden)]
220 #[allow(non_snake_case)]
221 pub fn $name<S: IntoSpans<Span>>(span: S) -> $name {
222 $name {
223 span: span.into_spans(),
224 }
225 }
226
227 impl core::default::Default for $name {
228 fn default() -> Self {
229 $name {
230 span: Span::call_site(),
231 }
232 }
233 }
234
235 #[cfg(feature = "clone-impls")]
236 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
237 impl Copy for $name {}
238
239 #[cfg(feature = "clone-impls")]
240 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
241 impl Clone for $name {
242 fn clone(&self) -> Self {
243 *self
244 }
245 }
246
247 #[cfg(feature = "extra-traits")]
248 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
249 impl Debug for $name {
250 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
251 format_token(f, $token)
252 }
253 }
254
255 #[cfg(feature = "extra-traits")]
256 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
257 impl cmp::Eq for $name {}
258
259 #[cfg(feature = "extra-traits")]
260 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
261 impl PartialEq for $name {
262 fn eq(&self, _other: &$name) -> bool {
263 true
264 }
265 }
266
267 #[cfg(feature = "extra-traits")]
268 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
269 impl Hash for $name {
270 fn hash<H: Hasher>(&self, _state: &mut H) {}
271 }
272
273 #[cfg(feature = "printing")]
274 #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
275 impl ToTokens for $name {
276 fn to_tokens(&self, tokens: &mut TokenStream) {
277 printing::keyword($token, self.span, tokens);
278 }
279 }
280
281 #[cfg(feature = "parsing")]
282 #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
283 impl Parse for $name {
284 fn parse(input: ParseStream) -> Result<Self> {
285 Ok($name {
286 span: parsing::keyword(input, $token)?,
287 })
288 }
289 }
290
291 #[cfg(feature = "parsing")]
292 impl Token for $name {
293 fn peek(cursor: Cursor) -> bool {
294 cursor.peek_keyword($token)
295 }
296
297 fn display() -> &'static str {
298 concat!("`", $token, "`")
299 }
300 }
301
302 #[cfg(feature = "parsing")]
303 impl private::Sealed for $name {}
304 )*
305 };
306}
307
308macro_rules! impl_deref_if_len_is_1 {
309 ($name:ident/1) => {
310 impl Deref for $name {
311 type Target = WithSpan;
312
313 fn deref(&self) -> &Self::Target {
314 unsafe { &*(self as *const Self).cast::<WithSpan>() }
315 }
316 }
317
318 impl DerefMut for $name {
319 fn deref_mut(&mut self) -> &mut Self::Target {
320 unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
321 }
322 }
323 };
324
325 ($name:ident/$len:literal) => {};
326}
327
328macro_rules! define_punctuation_structs {
329 ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
330 $(
331 #[cfg_attr(not(doc), repr(transparent))]
332 #[allow(
333 unknown_lints,
334 renamed_and_removed_lints,
335 repr_transparent_non_zst_fields,
337 )]
338 #[doc = concat!('`', $token, '`')]
339 #[doc = concat!($usage, '.')]
342 pub struct $name {
348 pub spans: [Span; $len],
349 }
350
351 #[doc(hidden)]
352 #[allow(non_snake_case)]
353 pub fn $name<S: IntoSpans<[Span; $len]>>(spans: S) -> $name {
354 $name {
355 spans: spans.into_spans(),
356 }
357 }
358
359 impl core::default::Default for $name {
360 fn default() -> Self {
361 $name {
362 spans: [Span::call_site(); $len],
363 }
364 }
365 }
366
367 #[cfg(feature = "clone-impls")]
368 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
369 impl Copy for $name {}
370
371 #[cfg(feature = "clone-impls")]
372 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
373 impl Clone for $name {
374 fn clone(&self) -> Self {
375 *self
376 }
377 }
378
379 #[cfg(feature = "extra-traits")]
380 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
381 impl Debug for $name {
382 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
383 format_token(f, $token)
384 }
385 }
386
387 #[cfg(feature = "extra-traits")]
388 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
389 impl cmp::Eq for $name {}
390
391 #[cfg(feature = "extra-traits")]
392 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
393 impl PartialEq for $name {
394 fn eq(&self, _other: &$name) -> bool {
395 true
396 }
397 }
398
399 #[cfg(feature = "extra-traits")]
400 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
401 impl Hash for $name {
402 fn hash<H: Hasher>(&self, _state: &mut H) {}
403 }
404
405 impl_deref_if_len_is_1!($name/$len);
406 )*
407 };
408}
409
410macro_rules! define_punctuation {
411 ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
412 $(
413 define_punctuation_structs! {
414 $token pub struct $name/$len #[doc = $usage]
415 }
416
417 #[cfg(feature = "printing")]
418 #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
419 impl ToTokens for $name {
420 fn to_tokens(&self, tokens: &mut TokenStream) {
421 printing::punct($token, &self.spans, tokens);
422 }
423 }
424
425 #[cfg(feature = "parsing")]
426 #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
427 impl Parse for $name {
428 fn parse(input: ParseStream) -> Result<Self> {
429 Ok($name {
430 spans: parsing::punct(input, $token)?,
431 })
432 }
433 }
434
435 #[cfg(feature = "parsing")]
436 impl Token for $name {
437 fn peek(cursor: Cursor) -> bool {
438 cursor.peek_punct($token)
439 }
440
441 fn display() -> &'static str {
442 concat!("`", $token, "`")
443 }
444 }
445
446 #[cfg(feature = "parsing")]
447 impl private::Sealed for $name {}
448 )*
449 };
450}
451
452macro_rules! define_delimiters {
453 ($($delim:ident pub struct $name:ident #[$doc:meta])*) => {
454 $(
455 #[$doc]
456 pub struct $name {
457 pub span: DelimSpan,
458 }
459
460 #[doc(hidden)]
461 #[allow(non_snake_case)]
462 pub fn $name<S: IntoSpans<DelimSpan>>(span: S) -> $name {
463 $name {
464 span: span.into_spans(),
465 }
466 }
467
468 impl core::default::Default for $name {
469 fn default() -> Self {
470 $name(Span::call_site())
471 }
472 }
473
474 #[cfg(feature = "clone-impls")]
475 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
476 impl Copy for $name {}
477
478 #[cfg(feature = "clone-impls")]
479 #[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
480 impl Clone for $name {
481 fn clone(&self) -> Self {
482 *self
483 }
484 }
485
486 #[cfg(feature = "extra-traits")]
487 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
488 impl Debug for $name {
489 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
490 f.write_str(stringify!($name))
491 }
492 }
493
494 #[cfg(feature = "extra-traits")]
495 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
496 impl cmp::Eq for $name {}
497
498 #[cfg(feature = "extra-traits")]
499 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
500 impl PartialEq for $name {
501 fn eq(&self, _other: &$name) -> bool {
502 true
503 }
504 }
505
506 #[cfg(feature = "extra-traits")]
507 #[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
508 impl Hash for $name {
509 fn hash<H: Hasher>(&self, _state: &mut H) {}
510 }
511
512 impl $name {
513 #[cfg(feature = "printing")]
514 #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
515 pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
516 where
517 F: FnOnce(&mut TokenStream),
518 {
519 let mut inner = TokenStream::new();
520 f(&mut inner);
521 printing::delim(Delimiter::$delim, self.span.join(), tokens, inner);
522 }
523 }
524
525 #[cfg(feature = "parsing")]
526 impl private::Sealed for $name {}
527 )*
528 };
529}
530
531#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`_`"]
#[doc =
" wildcard patterns, inferred types, unnamed items in constants, extern crates, use declarations, and destructuring assignment."]
pub struct Underscore {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Underscore<S: IntoSpans<[Span; 1]>>(spans: S) -> Underscore {
Underscore { spans: spans.into_spans() }
}
impl core::default::Default for Underscore {
fn default() -> Self { Underscore { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Underscore { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Underscore {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Underscore {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "_")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Underscore { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Underscore {
fn eq(&self, _other: &Underscore) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Underscore {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Underscore {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Underscore {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}define_punctuation_structs! {
532 "_" pub struct Underscore/1 }
534
535#[cfg(feature = "printing")]
536#[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
537impl ToTokens for Underscore {
538 fn to_tokens(&self, tokens: &mut TokenStream) {
539 tokens.append(Ident::new("_", self.span));
540 }
541}
542
543#[cfg(feature = "parsing")]
544#[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
545impl Parse for Underscore {
546 fn parse(input: ParseStream) -> Result<Self> {
547 input.step(|cursor| {
548 if let Some((ident, rest)) = cursor.ident() {
549 if ident == "_" {
550 return Ok((Underscore(ident.span()), rest));
551 }
552 }
553 if let Some((punct, rest)) = cursor.punct() {
554 if punct.as_char() == '_' {
555 return Ok((Underscore(punct.span()), rest));
556 }
557 }
558 Err(cursor.error("expected `_`"))
559 })
560 }
561}
562
563#[cfg(feature = "parsing")]
564impl Token for Underscore {
565 fn peek(cursor: Cursor) -> bool {
566 if let Some((ident, _rest)) = cursor.ident() {
567 return ident == "_";
568 }
569 if let Some((punct, _rest)) = cursor.punct() {
570 return punct.as_char() == '_';
571 }
572 false
573 }
574
575 fn display() -> &'static str {
576 "`_`"
577 }
578}
579
580#[cfg(feature = "parsing")]
581impl private::Sealed for Underscore {}
582
583pub struct Group {
585 pub span: Span,
586}
587
588#[doc(hidden)]
589#[allow(non_snake_case)]
590pub fn Group<S: IntoSpans<Span>>(span: S) -> Group {
591 Group {
592 span: span.into_spans(),
593 }
594}
595
596impl core::default::Default for Group {
597 fn default() -> Self {
598 Group {
599 span: Span::call_site(),
600 }
601 }
602}
603
604#[cfg(feature = "clone-impls")]
605#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
606impl Copy for Group {}
607
608#[cfg(feature = "clone-impls")]
609#[cfg_attr(docsrs, doc(cfg(feature = "clone-impls")))]
610impl Clone for Group {
611 fn clone(&self) -> Self {
612 *self
613 }
614}
615
616#[cfg(feature = "extra-traits")]
617#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
618impl Debug for Group {
619 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
620 f.write_str("Group")
621 }
622}
623
624#[cfg(feature = "extra-traits")]
625#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
626impl cmp::Eq for Group {}
627
628#[cfg(feature = "extra-traits")]
629#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
630impl PartialEq for Group {
631 fn eq(&self, _other: &Group) -> bool {
632 true
633 }
634}
635
636#[cfg(feature = "extra-traits")]
637#[cfg_attr(docsrs, doc(cfg(feature = "extra-traits")))]
638impl Hash for Group {
639 fn hash<H: Hasher>(&self, _state: &mut H) {}
640}
641
642impl Group {
643 #[cfg(feature = "printing")]
644 #[cfg_attr(docsrs, doc(cfg(feature = "printing")))]
645 pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
646 where
647 F: FnOnce(&mut TokenStream),
648 {
649 let mut inner = TokenStream::new();
650 f(&mut inner);
651 printing::delim(Delimiter::None, self.span, tokens, inner);
652 }
653}
654
655#[cfg(feature = "parsing")]
656impl private::Sealed for Group {}
657
658#[cfg(feature = "parsing")]
659impl Token for Paren {
660 fn peek(cursor: Cursor) -> bool {
661 cursor.group(Delimiter::Parenthesis).is_some()
662 }
663
664 fn display() -> &'static str {
665 "parentheses"
666 }
667}
668
669#[cfg(feature = "parsing")]
670impl Token for Brace {
671 fn peek(cursor: Cursor) -> bool {
672 cursor.group(Delimiter::Brace).is_some()
673 }
674
675 fn display() -> &'static str {
676 "curly braces"
677 }
678}
679
680#[cfg(feature = "parsing")]
681impl Token for Bracket {
682 fn peek(cursor: Cursor) -> bool {
683 cursor.group(Delimiter::Bracket).is_some()
684 }
685
686 fn display() -> &'static str {
687 "square brackets"
688 }
689}
690
691#[cfg(feature = "parsing")]
692impl Token for Group {
693 fn peek(cursor: Cursor) -> bool {
694 cursor.group(Delimiter::None).is_some()
695 }
696
697 fn display() -> &'static str {
698 "invisible group"
699 }
700}
701
702#[doc = "`abstract`"]
pub struct Abstract {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Abstract<S: IntoSpans<Span>>(span: S) -> Abstract {
Abstract { span: span.into_spans() }
}
impl core::default::Default for Abstract {
fn default() -> Self { Abstract { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Abstract { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Abstract {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Abstract {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "abstract")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Abstract { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Abstract {
fn eq(&self, _other: &Abstract) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Abstract {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Abstract {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("abstract", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Abstract {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Abstract { span: parsing::keyword(input, "abstract")? })
}
}
impl Token for Abstract {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("abstract") }
fn display() -> &'static str { "`abstract`" }
}
impl private::Sealed for Abstract { }
#[doc = "`as`"]
pub struct As {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn As<S: IntoSpans<Span>>(span: S) -> As {
As { span: span.into_spans() }
}
impl core::default::Default for As {
fn default() -> Self { As { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for As { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for As {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for As {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "as")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for As { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for As {
fn eq(&self, _other: &As) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for As {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for As {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("as", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for As {
fn parse(input: ParseStream) -> Result<Self> {
Ok(As { span: parsing::keyword(input, "as")? })
}
}
impl Token for As {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("as") }
fn display() -> &'static str { "`as`" }
}
impl private::Sealed for As { }
#[doc = "`async`"]
pub struct Async {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Async<S: IntoSpans<Span>>(span: S) -> Async {
Async { span: span.into_spans() }
}
impl core::default::Default for Async {
fn default() -> Self { Async { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Async { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Async {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Async {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "async")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Async { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Async {
fn eq(&self, _other: &Async) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Async {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Async {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("async", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Async {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Async { span: parsing::keyword(input, "async")? })
}
}
impl Token for Async {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("async") }
fn display() -> &'static str { "`async`" }
}
impl private::Sealed for Async { }
#[doc = "`auto`"]
pub struct Auto {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Auto<S: IntoSpans<Span>>(span: S) -> Auto {
Auto { span: span.into_spans() }
}
impl core::default::Default for Auto {
fn default() -> Self { Auto { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Auto { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Auto {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Auto {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "auto")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Auto { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Auto {
fn eq(&self, _other: &Auto) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Auto {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Auto {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("auto", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Auto {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Auto { span: parsing::keyword(input, "auto")? })
}
}
impl Token for Auto {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("auto") }
fn display() -> &'static str { "`auto`" }
}
impl private::Sealed for Auto { }
#[doc = "`await`"]
pub struct Await {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Await<S: IntoSpans<Span>>(span: S) -> Await {
Await { span: span.into_spans() }
}
impl core::default::Default for Await {
fn default() -> Self { Await { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Await { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Await {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Await {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "await")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Await { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Await {
fn eq(&self, _other: &Await) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Await {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Await {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("await", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Await {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Await { span: parsing::keyword(input, "await")? })
}
}
impl Token for Await {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("await") }
fn display() -> &'static str { "`await`" }
}
impl private::Sealed for Await { }
#[doc = "`become`"]
pub struct Become {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Become<S: IntoSpans<Span>>(span: S) -> Become {
Become { span: span.into_spans() }
}
impl core::default::Default for Become {
fn default() -> Self { Become { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Become { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Become {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Become {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "become")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Become { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Become {
fn eq(&self, _other: &Become) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Become {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Become {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("become", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Become {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Become { span: parsing::keyword(input, "become")? })
}
}
impl Token for Become {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("become") }
fn display() -> &'static str { "`become`" }
}
impl private::Sealed for Become { }
#[doc = "`box`"]
pub struct Box {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Box<S: IntoSpans<Span>>(span: S) -> Box {
Box { span: span.into_spans() }
}
impl core::default::Default for Box {
fn default() -> Self { Box { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Box { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Box {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Box {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "box")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Box { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Box {
fn eq(&self, _other: &Box) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Box {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Box {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("box", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Box {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Box { span: parsing::keyword(input, "box")? })
}
}
impl Token for Box {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("box") }
fn display() -> &'static str { "`box`" }
}
impl private::Sealed for Box { }
#[doc = "`break`"]
pub struct Break {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Break<S: IntoSpans<Span>>(span: S) -> Break {
Break { span: span.into_spans() }
}
impl core::default::Default for Break {
fn default() -> Self { Break { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Break { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Break {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Break {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "break")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Break { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Break {
fn eq(&self, _other: &Break) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Break {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Break {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("break", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Break {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Break { span: parsing::keyword(input, "break")? })
}
}
impl Token for Break {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("break") }
fn display() -> &'static str { "`break`" }
}
impl private::Sealed for Break { }
#[doc = "`const`"]
pub struct Const {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Const<S: IntoSpans<Span>>(span: S) -> Const {
Const { span: span.into_spans() }
}
impl core::default::Default for Const {
fn default() -> Self { Const { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Const { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Const {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Const {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "const")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Const { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Const {
fn eq(&self, _other: &Const) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Const {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Const {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("const", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Const {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Const { span: parsing::keyword(input, "const")? })
}
}
impl Token for Const {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("const") }
fn display() -> &'static str { "`const`" }
}
impl private::Sealed for Const { }
#[doc = "`continue`"]
pub struct Continue {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Continue<S: IntoSpans<Span>>(span: S) -> Continue {
Continue { span: span.into_spans() }
}
impl core::default::Default for Continue {
fn default() -> Self { Continue { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Continue { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Continue {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Continue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "continue")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Continue { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Continue {
fn eq(&self, _other: &Continue) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Continue {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Continue {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("continue", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Continue {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Continue { span: parsing::keyword(input, "continue")? })
}
}
impl Token for Continue {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("continue") }
fn display() -> &'static str { "`continue`" }
}
impl private::Sealed for Continue { }
#[doc = "`crate`"]
pub struct Crate {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Crate<S: IntoSpans<Span>>(span: S) -> Crate {
Crate { span: span.into_spans() }
}
impl core::default::Default for Crate {
fn default() -> Self { Crate { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Crate { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Crate {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Crate {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "crate")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Crate { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Crate {
fn eq(&self, _other: &Crate) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Crate {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Crate {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("crate", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Crate {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Crate { span: parsing::keyword(input, "crate")? })
}
}
impl Token for Crate {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("crate") }
fn display() -> &'static str { "`crate`" }
}
impl private::Sealed for Crate { }
#[doc = "`default`"]
pub struct Default {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Default<S: IntoSpans<Span>>(span: S) -> Default {
Default { span: span.into_spans() }
}
impl core::default::Default for Default {
fn default() -> Self { Default { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Default { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Default {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Default {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "default")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Default { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Default {
fn eq(&self, _other: &Default) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Default {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Default {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("default", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Default {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Default { span: parsing::keyword(input, "default")? })
}
}
impl Token for Default {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("default") }
fn display() -> &'static str { "`default`" }
}
impl private::Sealed for Default { }
#[doc = "`do`"]
pub struct Do {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Do<S: IntoSpans<Span>>(span: S) -> Do {
Do { span: span.into_spans() }
}
impl core::default::Default for Do {
fn default() -> Self { Do { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Do { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Do {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Do {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "do")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Do { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Do {
fn eq(&self, _other: &Do) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Do {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Do {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("do", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Do {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Do { span: parsing::keyword(input, "do")? })
}
}
impl Token for Do {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("do") }
fn display() -> &'static str { "`do`" }
}
impl private::Sealed for Do { }
#[doc = "`dyn`"]
pub struct Dyn {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Dyn<S: IntoSpans<Span>>(span: S) -> Dyn {
Dyn { span: span.into_spans() }
}
impl core::default::Default for Dyn {
fn default() -> Self { Dyn { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Dyn { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Dyn {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Dyn {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "dyn")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Dyn { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Dyn {
fn eq(&self, _other: &Dyn) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Dyn {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Dyn {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("dyn", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Dyn {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Dyn { span: parsing::keyword(input, "dyn")? })
}
}
impl Token for Dyn {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("dyn") }
fn display() -> &'static str { "`dyn`" }
}
impl private::Sealed for Dyn { }
#[doc = "`else`"]
pub struct Else {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Else<S: IntoSpans<Span>>(span: S) -> Else {
Else { span: span.into_spans() }
}
impl core::default::Default for Else {
fn default() -> Self { Else { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Else { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Else {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Else {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "else")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Else { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Else {
fn eq(&self, _other: &Else) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Else {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Else {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("else", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Else {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Else { span: parsing::keyword(input, "else")? })
}
}
impl Token for Else {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("else") }
fn display() -> &'static str { "`else`" }
}
impl private::Sealed for Else { }
#[doc = "`enum`"]
pub struct Enum {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Enum<S: IntoSpans<Span>>(span: S) -> Enum {
Enum { span: span.into_spans() }
}
impl core::default::Default for Enum {
fn default() -> Self { Enum { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Enum { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Enum {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Enum {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "enum")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Enum { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Enum {
fn eq(&self, _other: &Enum) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Enum {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Enum {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("enum", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Enum {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Enum { span: parsing::keyword(input, "enum")? })
}
}
impl Token for Enum {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("enum") }
fn display() -> &'static str { "`enum`" }
}
impl private::Sealed for Enum { }
#[doc = "`extern`"]
pub struct Extern {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Extern<S: IntoSpans<Span>>(span: S) -> Extern {
Extern { span: span.into_spans() }
}
impl core::default::Default for Extern {
fn default() -> Self { Extern { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Extern { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Extern {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Extern {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "extern")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Extern { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Extern {
fn eq(&self, _other: &Extern) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Extern {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Extern {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("extern", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Extern {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Extern { span: parsing::keyword(input, "extern")? })
}
}
impl Token for Extern {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("extern") }
fn display() -> &'static str { "`extern`" }
}
impl private::Sealed for Extern { }
#[doc = "`final`"]
pub struct Final {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Final<S: IntoSpans<Span>>(span: S) -> Final {
Final { span: span.into_spans() }
}
impl core::default::Default for Final {
fn default() -> Self { Final { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Final { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Final {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Final {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "final")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Final { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Final {
fn eq(&self, _other: &Final) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Final {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Final {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("final", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Final {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Final { span: parsing::keyword(input, "final")? })
}
}
impl Token for Final {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("final") }
fn display() -> &'static str { "`final`" }
}
impl private::Sealed for Final { }
#[doc = "`fn`"]
pub struct Fn {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Fn<S: IntoSpans<Span>>(span: S) -> Fn {
Fn { span: span.into_spans() }
}
impl core::default::Default for Fn {
fn default() -> Self { Fn { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Fn { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Fn {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Fn {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "fn")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Fn { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Fn {
fn eq(&self, _other: &Fn) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Fn {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Fn {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("fn", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Fn {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Fn { span: parsing::keyword(input, "fn")? })
}
}
impl Token for Fn {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("fn") }
fn display() -> &'static str { "`fn`" }
}
impl private::Sealed for Fn { }
#[doc = "`for`"]
pub struct For {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn For<S: IntoSpans<Span>>(span: S) -> For {
For { span: span.into_spans() }
}
impl core::default::Default for For {
fn default() -> Self { For { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for For { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for For {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for For {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "for")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for For { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for For {
fn eq(&self, _other: &For) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for For {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for For {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("for", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for For {
fn parse(input: ParseStream) -> Result<Self> {
Ok(For { span: parsing::keyword(input, "for")? })
}
}
impl Token for For {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("for") }
fn display() -> &'static str { "`for`" }
}
impl private::Sealed for For { }
#[doc = "`if`"]
pub struct If {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn If<S: IntoSpans<Span>>(span: S) -> If {
If { span: span.into_spans() }
}
impl core::default::Default for If {
fn default() -> Self { If { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for If { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for If {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for If {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "if")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for If { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for If {
fn eq(&self, _other: &If) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for If {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for If {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("if", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for If {
fn parse(input: ParseStream) -> Result<Self> {
Ok(If { span: parsing::keyword(input, "if")? })
}
}
impl Token for If {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("if") }
fn display() -> &'static str { "`if`" }
}
impl private::Sealed for If { }
#[doc = "`impl`"]
pub struct Impl {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Impl<S: IntoSpans<Span>>(span: S) -> Impl {
Impl { span: span.into_spans() }
}
impl core::default::Default for Impl {
fn default() -> Self { Impl { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Impl { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Impl {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Impl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "impl")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Impl { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Impl {
fn eq(&self, _other: &Impl) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Impl {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Impl {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("impl", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Impl {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Impl { span: parsing::keyword(input, "impl")? })
}
}
impl Token for Impl {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("impl") }
fn display() -> &'static str { "`impl`" }
}
impl private::Sealed for Impl { }
#[doc = "`in`"]
pub struct In {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn In<S: IntoSpans<Span>>(span: S) -> In {
In { span: span.into_spans() }
}
impl core::default::Default for In {
fn default() -> Self { In { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for In { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for In {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for In {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "in")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for In { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for In {
fn eq(&self, _other: &In) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for In {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for In {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("in", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for In {
fn parse(input: ParseStream) -> Result<Self> {
Ok(In { span: parsing::keyword(input, "in")? })
}
}
impl Token for In {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("in") }
fn display() -> &'static str { "`in`" }
}
impl private::Sealed for In { }
#[doc = "`let`"]
pub struct Let {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Let<S: IntoSpans<Span>>(span: S) -> Let {
Let { span: span.into_spans() }
}
impl core::default::Default for Let {
fn default() -> Self { Let { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Let { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Let {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Let {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "let")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Let { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Let {
fn eq(&self, _other: &Let) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Let {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Let {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("let", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Let {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Let { span: parsing::keyword(input, "let")? })
}
}
impl Token for Let {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("let") }
fn display() -> &'static str { "`let`" }
}
impl private::Sealed for Let { }
#[doc = "`loop`"]
pub struct Loop {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Loop<S: IntoSpans<Span>>(span: S) -> Loop {
Loop { span: span.into_spans() }
}
impl core::default::Default for Loop {
fn default() -> Self { Loop { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Loop { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Loop {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Loop {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "loop")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Loop { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Loop {
fn eq(&self, _other: &Loop) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Loop {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Loop {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("loop", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Loop {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Loop { span: parsing::keyword(input, "loop")? })
}
}
impl Token for Loop {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("loop") }
fn display() -> &'static str { "`loop`" }
}
impl private::Sealed for Loop { }
#[doc = "`macro`"]
pub struct Macro {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Macro<S: IntoSpans<Span>>(span: S) -> Macro {
Macro { span: span.into_spans() }
}
impl core::default::Default for Macro {
fn default() -> Self { Macro { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Macro { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Macro {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Macro {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "macro")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Macro { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Macro {
fn eq(&self, _other: &Macro) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Macro {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Macro {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("macro", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Macro {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Macro { span: parsing::keyword(input, "macro")? })
}
}
impl Token for Macro {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("macro") }
fn display() -> &'static str { "`macro`" }
}
impl private::Sealed for Macro { }
#[doc = "`match`"]
pub struct Match {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Match<S: IntoSpans<Span>>(span: S) -> Match {
Match { span: span.into_spans() }
}
impl core::default::Default for Match {
fn default() -> Self { Match { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Match { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Match {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Match {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "match")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Match { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Match {
fn eq(&self, _other: &Match) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Match {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Match {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("match", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Match {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Match { span: parsing::keyword(input, "match")? })
}
}
impl Token for Match {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("match") }
fn display() -> &'static str { "`match`" }
}
impl private::Sealed for Match { }
#[doc = "`mod`"]
pub struct Mod {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Mod<S: IntoSpans<Span>>(span: S) -> Mod {
Mod { span: span.into_spans() }
}
impl core::default::Default for Mod {
fn default() -> Self { Mod { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Mod { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Mod {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Mod {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "mod")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Mod { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Mod {
fn eq(&self, _other: &Mod) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Mod {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Mod {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("mod", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Mod {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Mod { span: parsing::keyword(input, "mod")? })
}
}
impl Token for Mod {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("mod") }
fn display() -> &'static str { "`mod`" }
}
impl private::Sealed for Mod { }
#[doc = "`move`"]
pub struct Move {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Move<S: IntoSpans<Span>>(span: S) -> Move {
Move { span: span.into_spans() }
}
impl core::default::Default for Move {
fn default() -> Self { Move { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Move { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Move {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Move {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "move")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Move { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Move {
fn eq(&self, _other: &Move) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Move {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Move {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("move", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Move {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Move { span: parsing::keyword(input, "move")? })
}
}
impl Token for Move {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("move") }
fn display() -> &'static str { "`move`" }
}
impl private::Sealed for Move { }
#[doc = "`mut`"]
pub struct Mut {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Mut<S: IntoSpans<Span>>(span: S) -> Mut {
Mut { span: span.into_spans() }
}
impl core::default::Default for Mut {
fn default() -> Self { Mut { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Mut { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Mut {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Mut {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "mut")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Mut { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Mut {
fn eq(&self, _other: &Mut) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Mut {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Mut {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("mut", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Mut {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Mut { span: parsing::keyword(input, "mut")? })
}
}
impl Token for Mut {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("mut") }
fn display() -> &'static str { "`mut`" }
}
impl private::Sealed for Mut { }
#[doc = "`override`"]
pub struct Override {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Override<S: IntoSpans<Span>>(span: S) -> Override {
Override { span: span.into_spans() }
}
impl core::default::Default for Override {
fn default() -> Self { Override { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Override { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Override {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Override {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "override")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Override { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Override {
fn eq(&self, _other: &Override) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Override {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Override {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("override", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Override {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Override { span: parsing::keyword(input, "override")? })
}
}
impl Token for Override {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("override") }
fn display() -> &'static str { "`override`" }
}
impl private::Sealed for Override { }
#[doc = "`priv`"]
pub struct Priv {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Priv<S: IntoSpans<Span>>(span: S) -> Priv {
Priv { span: span.into_spans() }
}
impl core::default::Default for Priv {
fn default() -> Self { Priv { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Priv { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Priv {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Priv {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "priv")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Priv { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Priv {
fn eq(&self, _other: &Priv) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Priv {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Priv {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("priv", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Priv {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Priv { span: parsing::keyword(input, "priv")? })
}
}
impl Token for Priv {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("priv") }
fn display() -> &'static str { "`priv`" }
}
impl private::Sealed for Priv { }
#[doc = "`pub`"]
pub struct Pub {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Pub<S: IntoSpans<Span>>(span: S) -> Pub {
Pub { span: span.into_spans() }
}
impl core::default::Default for Pub {
fn default() -> Self { Pub { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Pub { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Pub {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Pub {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "pub")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Pub { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Pub {
fn eq(&self, _other: &Pub) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Pub {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Pub {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("pub", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Pub {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Pub { span: parsing::keyword(input, "pub")? })
}
}
impl Token for Pub {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("pub") }
fn display() -> &'static str { "`pub`" }
}
impl private::Sealed for Pub { }
#[doc = "`raw`"]
pub struct Raw {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Raw<S: IntoSpans<Span>>(span: S) -> Raw {
Raw { span: span.into_spans() }
}
impl core::default::Default for Raw {
fn default() -> Self { Raw { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Raw { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Raw {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Raw {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "raw")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Raw { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Raw {
fn eq(&self, _other: &Raw) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Raw {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Raw {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("raw", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Raw {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Raw { span: parsing::keyword(input, "raw")? })
}
}
impl Token for Raw {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("raw") }
fn display() -> &'static str { "`raw`" }
}
impl private::Sealed for Raw { }
#[doc = "`ref`"]
pub struct Ref {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Ref<S: IntoSpans<Span>>(span: S) -> Ref {
Ref { span: span.into_spans() }
}
impl core::default::Default for Ref {
fn default() -> Self { Ref { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Ref { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Ref {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Ref {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "ref")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Ref { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Ref {
fn eq(&self, _other: &Ref) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Ref {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Ref {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("ref", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Ref {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Ref { span: parsing::keyword(input, "ref")? })
}
}
impl Token for Ref {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("ref") }
fn display() -> &'static str { "`ref`" }
}
impl private::Sealed for Ref { }
#[doc = "`return`"]
pub struct Return {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Return<S: IntoSpans<Span>>(span: S) -> Return {
Return { span: span.into_spans() }
}
impl core::default::Default for Return {
fn default() -> Self { Return { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Return { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Return {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Return {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "return")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Return { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Return {
fn eq(&self, _other: &Return) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Return {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Return {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("return", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Return {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Return { span: parsing::keyword(input, "return")? })
}
}
impl Token for Return {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("return") }
fn display() -> &'static str { "`return`" }
}
impl private::Sealed for Return { }
#[doc = "`safe`"]
pub struct Safe {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Safe<S: IntoSpans<Span>>(span: S) -> Safe {
Safe { span: span.into_spans() }
}
impl core::default::Default for Safe {
fn default() -> Self { Safe { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Safe { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Safe {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Safe {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "safe")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Safe { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Safe {
fn eq(&self, _other: &Safe) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Safe {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Safe {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("safe", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Safe {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Safe { span: parsing::keyword(input, "safe")? })
}
}
impl Token for Safe {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("safe") }
fn display() -> &'static str { "`safe`" }
}
impl private::Sealed for Safe { }
#[doc = "`Self`"]
pub struct SelfType {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn SelfType<S: IntoSpans<Span>>(span: S) -> SelfType {
SelfType { span: span.into_spans() }
}
impl core::default::Default for SelfType {
fn default() -> Self { SelfType { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for SelfType { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for SelfType {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for SelfType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "Self")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for SelfType { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for SelfType {
fn eq(&self, _other: &SelfType) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for SelfType {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for SelfType {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("Self", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for SelfType {
fn parse(input: ParseStream) -> Result<Self> {
Ok(SelfType { span: parsing::keyword(input, "Self")? })
}
}
impl Token for SelfType {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("Self") }
fn display() -> &'static str { "`Self`" }
}
impl private::Sealed for SelfType { }
#[doc = "`self`"]
pub struct SelfValue {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn SelfValue<S: IntoSpans<Span>>(span: S) -> SelfValue {
SelfValue { span: span.into_spans() }
}
impl core::default::Default for SelfValue {
fn default() -> Self { SelfValue { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for SelfValue { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for SelfValue {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for SelfValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "self")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for SelfValue { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for SelfValue {
fn eq(&self, _other: &SelfValue) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for SelfValue {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for SelfValue {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("self", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for SelfValue {
fn parse(input: ParseStream) -> Result<Self> {
Ok(SelfValue { span: parsing::keyword(input, "self")? })
}
}
impl Token for SelfValue {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("self") }
fn display() -> &'static str { "`self`" }
}
impl private::Sealed for SelfValue { }
#[doc = "`static`"]
pub struct Static {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Static<S: IntoSpans<Span>>(span: S) -> Static {
Static { span: span.into_spans() }
}
impl core::default::Default for Static {
fn default() -> Self { Static { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Static { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Static {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Static {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "static")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Static { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Static {
fn eq(&self, _other: &Static) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Static {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Static {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("static", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Static {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Static { span: parsing::keyword(input, "static")? })
}
}
impl Token for Static {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("static") }
fn display() -> &'static str { "`static`" }
}
impl private::Sealed for Static { }
#[doc = "`struct`"]
pub struct Struct {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Struct<S: IntoSpans<Span>>(span: S) -> Struct {
Struct { span: span.into_spans() }
}
impl core::default::Default for Struct {
fn default() -> Self { Struct { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Struct { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Struct {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Struct {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "struct")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Struct { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Struct {
fn eq(&self, _other: &Struct) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Struct {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Struct {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("struct", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Struct {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Struct { span: parsing::keyword(input, "struct")? })
}
}
impl Token for Struct {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("struct") }
fn display() -> &'static str { "`struct`" }
}
impl private::Sealed for Struct { }
#[doc = "`super`"]
pub struct Super {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Super<S: IntoSpans<Span>>(span: S) -> Super {
Super { span: span.into_spans() }
}
impl core::default::Default for Super {
fn default() -> Self { Super { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Super { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Super {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Super {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "super")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Super { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Super {
fn eq(&self, _other: &Super) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Super {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Super {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("super", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Super {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Super { span: parsing::keyword(input, "super")? })
}
}
impl Token for Super {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("super") }
fn display() -> &'static str { "`super`" }
}
impl private::Sealed for Super { }
#[doc = "`trait`"]
pub struct Trait {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Trait<S: IntoSpans<Span>>(span: S) -> Trait {
Trait { span: span.into_spans() }
}
impl core::default::Default for Trait {
fn default() -> Self { Trait { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Trait { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Trait {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Trait {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "trait")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Trait { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Trait {
fn eq(&self, _other: &Trait) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Trait {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Trait {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("trait", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Trait {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Trait { span: parsing::keyword(input, "trait")? })
}
}
impl Token for Trait {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("trait") }
fn display() -> &'static str { "`trait`" }
}
impl private::Sealed for Trait { }
#[doc = "`try`"]
pub struct Try {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Try<S: IntoSpans<Span>>(span: S) -> Try {
Try { span: span.into_spans() }
}
impl core::default::Default for Try {
fn default() -> Self { Try { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Try { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Try {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Try {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "try")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Try { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Try {
fn eq(&self, _other: &Try) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Try {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Try {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("try", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Try {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Try { span: parsing::keyword(input, "try")? })
}
}
impl Token for Try {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("try") }
fn display() -> &'static str { "`try`" }
}
impl private::Sealed for Try { }
#[doc = "`type`"]
pub struct Type {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Type<S: IntoSpans<Span>>(span: S) -> Type {
Type { span: span.into_spans() }
}
impl core::default::Default for Type {
fn default() -> Self { Type { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Type { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Type {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Type {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "type")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Type { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Type {
fn eq(&self, _other: &Type) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Type {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Type {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("type", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Type {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Type { span: parsing::keyword(input, "type")? })
}
}
impl Token for Type {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("type") }
fn display() -> &'static str { "`type`" }
}
impl private::Sealed for Type { }
#[doc = "`typeof`"]
pub struct Typeof {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Typeof<S: IntoSpans<Span>>(span: S) -> Typeof {
Typeof { span: span.into_spans() }
}
impl core::default::Default for Typeof {
fn default() -> Self { Typeof { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Typeof { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Typeof {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Typeof {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "typeof")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Typeof { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Typeof {
fn eq(&self, _other: &Typeof) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Typeof {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Typeof {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("typeof", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Typeof {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Typeof { span: parsing::keyword(input, "typeof")? })
}
}
impl Token for Typeof {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("typeof") }
fn display() -> &'static str { "`typeof`" }
}
impl private::Sealed for Typeof { }
#[doc = "`union`"]
pub struct Union {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Union<S: IntoSpans<Span>>(span: S) -> Union {
Union { span: span.into_spans() }
}
impl core::default::Default for Union {
fn default() -> Self { Union { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Union { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Union {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Union {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "union")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Union { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Union {
fn eq(&self, _other: &Union) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Union {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Union {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("union", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Union {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Union { span: parsing::keyword(input, "union")? })
}
}
impl Token for Union {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("union") }
fn display() -> &'static str { "`union`" }
}
impl private::Sealed for Union { }
#[doc = "`unsafe`"]
pub struct Unsafe {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Unsafe<S: IntoSpans<Span>>(span: S) -> Unsafe {
Unsafe { span: span.into_spans() }
}
impl core::default::Default for Unsafe {
fn default() -> Self { Unsafe { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Unsafe { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Unsafe {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Unsafe {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "unsafe")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Unsafe { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Unsafe {
fn eq(&self, _other: &Unsafe) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Unsafe {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Unsafe {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("unsafe", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Unsafe {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Unsafe { span: parsing::keyword(input, "unsafe")? })
}
}
impl Token for Unsafe {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("unsafe") }
fn display() -> &'static str { "`unsafe`" }
}
impl private::Sealed for Unsafe { }
#[doc = "`unsized`"]
pub struct Unsized {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Unsized<S: IntoSpans<Span>>(span: S) -> Unsized {
Unsized { span: span.into_spans() }
}
impl core::default::Default for Unsized {
fn default() -> Self { Unsized { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Unsized { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Unsized {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Unsized {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "unsized")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Unsized { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Unsized {
fn eq(&self, _other: &Unsized) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Unsized {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Unsized {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("unsized", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Unsized {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Unsized { span: parsing::keyword(input, "unsized")? })
}
}
impl Token for Unsized {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("unsized") }
fn display() -> &'static str { "`unsized`" }
}
impl private::Sealed for Unsized { }
#[doc = "`use`"]
pub struct Use {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Use<S: IntoSpans<Span>>(span: S) -> Use {
Use { span: span.into_spans() }
}
impl core::default::Default for Use {
fn default() -> Self { Use { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Use { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Use {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Use {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "use")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Use { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Use {
fn eq(&self, _other: &Use) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Use {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Use {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("use", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Use {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Use { span: parsing::keyword(input, "use")? })
}
}
impl Token for Use {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("use") }
fn display() -> &'static str { "`use`" }
}
impl private::Sealed for Use { }
#[doc = "`virtual`"]
pub struct Virtual {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Virtual<S: IntoSpans<Span>>(span: S) -> Virtual {
Virtual { span: span.into_spans() }
}
impl core::default::Default for Virtual {
fn default() -> Self { Virtual { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Virtual { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Virtual {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Virtual {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "virtual")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Virtual { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Virtual {
fn eq(&self, _other: &Virtual) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Virtual {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Virtual {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("virtual", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Virtual {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Virtual { span: parsing::keyword(input, "virtual")? })
}
}
impl Token for Virtual {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("virtual") }
fn display() -> &'static str { "`virtual`" }
}
impl private::Sealed for Virtual { }
#[doc = "`where`"]
pub struct Where {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Where<S: IntoSpans<Span>>(span: S) -> Where {
Where { span: span.into_spans() }
}
impl core::default::Default for Where {
fn default() -> Self { Where { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Where { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Where {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Where {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "where")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Where { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Where {
fn eq(&self, _other: &Where) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Where {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Where {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("where", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Where {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Where { span: parsing::keyword(input, "where")? })
}
}
impl Token for Where {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("where") }
fn display() -> &'static str { "`where`" }
}
impl private::Sealed for Where { }
#[doc = "`while`"]
pub struct While {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn While<S: IntoSpans<Span>>(span: S) -> While {
While { span: span.into_spans() }
}
impl core::default::Default for While {
fn default() -> Self { While { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for While { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for While {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for While {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "while")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for While { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for While {
fn eq(&self, _other: &While) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for While {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for While {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("while", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for While {
fn parse(input: ParseStream) -> Result<Self> {
Ok(While { span: parsing::keyword(input, "while")? })
}
}
impl Token for While {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("while") }
fn display() -> &'static str { "`while`" }
}
impl private::Sealed for While { }
#[doc = "`yield`"]
pub struct Yield {
pub span: Span,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Yield<S: IntoSpans<Span>>(span: S) -> Yield {
Yield { span: span.into_spans() }
}
impl core::default::Default for Yield {
fn default() -> Self { Yield { span: Span::call_site() } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Yield { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Yield {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Yield {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "yield")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Yield { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Yield {
fn eq(&self, _other: &Yield) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Yield {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Yield {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::keyword("yield", self.span, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Yield {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Yield { span: parsing::keyword(input, "yield")? })
}
}
impl Token for Yield {
fn peek(cursor: Cursor) -> bool { cursor.peek_keyword("yield") }
fn display() -> &'static str { "`yield`" }
}
impl private::Sealed for Yield { }define_keywords! {
703 "abstract" pub struct Abstract
704 "as" pub struct As
705 "async" pub struct Async
706 "auto" pub struct Auto
707 "await" pub struct Await
708 "become" pub struct Become
709 "box" pub struct Box
710 "break" pub struct Break
711 "const" pub struct Const
712 "continue" pub struct Continue
713 "crate" pub struct Crate
714 "default" pub struct Default
715 "do" pub struct Do
716 "dyn" pub struct Dyn
717 "else" pub struct Else
718 "enum" pub struct Enum
719 "extern" pub struct Extern
720 "final" pub struct Final
721 "fn" pub struct Fn
722 "for" pub struct For
723 "if" pub struct If
724 "impl" pub struct Impl
725 "in" pub struct In
726 "let" pub struct Let
727 "loop" pub struct Loop
728 "macro" pub struct Macro
729 "match" pub struct Match
730 "mod" pub struct Mod
731 "move" pub struct Move
732 "mut" pub struct Mut
733 "override" pub struct Override
734 "priv" pub struct Priv
735 "pub" pub struct Pub
736 "raw" pub struct Raw
737 "ref" pub struct Ref
738 "return" pub struct Return
739 "safe" pub struct Safe
740 "Self" pub struct SelfType
741 "self" pub struct SelfValue
742 "static" pub struct Static
743 "struct" pub struct Struct
744 "super" pub struct Super
745 "trait" pub struct Trait
746 "try" pub struct Try
747 "type" pub struct Type
748 "typeof" pub struct Typeof
749 "union" pub struct Union
750 "unsafe" pub struct Unsafe
751 "unsized" pub struct Unsized
752 "use" pub struct Use
753 "virtual" pub struct Virtual
754 "where" pub struct Where
755 "while" pub struct While
756 "yield" pub struct Yield
757}
758
759#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`&`"]
#[doc = " bitwise and logical AND, borrow, references, reference patterns."]
pub struct And {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn And<S: IntoSpans<[Span; 1]>>(spans: S) -> And {
And { spans: spans.into_spans() }
}
impl core::default::Default for And {
fn default() -> Self { And { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for And { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for And {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for And {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "&")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for And { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for And {
fn eq(&self, _other: &And) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for And {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for And {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for And {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for And {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("&", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for And {
fn parse(input: ParseStream) -> Result<Self> {
Ok(And { spans: parsing::punct(input, "&")? })
}
}
impl Token for And {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("&") }
fn display() -> &'static str { "`&`" }
}
impl private::Sealed for And { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`&&`"]
#[doc = " lazy AND, borrow, references, reference patterns."]
pub struct AndAnd {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn AndAnd<S: IntoSpans<[Span; 2]>>(spans: S) -> AndAnd {
AndAnd { spans: spans.into_spans() }
}
impl core::default::Default for AndAnd {
fn default() -> Self { AndAnd { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for AndAnd { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for AndAnd {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for AndAnd {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "&&")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for AndAnd { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for AndAnd {
fn eq(&self, _other: &AndAnd) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for AndAnd {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for AndAnd {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("&&", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for AndAnd {
fn parse(input: ParseStream) -> Result<Self> {
Ok(AndAnd { spans: parsing::punct(input, "&&")? })
}
}
impl Token for AndAnd {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("&&") }
fn display() -> &'static str { "`&&`" }
}
impl private::Sealed for AndAnd { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`&=`"]
#[doc = " bitwise AND assignment."]
pub struct AndEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn AndEq<S: IntoSpans<[Span; 2]>>(spans: S) -> AndEq {
AndEq { spans: spans.into_spans() }
}
impl core::default::Default for AndEq {
fn default() -> Self { AndEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for AndEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for AndEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for AndEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "&=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for AndEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for AndEq {
fn eq(&self, _other: &AndEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for AndEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for AndEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("&=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for AndEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(AndEq { spans: parsing::punct(input, "&=")? })
}
}
impl Token for AndEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("&=") }
fn display() -> &'static str { "`&=`" }
}
impl private::Sealed for AndEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`@`"]
#[doc = " subpattern binding."]
pub struct At {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn At<S: IntoSpans<[Span; 1]>>(spans: S) -> At {
At { spans: spans.into_spans() }
}
impl core::default::Default for At {
fn default() -> Self { At { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for At { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for At {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for At {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "@")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for At { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for At {
fn eq(&self, _other: &At) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for At {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for At {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for At {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for At {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("@", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for At {
fn parse(input: ParseStream) -> Result<Self> {
Ok(At { spans: parsing::punct(input, "@")? })
}
}
impl Token for At {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("@") }
fn display() -> &'static str { "`@`" }
}
impl private::Sealed for At { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`^`"]
#[doc = " bitwise and logical XOR."]
pub struct Caret {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Caret<S: IntoSpans<[Span; 1]>>(spans: S) -> Caret {
Caret { spans: spans.into_spans() }
}
impl core::default::Default for Caret {
fn default() -> Self { Caret { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Caret { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Caret {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Caret {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "^")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Caret { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Caret {
fn eq(&self, _other: &Caret) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Caret {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Caret {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Caret {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Caret {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("^", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Caret {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Caret { spans: parsing::punct(input, "^")? })
}
}
impl Token for Caret {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("^") }
fn display() -> &'static str { "`^`" }
}
impl private::Sealed for Caret { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`^=`"]
#[doc = " bitwise XOR assignment."]
pub struct CaretEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn CaretEq<S: IntoSpans<[Span; 2]>>(spans: S) -> CaretEq {
CaretEq { spans: spans.into_spans() }
}
impl core::default::Default for CaretEq {
fn default() -> Self { CaretEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for CaretEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for CaretEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for CaretEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "^=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for CaretEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for CaretEq {
fn eq(&self, _other: &CaretEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for CaretEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for CaretEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("^=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for CaretEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(CaretEq { spans: parsing::punct(input, "^=")? })
}
}
impl Token for CaretEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("^=") }
fn display() -> &'static str { "`^=`" }
}
impl private::Sealed for CaretEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`:`"]
#[doc = " various separators."]
pub struct Colon {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Colon<S: IntoSpans<[Span; 1]>>(spans: S) -> Colon {
Colon { spans: spans.into_spans() }
}
impl core::default::Default for Colon {
fn default() -> Self { Colon { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Colon { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Colon {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Colon {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ":")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Colon { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Colon {
fn eq(&self, _other: &Colon) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Colon {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Colon {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Colon {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Colon {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(":", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Colon {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Colon { spans: parsing::punct(input, ":")? })
}
}
impl Token for Colon {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(":") }
fn display() -> &'static str { "`:`" }
}
impl private::Sealed for Colon { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`,`"]
#[doc = " various separators."]
pub struct Comma {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Comma<S: IntoSpans<[Span; 1]>>(spans: S) -> Comma {
Comma { spans: spans.into_spans() }
}
impl core::default::Default for Comma {
fn default() -> Self { Comma { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Comma { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Comma {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Comma {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ",")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Comma { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Comma {
fn eq(&self, _other: &Comma) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Comma {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Comma {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Comma {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Comma {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(",", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Comma {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Comma { spans: parsing::punct(input, ",")? })
}
}
impl Token for Comma {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(",") }
fn display() -> &'static str { "`,`" }
}
impl private::Sealed for Comma { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`$`"]
#[doc = " macros."]
pub struct Dollar {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Dollar<S: IntoSpans<[Span; 1]>>(spans: S) -> Dollar {
Dollar { spans: spans.into_spans() }
}
impl core::default::Default for Dollar {
fn default() -> Self { Dollar { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Dollar { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Dollar {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Dollar {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "$")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Dollar { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Dollar {
fn eq(&self, _other: &Dollar) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Dollar {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Dollar {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Dollar {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Dollar {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("$", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Dollar {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Dollar { spans: parsing::punct(input, "$")? })
}
}
impl Token for Dollar {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("$") }
fn display() -> &'static str { "`$`" }
}
impl private::Sealed for Dollar { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`.`"]
#[doc = " field access, tuple index."]
pub struct Dot {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Dot<S: IntoSpans<[Span; 1]>>(spans: S) -> Dot {
Dot { spans: spans.into_spans() }
}
impl core::default::Default for Dot {
fn default() -> Self { Dot { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Dot { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Dot {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Dot {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ".")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Dot { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Dot {
fn eq(&self, _other: &Dot) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Dot {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Dot {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Dot {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Dot {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(".", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Dot {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Dot { spans: parsing::punct(input, ".")? })
}
}
impl Token for Dot {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(".") }
fn display() -> &'static str { "`.`" }
}
impl private::Sealed for Dot { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`..`"]
#[doc = " range, struct expressions, patterns, range patterns."]
pub struct DotDot {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn DotDot<S: IntoSpans<[Span; 2]>>(spans: S) -> DotDot {
DotDot { spans: spans.into_spans() }
}
impl core::default::Default for DotDot {
fn default() -> Self { DotDot { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for DotDot { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for DotDot {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for DotDot {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "..")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for DotDot { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for DotDot {
fn eq(&self, _other: &DotDot) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for DotDot {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for DotDot {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("..", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for DotDot {
fn parse(input: ParseStream) -> Result<Self> {
Ok(DotDot { spans: parsing::punct(input, "..")? })
}
}
impl Token for DotDot {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("..") }
fn display() -> &'static str { "`..`" }
}
impl private::Sealed for DotDot { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`...`"]
#[doc = " variadic functions, range patterns."]
pub struct DotDotDot {
pub spans: [Span; 3],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn DotDotDot<S: IntoSpans<[Span; 3]>>(spans: S) -> DotDotDot {
DotDotDot { spans: spans.into_spans() }
}
impl core::default::Default for DotDotDot {
fn default() -> Self { DotDotDot { spans: [Span::call_site(); 3] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for DotDotDot { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for DotDotDot {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for DotDotDot {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "...")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for DotDotDot { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for DotDotDot {
fn eq(&self, _other: &DotDotDot) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for DotDotDot {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for DotDotDot {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("...", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for DotDotDot {
fn parse(input: ParseStream) -> Result<Self> {
Ok(DotDotDot { spans: parsing::punct(input, "...")? })
}
}
impl Token for DotDotDot {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("...") }
fn display() -> &'static str { "`...`" }
}
impl private::Sealed for DotDotDot { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`..=`"]
#[doc = " inclusive range, range patterns."]
pub struct DotDotEq {
pub spans: [Span; 3],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn DotDotEq<S: IntoSpans<[Span; 3]>>(spans: S) -> DotDotEq {
DotDotEq { spans: spans.into_spans() }
}
impl core::default::Default for DotDotEq {
fn default() -> Self { DotDotEq { spans: [Span::call_site(); 3] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for DotDotEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for DotDotEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for DotDotEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "..=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for DotDotEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for DotDotEq {
fn eq(&self, _other: &DotDotEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for DotDotEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for DotDotEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("..=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for DotDotEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(DotDotEq { spans: parsing::punct(input, "..=")? })
}
}
impl Token for DotDotEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("..=") }
fn display() -> &'static str { "`..=`" }
}
impl private::Sealed for DotDotEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`=`"]
#[doc = " assignment, attributes, various type definitions."]
pub struct Eq {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Eq<S: IntoSpans<[Span; 1]>>(spans: S) -> Eq {
Eq { spans: spans.into_spans() }
}
impl core::default::Default for Eq {
fn default() -> Self { Eq { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Eq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Eq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Eq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Eq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Eq {
fn eq(&self, _other: &Eq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Eq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Eq {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Eq {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Eq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Eq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Eq { spans: parsing::punct(input, "=")? })
}
}
impl Token for Eq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("=") }
fn display() -> &'static str { "`=`" }
}
impl private::Sealed for Eq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`==`"]
#[doc = " equal."]
pub struct EqEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn EqEq<S: IntoSpans<[Span; 2]>>(spans: S) -> EqEq {
EqEq { spans: spans.into_spans() }
}
impl core::default::Default for EqEq {
fn default() -> Self { EqEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for EqEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for EqEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for EqEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "==")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for EqEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for EqEq {
fn eq(&self, _other: &EqEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for EqEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for EqEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("==", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for EqEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(EqEq { spans: parsing::punct(input, "==")? })
}
}
impl Token for EqEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("==") }
fn display() -> &'static str { "`==`" }
}
impl private::Sealed for EqEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`=>`"]
#[doc = " match arms, macros."]
pub struct FatArrow {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn FatArrow<S: IntoSpans<[Span; 2]>>(spans: S) -> FatArrow {
FatArrow { spans: spans.into_spans() }
}
impl core::default::Default for FatArrow {
fn default() -> Self { FatArrow { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for FatArrow { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for FatArrow {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for FatArrow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "=>")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for FatArrow { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for FatArrow {
fn eq(&self, _other: &FatArrow) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for FatArrow {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for FatArrow {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("=>", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for FatArrow {
fn parse(input: ParseStream) -> Result<Self> {
Ok(FatArrow { spans: parsing::punct(input, "=>")? })
}
}
impl Token for FatArrow {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("=>") }
fn display() -> &'static str { "`=>`" }
}
impl private::Sealed for FatArrow { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`>=`"]
#[doc = " greater than or equal to, generics."]
pub struct Ge {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Ge<S: IntoSpans<[Span; 2]>>(spans: S) -> Ge {
Ge { spans: spans.into_spans() }
}
impl core::default::Default for Ge {
fn default() -> Self { Ge { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Ge { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Ge {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Ge {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ">=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Ge { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Ge {
fn eq(&self, _other: &Ge) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Ge {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Ge {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(">=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Ge {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Ge { spans: parsing::punct(input, ">=")? })
}
}
impl Token for Ge {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(">=") }
fn display() -> &'static str { "`>=`" }
}
impl private::Sealed for Ge { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`>`"]
#[doc = " greater than, generics, paths."]
pub struct Gt {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Gt<S: IntoSpans<[Span; 1]>>(spans: S) -> Gt {
Gt { spans: spans.into_spans() }
}
impl core::default::Default for Gt {
fn default() -> Self { Gt { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Gt { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Gt {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Gt {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ">")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Gt { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Gt {
fn eq(&self, _other: &Gt) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Gt {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Gt {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Gt {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Gt {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(">", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Gt {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Gt { spans: parsing::punct(input, ">")? })
}
}
impl Token for Gt {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(">") }
fn display() -> &'static str { "`>`" }
}
impl private::Sealed for Gt { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`<-`"]
#[doc = " unused."]
pub struct LArrow {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn LArrow<S: IntoSpans<[Span; 2]>>(spans: S) -> LArrow {
LArrow { spans: spans.into_spans() }
}
impl core::default::Default for LArrow {
fn default() -> Self { LArrow { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for LArrow { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for LArrow {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for LArrow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "<-")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for LArrow { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for LArrow {
fn eq(&self, _other: &LArrow) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for LArrow {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for LArrow {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("<-", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for LArrow {
fn parse(input: ParseStream) -> Result<Self> {
Ok(LArrow { spans: parsing::punct(input, "<-")? })
}
}
impl Token for LArrow {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("<-") }
fn display() -> &'static str { "`<-`" }
}
impl private::Sealed for LArrow { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`<=`"]
#[doc = " less than or equal to."]
pub struct Le {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Le<S: IntoSpans<[Span; 2]>>(spans: S) -> Le {
Le { spans: spans.into_spans() }
}
impl core::default::Default for Le {
fn default() -> Self { Le { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Le { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Le {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Le {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "<=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Le { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Le {
fn eq(&self, _other: &Le) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Le {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Le {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("<=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Le {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Le { spans: parsing::punct(input, "<=")? })
}
}
impl Token for Le {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("<=") }
fn display() -> &'static str { "`<=`" }
}
impl private::Sealed for Le { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`<`"]
#[doc = " less than, generics, paths."]
pub struct Lt {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Lt<S: IntoSpans<[Span; 1]>>(spans: S) -> Lt {
Lt { spans: spans.into_spans() }
}
impl core::default::Default for Lt {
fn default() -> Self { Lt { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Lt { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Lt {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Lt {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "<")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Lt { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Lt {
fn eq(&self, _other: &Lt) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Lt {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Lt {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Lt {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Lt {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("<", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Lt {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Lt { spans: parsing::punct(input, "<")? })
}
}
impl Token for Lt {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("<") }
fn display() -> &'static str { "`<`" }
}
impl private::Sealed for Lt { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`-`"]
#[doc = " subtraction, negation."]
pub struct Minus {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Minus<S: IntoSpans<[Span; 1]>>(spans: S) -> Minus {
Minus { spans: spans.into_spans() }
}
impl core::default::Default for Minus {
fn default() -> Self { Minus { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Minus { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Minus {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Minus {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "-")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Minus { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Minus {
fn eq(&self, _other: &Minus) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Minus {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Minus {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Minus {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Minus {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("-", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Minus {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Minus { spans: parsing::punct(input, "-")? })
}
}
impl Token for Minus {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("-") }
fn display() -> &'static str { "`-`" }
}
impl private::Sealed for Minus { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`-=`"]
#[doc = " subtraction assignment."]
pub struct MinusEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn MinusEq<S: IntoSpans<[Span; 2]>>(spans: S) -> MinusEq {
MinusEq { spans: spans.into_spans() }
}
impl core::default::Default for MinusEq {
fn default() -> Self { MinusEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for MinusEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for MinusEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for MinusEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "-=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for MinusEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for MinusEq {
fn eq(&self, _other: &MinusEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for MinusEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for MinusEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("-=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for MinusEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(MinusEq { spans: parsing::punct(input, "-=")? })
}
}
impl Token for MinusEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("-=") }
fn display() -> &'static str { "`-=`" }
}
impl private::Sealed for MinusEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`!=`"]
#[doc = " not equal."]
pub struct Ne {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Ne<S: IntoSpans<[Span; 2]>>(spans: S) -> Ne {
Ne { spans: spans.into_spans() }
}
impl core::default::Default for Ne {
fn default() -> Self { Ne { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Ne { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Ne {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Ne {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "!=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Ne { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Ne {
fn eq(&self, _other: &Ne) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Ne {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Ne {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("!=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Ne {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Ne { spans: parsing::punct(input, "!=")? })
}
}
impl Token for Ne {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("!=") }
fn display() -> &'static str { "`!=`" }
}
impl private::Sealed for Ne { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`!`"]
#[doc =
" bitwise and logical NOT, macro calls, inner attributes, never type, negative impls."]
pub struct Not {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Not<S: IntoSpans<[Span; 1]>>(spans: S) -> Not {
Not { spans: spans.into_spans() }
}
impl core::default::Default for Not {
fn default() -> Self { Not { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Not { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Not {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Not {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "!")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Not { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Not {
fn eq(&self, _other: &Not) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Not {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Not {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Not {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Not {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("!", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Not {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Not { spans: parsing::punct(input, "!")? })
}
}
impl Token for Not {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("!") }
fn display() -> &'static str { "`!`" }
}
impl private::Sealed for Not { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`|`"]
#[doc =
" bitwise and logical OR, closures, patterns in match, if let, and while let."]
pub struct Or {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Or<S: IntoSpans<[Span; 1]>>(spans: S) -> Or {
Or { spans: spans.into_spans() }
}
impl core::default::Default for Or {
fn default() -> Self { Or { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Or { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Or {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Or {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "|")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Or { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Or {
fn eq(&self, _other: &Or) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Or {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Or {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Or {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Or {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("|", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Or {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Or { spans: parsing::punct(input, "|")? })
}
}
impl Token for Or {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("|") }
fn display() -> &'static str { "`|`" }
}
impl private::Sealed for Or { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`|=`"]
#[doc = " bitwise OR assignment."]
pub struct OrEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn OrEq<S: IntoSpans<[Span; 2]>>(spans: S) -> OrEq {
OrEq { spans: spans.into_spans() }
}
impl core::default::Default for OrEq {
fn default() -> Self { OrEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for OrEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for OrEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for OrEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "|=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for OrEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for OrEq {
fn eq(&self, _other: &OrEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for OrEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for OrEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("|=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for OrEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(OrEq { spans: parsing::punct(input, "|=")? })
}
}
impl Token for OrEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("|=") }
fn display() -> &'static str { "`|=`" }
}
impl private::Sealed for OrEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`||`"]
#[doc = " lazy OR, closures."]
pub struct OrOr {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn OrOr<S: IntoSpans<[Span; 2]>>(spans: S) -> OrOr {
OrOr { spans: spans.into_spans() }
}
impl core::default::Default for OrOr {
fn default() -> Self { OrOr { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for OrOr { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for OrOr {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for OrOr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "||")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for OrOr { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for OrOr {
fn eq(&self, _other: &OrOr) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for OrOr {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for OrOr {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("||", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for OrOr {
fn parse(input: ParseStream) -> Result<Self> {
Ok(OrOr { spans: parsing::punct(input, "||")? })
}
}
impl Token for OrOr {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("||") }
fn display() -> &'static str { "`||`" }
}
impl private::Sealed for OrOr { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`::`"]
#[doc = " path separator."]
pub struct PathSep {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn PathSep<S: IntoSpans<[Span; 2]>>(spans: S) -> PathSep {
PathSep { spans: spans.into_spans() }
}
impl core::default::Default for PathSep {
fn default() -> Self { PathSep { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for PathSep { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for PathSep {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for PathSep {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "::")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for PathSep { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for PathSep {
fn eq(&self, _other: &PathSep) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for PathSep {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for PathSep {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("::", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for PathSep {
fn parse(input: ParseStream) -> Result<Self> {
Ok(PathSep { spans: parsing::punct(input, "::")? })
}
}
impl Token for PathSep {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("::") }
fn display() -> &'static str { "`::`" }
}
impl private::Sealed for PathSep { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`%`"]
#[doc = " remainder."]
pub struct Percent {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Percent<S: IntoSpans<[Span; 1]>>(spans: S) -> Percent {
Percent { spans: spans.into_spans() }
}
impl core::default::Default for Percent {
fn default() -> Self { Percent { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Percent { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Percent {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Percent {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "%")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Percent { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Percent {
fn eq(&self, _other: &Percent) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Percent {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Percent {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Percent {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Percent {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("%", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Percent {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Percent { spans: parsing::punct(input, "%")? })
}
}
impl Token for Percent {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("%") }
fn display() -> &'static str { "`%`" }
}
impl private::Sealed for Percent { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`%=`"]
#[doc = " remainder assignment."]
pub struct PercentEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn PercentEq<S: IntoSpans<[Span; 2]>>(spans: S) -> PercentEq {
PercentEq { spans: spans.into_spans() }
}
impl core::default::Default for PercentEq {
fn default() -> Self { PercentEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for PercentEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for PercentEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for PercentEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "%=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for PercentEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for PercentEq {
fn eq(&self, _other: &PercentEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for PercentEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for PercentEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("%=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for PercentEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(PercentEq { spans: parsing::punct(input, "%=")? })
}
}
impl Token for PercentEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("%=") }
fn display() -> &'static str { "`%=`" }
}
impl private::Sealed for PercentEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`+`"]
#[doc = " addition, trait bounds, macro Kleene matcher."]
pub struct Plus {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Plus<S: IntoSpans<[Span; 1]>>(spans: S) -> Plus {
Plus { spans: spans.into_spans() }
}
impl core::default::Default for Plus {
fn default() -> Self { Plus { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Plus { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Plus {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Plus {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "+")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Plus { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Plus {
fn eq(&self, _other: &Plus) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Plus {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Plus {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Plus {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Plus {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("+", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Plus {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Plus { spans: parsing::punct(input, "+")? })
}
}
impl Token for Plus {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("+") }
fn display() -> &'static str { "`+`" }
}
impl private::Sealed for Plus { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`+=`"]
#[doc = " addition assignment."]
pub struct PlusEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn PlusEq<S: IntoSpans<[Span; 2]>>(spans: S) -> PlusEq {
PlusEq { spans: spans.into_spans() }
}
impl core::default::Default for PlusEq {
fn default() -> Self { PlusEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for PlusEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for PlusEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for PlusEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "+=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for PlusEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for PlusEq {
fn eq(&self, _other: &PlusEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for PlusEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for PlusEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("+=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for PlusEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(PlusEq { spans: parsing::punct(input, "+=")? })
}
}
impl Token for PlusEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("+=") }
fn display() -> &'static str { "`+=`" }
}
impl private::Sealed for PlusEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`#`"]
#[doc = " attributes."]
pub struct Pound {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Pound<S: IntoSpans<[Span; 1]>>(spans: S) -> Pound {
Pound { spans: spans.into_spans() }
}
impl core::default::Default for Pound {
fn default() -> Self { Pound { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Pound { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Pound {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Pound {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "#")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Pound { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Pound {
fn eq(&self, _other: &Pound) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Pound {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Pound {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Pound {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Pound {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("#", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Pound {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Pound { spans: parsing::punct(input, "#")? })
}
}
impl Token for Pound {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("#") }
fn display() -> &'static str { "`#`" }
}
impl private::Sealed for Pound { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`?`"]
#[doc = " question mark operator, questionably sized, macro Kleene matcher."]
pub struct Question {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Question<S: IntoSpans<[Span; 1]>>(spans: S) -> Question {
Question { spans: spans.into_spans() }
}
impl core::default::Default for Question {
fn default() -> Self { Question { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Question { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Question {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Question {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "?")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Question { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Question {
fn eq(&self, _other: &Question) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Question {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Question {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Question {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Question {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("?", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Question {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Question { spans: parsing::punct(input, "?")? })
}
}
impl Token for Question {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("?") }
fn display() -> &'static str { "`?`" }
}
impl private::Sealed for Question { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`->`"]
#[doc = " function return type, closure return type, function pointer type."]
pub struct RArrow {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn RArrow<S: IntoSpans<[Span; 2]>>(spans: S) -> RArrow {
RArrow { spans: spans.into_spans() }
}
impl core::default::Default for RArrow {
fn default() -> Self { RArrow { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for RArrow { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for RArrow {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for RArrow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "->")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for RArrow { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for RArrow {
fn eq(&self, _other: &RArrow) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for RArrow {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for RArrow {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("->", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for RArrow {
fn parse(input: ParseStream) -> Result<Self> {
Ok(RArrow { spans: parsing::punct(input, "->")? })
}
}
impl Token for RArrow {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("->") }
fn display() -> &'static str { "`->`" }
}
impl private::Sealed for RArrow { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`;`"]
#[doc = " terminator for various items and statements, array types."]
pub struct Semi {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Semi<S: IntoSpans<[Span; 1]>>(spans: S) -> Semi {
Semi { spans: spans.into_spans() }
}
impl core::default::Default for Semi {
fn default() -> Self { Semi { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Semi { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Semi {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Semi {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ";")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Semi { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Semi {
fn eq(&self, _other: &Semi) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Semi {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Semi {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Semi {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Semi {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(";", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Semi {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Semi { spans: parsing::punct(input, ";")? })
}
}
impl Token for Semi {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(";") }
fn display() -> &'static str { "`;`" }
}
impl private::Sealed for Semi { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`<<`"]
#[doc = " shift left, nested generics."]
pub struct Shl {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Shl<S: IntoSpans<[Span; 2]>>(spans: S) -> Shl {
Shl { spans: spans.into_spans() }
}
impl core::default::Default for Shl {
fn default() -> Self { Shl { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Shl { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Shl {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Shl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "<<")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Shl { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Shl {
fn eq(&self, _other: &Shl) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Shl {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Shl {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("<<", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Shl {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Shl { spans: parsing::punct(input, "<<")? })
}
}
impl Token for Shl {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("<<") }
fn display() -> &'static str { "`<<`" }
}
impl private::Sealed for Shl { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`<<=`"]
#[doc = " shift left assignment."]
pub struct ShlEq {
pub spans: [Span; 3],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn ShlEq<S: IntoSpans<[Span; 3]>>(spans: S) -> ShlEq {
ShlEq { spans: spans.into_spans() }
}
impl core::default::Default for ShlEq {
fn default() -> Self { ShlEq { spans: [Span::call_site(); 3] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for ShlEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for ShlEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for ShlEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "<<=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for ShlEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for ShlEq {
fn eq(&self, _other: &ShlEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for ShlEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for ShlEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("<<=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for ShlEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(ShlEq { spans: parsing::punct(input, "<<=")? })
}
}
impl Token for ShlEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("<<=") }
fn display() -> &'static str { "`<<=`" }
}
impl private::Sealed for ShlEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`>>`"]
#[doc = " shift right, nested generics."]
pub struct Shr {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Shr<S: IntoSpans<[Span; 2]>>(spans: S) -> Shr {
Shr { spans: spans.into_spans() }
}
impl core::default::Default for Shr {
fn default() -> Self { Shr { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Shr { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Shr {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Shr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ">>")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Shr { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Shr {
fn eq(&self, _other: &Shr) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Shr {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Shr {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(">>", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Shr {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Shr { spans: parsing::punct(input, ">>")? })
}
}
impl Token for Shr {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(">>") }
fn display() -> &'static str { "`>>`" }
}
impl private::Sealed for Shr { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`>>=`"]
#[doc = " shift right assignment, nested generics."]
pub struct ShrEq {
pub spans: [Span; 3],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn ShrEq<S: IntoSpans<[Span; 3]>>(spans: S) -> ShrEq {
ShrEq { spans: spans.into_spans() }
}
impl core::default::Default for ShrEq {
fn default() -> Self { ShrEq { spans: [Span::call_site(); 3] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for ShrEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for ShrEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for ShrEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, ">>=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for ShrEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for ShrEq {
fn eq(&self, _other: &ShrEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for ShrEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for ShrEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct(">>=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for ShrEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(ShrEq { spans: parsing::punct(input, ">>=")? })
}
}
impl Token for ShrEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct(">>=") }
fn display() -> &'static str { "`>>=`" }
}
impl private::Sealed for ShrEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`/`"]
#[doc = " division."]
pub struct Slash {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Slash<S: IntoSpans<[Span; 1]>>(spans: S) -> Slash {
Slash { spans: spans.into_spans() }
}
impl core::default::Default for Slash {
fn default() -> Self { Slash { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Slash { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Slash {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Slash {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "/")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Slash { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Slash {
fn eq(&self, _other: &Slash) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Slash {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Slash {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Slash {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Slash {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("/", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Slash {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Slash { spans: parsing::punct(input, "/")? })
}
}
impl Token for Slash {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("/") }
fn display() -> &'static str { "`/`" }
}
impl private::Sealed for Slash { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`/=`"]
#[doc = " division assignment."]
pub struct SlashEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn SlashEq<S: IntoSpans<[Span; 2]>>(spans: S) -> SlashEq {
SlashEq { spans: spans.into_spans() }
}
impl core::default::Default for SlashEq {
fn default() -> Self { SlashEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for SlashEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for SlashEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for SlashEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "/=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for SlashEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for SlashEq {
fn eq(&self, _other: &SlashEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for SlashEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for SlashEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("/=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for SlashEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(SlashEq { spans: parsing::punct(input, "/=")? })
}
}
impl Token for SlashEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("/=") }
fn display() -> &'static str { "`/=`" }
}
impl private::Sealed for SlashEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`*`"]
#[doc =
" multiplication, dereference, raw pointers, macro Kleene matcher, use wildcards."]
pub struct Star {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Star<S: IntoSpans<[Span; 1]>>(spans: S) -> Star {
Star { spans: spans.into_spans() }
}
impl core::default::Default for Star {
fn default() -> Self { Star { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Star { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Star {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Star {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "*")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Star { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Star {
fn eq(&self, _other: &Star) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Star {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Star {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Star {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Star {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("*", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Star {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Star { spans: parsing::punct(input, "*")? })
}
}
impl Token for Star {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("*") }
fn display() -> &'static str { "`*`" }
}
impl private::Sealed for Star { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`*=`"]
#[doc = " multiplication assignment."]
pub struct StarEq {
pub spans: [Span; 2],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn StarEq<S: IntoSpans<[Span; 2]>>(spans: S) -> StarEq {
StarEq { spans: spans.into_spans() }
}
impl core::default::Default for StarEq {
fn default() -> Self { StarEq { spans: [Span::call_site(); 2] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for StarEq { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for StarEq {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for StarEq {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "*=")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for StarEq { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for StarEq {
fn eq(&self, _other: &StarEq) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for StarEq {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for StarEq {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("*=", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for StarEq {
fn parse(input: ParseStream) -> Result<Self> {
Ok(StarEq { spans: parsing::punct(input, "*=")? })
}
}
impl Token for StarEq {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("*=") }
fn display() -> &'static str { "`*=`" }
}
impl private::Sealed for StarEq { }
#[allow(unknown_lints, renamed_and_removed_lints,
repr_transparent_non_zst_fields,)]
#[doc = "`~`"]
#[doc = " unused since before Rust 1.0."]
pub struct Tilde {
pub spans: [Span; 1],
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Tilde<S: IntoSpans<[Span; 1]>>(spans: S) -> Tilde {
Tilde { spans: spans.into_spans() }
}
impl core::default::Default for Tilde {
fn default() -> Self { Tilde { spans: [Span::call_site(); 1] } }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Tilde { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Tilde {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Tilde {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
format_token(f, "~")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Tilde { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Tilde {
fn eq(&self, _other: &Tilde) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Tilde {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Deref for Tilde {
type Target = WithSpan;
fn deref(&self) -> &Self::Target {
unsafe { &*(self as *const Self).cast::<WithSpan>() }
}
}
impl DerefMut for Tilde {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
}
}
#[doc(cfg(feature = "printing"))]
impl ToTokens for Tilde {
fn to_tokens(&self, tokens: &mut TokenStream) {
printing::punct("~", &self.spans, tokens);
}
}
#[doc(cfg(feature = "parsing"))]
impl Parse for Tilde {
fn parse(input: ParseStream) -> Result<Self> {
Ok(Tilde { spans: parsing::punct(input, "~")? })
}
}
impl Token for Tilde {
fn peek(cursor: Cursor) -> bool { cursor.peek_punct("~") }
fn display() -> &'static str { "`~`" }
}
impl private::Sealed for Tilde { }define_punctuation! {
760 "&" pub struct And/1 "&&" pub struct AndAnd/2 "&=" pub struct AndEq/2 "@" pub struct At/1 "^" pub struct Caret/1 "^=" pub struct CaretEq/2 ":" pub struct Colon/1 "," pub struct Comma/1 "$" pub struct Dollar/1 "." pub struct Dot/1 ".." pub struct DotDot/2 "..." pub struct DotDotDot/3 "..=" pub struct DotDotEq/3 "=" pub struct Eq/1 "==" pub struct EqEq/2 "=>" pub struct FatArrow/2 ">=" pub struct Ge/2 ">" pub struct Gt/1 "<-" pub struct LArrow/2 "<=" pub struct Le/2 "<" pub struct Lt/1 "-" pub struct Minus/1 "-=" pub struct MinusEq/2 "!=" pub struct Ne/2 "!" pub struct Not/1 "|" pub struct Or/1 "|=" pub struct OrEq/2 "||" pub struct OrOr/2 "::" pub struct PathSep/2 "%" pub struct Percent/1 "%=" pub struct PercentEq/2 "+" pub struct Plus/1 "+=" pub struct PlusEq/2 "#" pub struct Pound/1 "?" pub struct Question/1 "->" pub struct RArrow/2 ";" pub struct Semi/1 "<<" pub struct Shl/2 "<<=" pub struct ShlEq/3 ">>" pub struct Shr/2 ">>=" pub struct ShrEq/3 "/" pub struct Slash/1 "/=" pub struct SlashEq/2 "*" pub struct Star/1 "*=" pub struct StarEq/2 "~" pub struct Tilde/1 }
807
808#[doc = r" `{`…`}`"]
pub struct Brace {
pub span: DelimSpan,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Brace<S: IntoSpans<DelimSpan>>(span: S) -> Brace {
Brace { span: span.into_spans() }
}
impl core::default::Default for Brace {
fn default() -> Self { Brace(Span::call_site()) }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Brace { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Brace {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Brace {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Brace")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Brace { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Brace {
fn eq(&self, _other: &Brace) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Brace {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Brace {
#[doc(cfg(feature = "printing"))]
pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
F: FnOnce(&mut TokenStream) {
let mut inner = TokenStream::new();
f(&mut inner);
printing::delim(Delimiter::Brace, self.span.join(), tokens, inner);
}
}
impl private::Sealed for Brace { }
#[doc = r" `[`…`]`"]
pub struct Bracket {
pub span: DelimSpan,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Bracket<S: IntoSpans<DelimSpan>>(span: S) -> Bracket {
Bracket { span: span.into_spans() }
}
impl core::default::Default for Bracket {
fn default() -> Self { Bracket(Span::call_site()) }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Bracket { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Bracket {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Bracket {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Bracket")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Bracket { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Bracket {
fn eq(&self, _other: &Bracket) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Bracket {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Bracket {
#[doc(cfg(feature = "printing"))]
pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
F: FnOnce(&mut TokenStream) {
let mut inner = TokenStream::new();
f(&mut inner);
printing::delim(Delimiter::Bracket, self.span.join(), tokens, inner);
}
}
impl private::Sealed for Bracket { }
#[doc = r" `(`…`)`"]
pub struct Paren {
pub span: DelimSpan,
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Paren<S: IntoSpans<DelimSpan>>(span: S) -> Paren {
Paren { span: span.into_spans() }
}
impl core::default::Default for Paren {
fn default() -> Self { Paren(Span::call_site()) }
}
#[doc(cfg(feature = "clone-impls"))]
impl Copy for Paren { }
#[doc(cfg(feature = "clone-impls"))]
impl Clone for Paren {
fn clone(&self) -> Self { *self }
}
#[doc(cfg(feature = "extra-traits"))]
impl Debug for Paren {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Paren")
}
}
#[doc(cfg(feature = "extra-traits"))]
impl cmp::Eq for Paren { }
#[doc(cfg(feature = "extra-traits"))]
impl PartialEq for Paren {
fn eq(&self, _other: &Paren) -> bool { true }
}
#[doc(cfg(feature = "extra-traits"))]
impl Hash for Paren {
fn hash<H: Hasher>(&self, _state: &mut H) {}
}
impl Paren {
#[doc(cfg(feature = "printing"))]
pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
F: FnOnce(&mut TokenStream) {
let mut inner = TokenStream::new();
f(&mut inner);
printing::delim(Delimiter::Parenthesis, self.span.join(), tokens,
inner);
}
}
impl private::Sealed for Paren { }define_delimiters! {
809 Brace pub struct Brace Bracket pub struct Bracket Parenthesis pub struct Paren }
813
814#[macro_export]
882macro_rules! Token {
883 [abstract] => { $crate::token::Abstract };
884 [as] => { $crate::token::As };
885 [async] => { $crate::token::Async };
886 [auto] => { $crate::token::Auto };
887 [await] => { $crate::token::Await };
888 [become] => { $crate::token::Become };
889 [box] => { $crate::token::Box };
890 [break] => { $crate::token::Break };
891 [const] => { $crate::token::Const };
892 [continue] => { $crate::token::Continue };
893 [crate] => { $crate::token::Crate };
894 [default] => { $crate::token::Default };
895 [do] => { $crate::token::Do };
896 [dyn] => { $crate::token::Dyn };
897 [else] => { $crate::token::Else };
898 [enum] => { $crate::token::Enum };
899 [extern] => { $crate::token::Extern };
900 [final] => { $crate::token::Final };
901 [fn] => { $crate::token::Fn };
902 [for] => { $crate::token::For };
903 [if] => { $crate::token::If };
904 [impl] => { $crate::token::Impl };
905 [in] => { $crate::token::In };
906 [let] => { $crate::token::Let };
907 [loop] => { $crate::token::Loop };
908 [macro] => { $crate::token::Macro };
909 [match] => { $crate::token::Match };
910 [mod] => { $crate::token::Mod };
911 [move] => { $crate::token::Move };
912 [mut] => { $crate::token::Mut };
913 [override] => { $crate::token::Override };
914 [priv] => { $crate::token::Priv };
915 [pub] => { $crate::token::Pub };
916 [raw] => { $crate::token::Raw };
917 [ref] => { $crate::token::Ref };
918 [return] => { $crate::token::Return };
919 [safe] => { $crate::token::Safe };
920 [Self] => { $crate::token::SelfType };
921 [self] => { $crate::token::SelfValue };
922 [static] => { $crate::token::Static };
923 [struct] => { $crate::token::Struct };
924 [super] => { $crate::token::Super };
925 [trait] => { $crate::token::Trait };
926 [try] => { $crate::token::Try };
927 [type] => { $crate::token::Type };
928 [typeof] => { $crate::token::Typeof };
929 [union] => { $crate::token::Union };
930 [unsafe] => { $crate::token::Unsafe };
931 [unsized] => { $crate::token::Unsized };
932 [use] => { $crate::token::Use };
933 [virtual] => { $crate::token::Virtual };
934 [where] => { $crate::token::Where };
935 [while] => { $crate::token::While };
936 [yield] => { $crate::token::Yield };
937 [&] => { $crate::token::And };
938 [&&] => { $crate::token::AndAnd };
939 [&=] => { $crate::token::AndEq };
940 [@] => { $crate::token::At };
941 [^] => { $crate::token::Caret };
942 [^=] => { $crate::token::CaretEq };
943 [:] => { $crate::token::Colon };
944 [,] => { $crate::token::Comma };
945 [$] => { $crate::token::Dollar };
946 [.] => { $crate::token::Dot };
947 [..] => { $crate::token::DotDot };
948 [...] => { $crate::token::DotDotDot };
949 [..=] => { $crate::token::DotDotEq };
950 [=] => { $crate::token::Eq };
951 [==] => { $crate::token::EqEq };
952 [=>] => { $crate::token::FatArrow };
953 [>=] => { $crate::token::Ge };
954 [>] => { $crate::token::Gt };
955 [<-] => { $crate::token::LArrow };
956 [<=] => { $crate::token::Le };
957 [<] => { $crate::token::Lt };
958 [-] => { $crate::token::Minus };
959 [-=] => { $crate::token::MinusEq };
960 [!=] => { $crate::token::Ne };
961 [!] => { $crate::token::Not };
962 [|] => { $crate::token::Or };
963 [|=] => { $crate::token::OrEq };
964 [||] => { $crate::token::OrOr };
965 [::] => { $crate::token::PathSep };
966 [%] => { $crate::token::Percent };
967 [%=] => { $crate::token::PercentEq };
968 [+] => { $crate::token::Plus };
969 [+=] => { $crate::token::PlusEq };
970 [#] => { $crate::token::Pound };
971 [?] => { $crate::token::Question };
972 [->] => { $crate::token::RArrow };
973 [;] => { $crate::token::Semi };
974 [<<] => { $crate::token::Shl };
975 [<<=] => { $crate::token::ShlEq };
976 [>>] => { $crate::token::Shr };
977 [>>=] => { $crate::token::ShrEq };
978 [/] => { $crate::token::Slash };
979 [/=] => { $crate::token::SlashEq };
980 [*] => { $crate::token::Star };
981 [*=] => { $crate::token::StarEq };
982 [~] => { $crate::token::Tilde };
983 [_] => { $crate::token::Underscore };
984}
985
986#[cfg(feature = "extra-traits")]
987fn format_token(formatter: &mut fmt::Formatter, repr: &str) -> fmt::Result {
988 formatter.write_fmt(format_args!("Token![{0}]", repr))write!(formatter, "Token![{}]", repr)
989}
990
991#[doc(hidden)]
993#[cfg(feature = "parsing")]
994pub(crate) mod parsing {
995 use crate::buffer::Cursor;
996 use crate::error::{Error, Result};
997 use crate::parse::ParseStream;
998 use alloc::format;
999 use proc_macro2::{Spacing, Span};
1000
1001 pub(crate) fn keyword(input: ParseStream, token: &str) -> Result<Span> {
1002 input.step(|cursor| {
1003 if let Some((ident, rest)) = cursor.ident() {
1004 if ident == token {
1005 return Ok((ident.span(), rest));
1006 }
1007 }
1008 Err(cursor.error(::alloc::__export::must_use({
::alloc::fmt::format(format_args!("expected `{0}`", token))
})format!("expected `{}`", token)))
1009 })
1010 }
1011
1012 #[doc(hidden)]
1013 pub fn punct<const N: usize>(input: ParseStream, token: &str) -> Result<[Span; N]> {
1014 let mut spans = [input.span(); N];
1015 punct_helper(input, token, &mut spans)?;
1016 Ok(spans)
1017 }
1018
1019 fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span]) -> Result<()> {
1020 input.step(|cursor| {
1021 let mut cursor = *cursor;
1022 {
match (&token.len(), &spans.len()) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val, ::core::option::Option::None);
}
}
}
};assert_eq!(token.len(), spans.len());
1023
1024 for (i, ch) in token.chars().enumerate() {
1025 match cursor.punct() {
1026 Some((punct, rest)) => {
1027 spans[i] = punct.span();
1028 if punct.as_char() != ch {
1029 break;
1030 } else if i == token.len() - 1 {
1031 return Ok(((), rest));
1032 } else if punct.spacing() != Spacing::Joint {
1033 break;
1034 }
1035 cursor = rest;
1036 }
1037 None => break,
1038 }
1039 }
1040
1041 Err(Error::new(spans[0], ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("expected `{0}`", token))
})format!("expected `{}`", token)))
1042 })
1043 }
1044
1045 #[doc(hidden)]
1046 pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool {
1047 for (i, ch) in token.chars().enumerate() {
1048 match cursor.punct() {
1049 Some((punct, rest)) => {
1050 if punct.as_char() != ch {
1051 break;
1052 } else if i == token.len() - 1 {
1053 return true;
1054 } else if punct.spacing() != Spacing::Joint {
1055 break;
1056 }
1057 cursor = rest;
1058 }
1059 None => break,
1060 }
1061 }
1062 false
1063 }
1064}
1065
1066#[doc(hidden)]
1068#[cfg(feature = "printing")]
1069pub(crate) mod printing {
1070 use crate::ext::PunctExt as _;
1071 use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream};
1072 use quote::TokenStreamExt as _;
1073
1074 #[doc(hidden)]
1075 pub fn punct(s: &str, spans: &[Span], tokens: &mut TokenStream) {
1076 {
match (&s.len(), &spans.len()) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val, ::core::option::Option::None);
}
}
}
};assert_eq!(s.len(), spans.len());
1077
1078 let mut chars = s.chars();
1079 let mut spans = spans.iter();
1080 let ch = chars.next_back().unwrap();
1081 let span = spans.next_back().unwrap();
1082 for (ch, span) in chars.zip(spans) {
1083 tokens.append(Punct::new_spanned(ch, Spacing::Joint, *span));
1084 }
1085
1086 tokens.append(Punct::new_spanned(ch, Spacing::Alone, *span));
1087 }
1088
1089 pub(crate) fn keyword(s: &str, span: Span, tokens: &mut TokenStream) {
1090 tokens.append(Ident::new(s, span));
1091 }
1092
1093 pub(crate) fn delim(
1094 delim: Delimiter,
1095 span: Span,
1096 tokens: &mut TokenStream,
1097 inner: TokenStream,
1098 ) {
1099 let mut g = Group::new(delim, inner);
1100 g.set_span(span);
1101 tokens.append(g);
1102 }
1103}