1 // Type for a syntax tree node that is reserved for future use.
2 //
3 // For example ExprReference contains a field `raw` of type Reserved. If `&raw
4 // place` syntax becomes a thing as per https://github.com/rust-lang/rfcs/pull/2582,
5 // we can backward compatibly change `raw`'s type to Option<Token![raw]> without
6 // the possibility of breaking any code.
7 
8 use proc_macro2::Span;
9 use std::marker::PhantomData;
10 
11 #[cfg(feature = "extra-traits")]
12 use std::fmt::{self, Debug};
13 
14 ast_struct! {
15     pub struct Reserved {
16         _private: PhantomData<Span>,
17     }
18 }
19 
20 impl Default for Reserved {
default() -> Self21     fn default() -> Self {
22         Reserved {
23             _private: PhantomData,
24         }
25     }
26 }
27 
28 #[cfg(feature = "clone-impls")]
29 impl Clone for Reserved {
clone(&self) -> Self30     fn clone(&self) -> Self {
31         Reserved {
32             _private: self._private,
33         }
34     }
35 }
36 
37 #[cfg(feature = "extra-traits")]
38 impl Debug for Reserved {
fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result39     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
40         formatter.debug_struct("Reserved").finish()
41     }
42 }
43