]> git.lizzy.rs Git - rust.git/blob - src/rustdoc-json-types/lib.rs
Rollup merge of #101468 - spastorino:fix-ice-rpit-hrtb-without-dyn, r=cjgillot
[rust.git] / src / rustdoc-json-types / lib.rs
1 //! Rustdoc's JSON output interface
2 //!
3 //! These types are the public API exposed through the `--output-format json` flag. The [`Crate`]
4 //! struct is the root of the JSON blob and all other items are contained within.
5
6 use std::collections::HashMap;
7 use std::path::PathBuf;
8
9 use serde::{Deserialize, Serialize};
10
11 /// rustdoc format-version.
12 pub const FORMAT_VERSION: u32 = 20;
13
14 /// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
15 /// about the language items in the local crate, as well as info about external items to allow
16 /// tools to find or link to them.
17 #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
18 pub struct Crate {
19     /// The id of the root [`Module`] item of the local crate.
20     pub root: Id,
21     /// The version string given to `--crate-version`, if any.
22     pub crate_version: Option<String>,
23     /// Whether or not the output includes private items.
24     pub includes_private: bool,
25     /// A collection of all items in the local crate as well as some external traits and their
26     /// items that are referenced locally.
27     pub index: HashMap<Id, Item>,
28     /// Maps IDs to fully qualified paths and other info helpful for generating links.
29     pub paths: HashMap<Id, ItemSummary>,
30     /// Maps `crate_id` of items to a crate name and html_root_url if it exists.
31     pub external_crates: HashMap<u32, ExternalCrate>,
32     /// A single version number to be used in the future when making backwards incompatible changes
33     /// to the JSON output.
34     pub format_version: u32,
35 }
36
37 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
38 pub struct ExternalCrate {
39     pub name: String,
40     pub html_root_url: Option<String>,
41 }
42
43 /// For external (not defined in the local crate) items, you don't get the same level of
44 /// information. This struct should contain enough to generate a link/reference to the item in
45 /// question, or can be used by a tool that takes the json output of multiple crates to find
46 /// the actual item definition with all the relevant info.
47 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
48 pub struct ItemSummary {
49     /// Can be used to look up the name and html_root_url of the crate this item came from in the
50     /// `external_crates` map.
51     pub crate_id: u32,
52     /// The list of path components for the fully qualified path of this item (e.g.
53     /// `["std", "io", "lazy", "Lazy"]` for `std::io::lazy::Lazy`).
54     pub path: Vec<String>,
55     /// Whether this item is a struct, trait, macro, etc.
56     pub kind: ItemKind,
57 }
58
59 #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
60 pub struct Item {
61     /// The unique identifier of this item. Can be used to find this item in various mappings.
62     pub id: Id,
63     /// This can be used as a key to the `external_crates` map of [`Crate`] to see which crate
64     /// this item came from.
65     pub crate_id: u32,
66     /// Some items such as impls don't have names.
67     pub name: Option<String>,
68     /// The source location of this item (absent if it came from a macro expansion or inline
69     /// assembly).
70     pub span: Option<Span>,
71     /// By default all documented items are public, but you can tell rustdoc to output private items
72     /// so this field is needed to differentiate.
73     pub visibility: Visibility,
74     /// The full markdown docstring of this item. Absent if there is no documentation at all,
75     /// Some("") if there is some documentation but it is empty (EG `#[doc = ""]`).
76     pub docs: Option<String>,
77     /// This mapping resolves [intra-doc links](https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) from the docstring to their IDs
78     pub links: HashMap<String, Id>,
79     /// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)
80     pub attrs: Vec<String>,
81     pub deprecation: Option<Deprecation>,
82     #[serde(flatten)]
83     pub inner: ItemEnum,
84 }
85
86 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
87 pub struct Span {
88     /// The path to the source file for this span relative to the path `rustdoc` was invoked with.
89     pub filename: PathBuf,
90     /// Zero indexed Line and Column of the first character of the `Span`
91     pub begin: (usize, usize),
92     /// Zero indexed Line and Column of the last character of the `Span`
93     pub end: (usize, usize),
94 }
95
96 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
97 pub struct Deprecation {
98     pub since: Option<String>,
99     pub note: Option<String>,
100 }
101
102 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
103 #[serde(rename_all = "snake_case")]
104 pub enum Visibility {
105     Public,
106     /// For the most part items are private by default. The exceptions are associated items of
107     /// public traits and variants of public enums.
108     Default,
109     Crate,
110     /// For `pub(in path)` visibility. `parent` is the module it's restricted to and `path` is how
111     /// that module was referenced (like `"super::super"` or `"crate::foo::bar"`).
112     Restricted {
113         parent: Id,
114         path: String,
115     },
116 }
117
118 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
119 pub struct DynTrait {
120     /// All the traits implemented. One of them is the vtable, and the rest must be auto traits.
121     pub traits: Vec<PolyTrait>,
122     /// The lifetime of the whole dyn object
123     /// ```text
124     /// dyn Debug + 'static
125     ///             ^^^^^^^
126     ///             |
127     ///             this part
128     /// ```
129     pub lifetime: Option<String>,
130 }
131
132 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
133 /// A trait and potential HRTBs
134 pub struct PolyTrait {
135     #[serde(rename = "trait")]
136     pub trait_: Path,
137     /// Used for Higher-Rank Trait Bounds (HRTBs)
138     /// ```text
139     /// dyn for<'a> Fn() -> &'a i32"
140     ///     ^^^^^^^
141     ///       |
142     ///       this part
143     /// ```
144     pub generic_params: Vec<GenericParamDef>,
145 }
146
147 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
148 #[serde(rename_all = "snake_case")]
149 pub enum GenericArgs {
150     /// <'a, 32, B: Copy, C = u32>
151     AngleBracketed { args: Vec<GenericArg>, bindings: Vec<TypeBinding> },
152     /// Fn(A, B) -> C
153     Parenthesized { inputs: Vec<Type>, output: Option<Type> },
154 }
155
156 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
157 #[serde(rename_all = "snake_case")]
158 pub enum GenericArg {
159     Lifetime(String),
160     Type(Type),
161     Const(Constant),
162     Infer,
163 }
164
165 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
166 pub struct Constant {
167     #[serde(rename = "type")]
168     pub type_: Type,
169     pub expr: String,
170     pub value: Option<String>,
171     pub is_literal: bool,
172 }
173
174 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
175 pub struct TypeBinding {
176     pub name: String,
177     pub args: GenericArgs,
178     pub binding: TypeBindingKind,
179 }
180
181 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
182 #[serde(rename_all = "snake_case")]
183 pub enum TypeBindingKind {
184     Equality(Term),
185     Constraint(Vec<GenericBound>),
186 }
187
188 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
189 pub struct Id(pub String);
190
191 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
192 #[serde(rename_all = "snake_case")]
193 pub enum ItemKind {
194     Module,
195     ExternCrate,
196     Import,
197     Struct,
198     StructField,
199     Union,
200     Enum,
201     Variant,
202     Function,
203     Typedef,
204     OpaqueTy,
205     Constant,
206     Trait,
207     TraitAlias,
208     Method,
209     Impl,
210     Static,
211     ForeignType,
212     Macro,
213     ProcAttribute,
214     ProcDerive,
215     AssocConst,
216     AssocType,
217     Primitive,
218     Keyword,
219 }
220
221 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
222 #[serde(tag = "kind", content = "inner", rename_all = "snake_case")]
223 pub enum ItemEnum {
224     Module(Module),
225     ExternCrate {
226         name: String,
227         rename: Option<String>,
228     },
229     Import(Import),
230
231     Union(Union),
232     Struct(Struct),
233     StructField(Type),
234     Enum(Enum),
235     Variant(Variant),
236
237     Function(Function),
238
239     Trait(Trait),
240     TraitAlias(TraitAlias),
241     Method(Method),
242     Impl(Impl),
243
244     Typedef(Typedef),
245     OpaqueTy(OpaqueTy),
246     Constant(Constant),
247
248     Static(Static),
249
250     /// `type`s from an extern block
251     ForeignType,
252
253     /// Declarative macro_rules! macro
254     Macro(String),
255     ProcMacro(ProcMacro),
256
257     PrimitiveType(String),
258
259     AssocConst {
260         #[serde(rename = "type")]
261         type_: Type,
262         /// e.g. `const X: usize = 5;`
263         default: Option<String>,
264     },
265     AssocType {
266         generics: Generics,
267         bounds: Vec<GenericBound>,
268         /// e.g. `type X = usize;`
269         default: Option<Type>,
270     },
271 }
272
273 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
274 pub struct Module {
275     pub is_crate: bool,
276     pub items: Vec<Id>,
277     /// If `true`, this module is not part of the public API, but it contains
278     /// items that are re-exported as public API.
279     pub is_stripped: bool,
280 }
281
282 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
283 pub struct Union {
284     pub generics: Generics,
285     pub fields_stripped: bool,
286     pub fields: Vec<Id>,
287     pub impls: Vec<Id>,
288 }
289
290 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
291 pub struct Struct {
292     pub struct_type: StructType,
293     pub generics: Generics,
294     pub fields_stripped: bool,
295     pub fields: Vec<Id>,
296     pub impls: Vec<Id>,
297 }
298
299 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
300 pub struct Enum {
301     pub generics: Generics,
302     pub variants_stripped: bool,
303     pub variants: Vec<Id>,
304     pub impls: Vec<Id>,
305 }
306
307 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
308 #[serde(rename_all = "snake_case")]
309 #[serde(tag = "variant_kind", content = "variant_inner")]
310 pub enum Variant {
311     /// A variant with no parentheses, and possible discriminant.
312     ///
313     /// ```rust
314     /// enum Demo {
315     ///     PlainVariant,
316     ///     PlainWithDiscriminant = 1,
317     /// }
318     /// ```
319     Plain(Option<Discriminant>),
320     /// A variant with unnamed fields.
321     ///
322     /// Unlike most of json, `#[doc(hidden)]` fields will be given as `None`
323     /// instead of being ommited, because order matters.
324     ///
325     /// ```rust
326     /// enum Demo {
327     ///     TupleVariant(i32),
328     ///     EmptyTupleVariant(),
329     /// }
330     /// ```
331     Tuple(Vec<Option<Id>>),
332     /// A variant with named fields.
333     ///
334     /// ```rust
335     /// enum Demo {
336     ///     StructVariant { x: i32 },
337     ///     EmptyStructVariant {},
338     /// }
339     /// ```
340     Struct { fields: Vec<Id>, fields_stripped: bool },
341 }
342
343 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
344 pub struct Discriminant {
345     /// The expression that produced the discriminant.
346     ///
347     /// Unlike `value`, this preserves the original formatting (eg suffixes,
348     /// hexadecimal, and underscores), making it unsuitable to be machine
349     /// interpreted.
350     ///
351     /// In some cases, when the value is to complex, this may be `"{ _ }"`.
352     /// When this occurs is unstable, and may change without notice.
353     pub expr: String,
354     /// The numerical value of the discriminant. Stored as a string due to
355     /// JSON's poor support for large integers, and the fact that it would need
356     /// to store from [`i128::MIN`] to [`u128::MAX`].
357     pub value: String,
358 }
359
360 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
361 #[serde(rename_all = "snake_case")]
362 pub enum StructType {
363     Plain,
364     Tuple,
365     Unit,
366 }
367
368 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
369 pub struct Header {
370     #[serde(rename = "const")]
371     pub const_: bool,
372     #[serde(rename = "unsafe")]
373     pub unsafe_: bool,
374     #[serde(rename = "async")]
375     pub async_: bool,
376     pub abi: Abi,
377 }
378
379 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
380 pub enum Abi {
381     // We only have a concrete listing here for stable ABI's because their are so many
382     // See rustc_ast_passes::feature_gate::PostExpansionVisitor::check_abi for the list
383     Rust,
384     C { unwind: bool },
385     Cdecl { unwind: bool },
386     Stdcall { unwind: bool },
387     Fastcall { unwind: bool },
388     Aapcs { unwind: bool },
389     Win64 { unwind: bool },
390     SysV64 { unwind: bool },
391     System { unwind: bool },
392     Other(String),
393 }
394
395 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
396 pub struct Function {
397     pub decl: FnDecl,
398     pub generics: Generics,
399     pub header: Header,
400 }
401
402 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
403 pub struct Method {
404     pub decl: FnDecl,
405     pub generics: Generics,
406     pub header: Header,
407     pub has_body: bool,
408 }
409
410 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
411 pub struct Generics {
412     pub params: Vec<GenericParamDef>,
413     pub where_predicates: Vec<WherePredicate>,
414 }
415
416 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
417 pub struct GenericParamDef {
418     pub name: String,
419     pub kind: GenericParamDefKind,
420 }
421
422 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
423 #[serde(rename_all = "snake_case")]
424 pub enum GenericParamDefKind {
425     Lifetime {
426         outlives: Vec<String>,
427     },
428     Type {
429         bounds: Vec<GenericBound>,
430         default: Option<Type>,
431         /// This is normally `false`, which means that this generic parameter is
432         /// declared in the Rust source text.
433         ///
434         /// If it is `true`, this generic parameter has been introduced by the
435         /// compiler behind the scenes.
436         ///
437         /// # Example
438         ///
439         /// Consider
440         ///
441         /// ```ignore (pseudo-rust)
442         /// pub fn f(_: impl Trait) {}
443         /// ```
444         ///
445         /// The compiler will transform this behind the scenes to
446         ///
447         /// ```ignore (pseudo-rust)
448         /// pub fn f<impl Trait: Trait>(_: impl Trait) {}
449         /// ```
450         ///
451         /// In this example, the generic parameter named `impl Trait` (and which
452         /// is bound by `Trait`) is synthetic, because it was not originally in
453         /// the Rust source text.
454         synthetic: bool,
455     },
456     Const {
457         #[serde(rename = "type")]
458         type_: Type,
459         default: Option<String>,
460     },
461 }
462
463 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
464 #[serde(rename_all = "snake_case")]
465 pub enum WherePredicate {
466     BoundPredicate {
467         #[serde(rename = "type")]
468         type_: Type,
469         bounds: Vec<GenericBound>,
470         /// Used for Higher-Rank Trait Bounds (HRTBs)
471         /// ```text
472         /// where for<'a> &'a T: Iterator,"
473         ///       ^^^^^^^
474         ///       |
475         ///       this part
476         /// ```
477         generic_params: Vec<GenericParamDef>,
478     },
479     RegionPredicate {
480         lifetime: String,
481         bounds: Vec<GenericBound>,
482     },
483     EqPredicate {
484         lhs: Type,
485         rhs: Term,
486     },
487 }
488
489 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
490 #[serde(rename_all = "snake_case")]
491 pub enum GenericBound {
492     TraitBound {
493         #[serde(rename = "trait")]
494         trait_: Path,
495         /// Used for Higher-Rank Trait Bounds (HRTBs)
496         /// ```text
497         /// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
498         ///          ^^^^^^^^^^^
499         ///          |
500         ///          this part
501         /// ```
502         generic_params: Vec<GenericParamDef>,
503         modifier: TraitBoundModifier,
504     },
505     Outlives(String),
506 }
507
508 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
509 #[serde(rename_all = "snake_case")]
510 pub enum TraitBoundModifier {
511     None,
512     Maybe,
513     MaybeConst,
514 }
515
516 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
517 #[serde(rename_all = "snake_case")]
518 pub enum Term {
519     Type(Type),
520     Constant(Constant),
521 }
522
523 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
524 #[serde(rename_all = "snake_case")]
525 #[serde(tag = "kind", content = "inner")]
526 pub enum Type {
527     /// Structs, enums, and traits
528     ResolvedPath(Path),
529     DynTrait(DynTrait),
530     /// Parameterized types
531     Generic(String),
532     /// Fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples
533     Primitive(String),
534     /// `extern "ABI" fn`
535     FunctionPointer(Box<FunctionPointer>),
536     /// `(String, u32, Box<usize>)`
537     Tuple(Vec<Type>),
538     /// `[u32]`
539     Slice(Box<Type>),
540     /// [u32; 15]
541     Array {
542         #[serde(rename = "type")]
543         type_: Box<Type>,
544         len: String,
545     },
546     /// `impl TraitA + TraitB + ...`
547     ImplTrait(Vec<GenericBound>),
548     /// `_`
549     Infer,
550     /// `*mut u32`, `*u8`, etc.
551     RawPointer {
552         mutable: bool,
553         #[serde(rename = "type")]
554         type_: Box<Type>,
555     },
556     /// `&'a mut String`, `&str`, etc.
557     BorrowedRef {
558         lifetime: Option<String>,
559         mutable: bool,
560         #[serde(rename = "type")]
561         type_: Box<Type>,
562     },
563     /// `<Type as Trait>::Name` or associated types like `T::Item` where `T: Iterator`
564     QualifiedPath {
565         name: String,
566         args: Box<GenericArgs>,
567         self_type: Box<Type>,
568         #[serde(rename = "trait")]
569         trait_: Path,
570     },
571 }
572
573 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
574 pub struct Path {
575     pub name: String,
576     pub id: Id,
577     /// Generic arguments to the type
578     /// ```test
579     /// std::borrow::Cow<'static, str>
580     ///                 ^^^^^^^^^^^^^^
581     ///                 |
582     ///                 this part
583     /// ```
584     pub args: Option<Box<GenericArgs>>,
585 }
586
587 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
588 pub struct FunctionPointer {
589     pub decl: FnDecl,
590     /// Used for Higher-Rank Trait Bounds (HRTBs)
591     /// ```text
592     /// for<'c> fn(val: &'c i32) -> i32
593     /// ^^^^^^^
594     ///       |
595     ///       this part
596     /// ```
597     pub generic_params: Vec<GenericParamDef>,
598     pub header: Header,
599 }
600
601 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
602 pub struct FnDecl {
603     pub inputs: Vec<(String, Type)>,
604     pub output: Option<Type>,
605     pub c_variadic: bool,
606 }
607
608 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
609 pub struct Trait {
610     pub is_auto: bool,
611     pub is_unsafe: bool,
612     pub items: Vec<Id>,
613     pub generics: Generics,
614     pub bounds: Vec<GenericBound>,
615     pub implementations: Vec<Id>,
616 }
617
618 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
619 pub struct TraitAlias {
620     pub generics: Generics,
621     pub params: Vec<GenericBound>,
622 }
623
624 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
625 pub struct Impl {
626     pub is_unsafe: bool,
627     pub generics: Generics,
628     pub provided_trait_methods: Vec<String>,
629     #[serde(rename = "trait")]
630     pub trait_: Option<Path>,
631     #[serde(rename = "for")]
632     pub for_: Type,
633     pub items: Vec<Id>,
634     pub negative: bool,
635     pub synthetic: bool,
636     pub blanket_impl: Option<Type>,
637 }
638
639 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
640 #[serde(rename_all = "snake_case")]
641 pub struct Import {
642     /// The full path being imported.
643     pub source: String,
644     /// May be different from the last segment of `source` when renaming imports:
645     /// `use source as name;`
646     pub name: String,
647     /// The ID of the item being imported. Will be `None` in case of re-exports of primitives:
648     /// ```rust
649     /// pub use i32 as my_i32;
650     /// ```
651     pub id: Option<Id>,
652     /// Whether this import uses a glob: `use source::*;`
653     pub glob: bool,
654 }
655
656 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
657 pub struct ProcMacro {
658     pub kind: MacroKind,
659     pub helpers: Vec<String>,
660 }
661
662 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
663 #[serde(rename_all = "snake_case")]
664 pub enum MacroKind {
665     /// A bang macro `foo!()`.
666     Bang,
667     /// An attribute macro `#[foo]`.
668     Attr,
669     /// A derive macro `#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]`
670     Derive,
671 }
672
673 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
674 pub struct Typedef {
675     #[serde(rename = "type")]
676     pub type_: Type,
677     pub generics: Generics,
678 }
679
680 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
681 pub struct OpaqueTy {
682     pub bounds: Vec<GenericBound>,
683     pub generics: Generics,
684 }
685
686 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
687 pub struct Static {
688     #[serde(rename = "type")]
689     pub type_: Type,
690     pub mutable: bool,
691     pub expr: String,
692 }
693
694 #[cfg(test)]
695 mod tests;