]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/rust-analyzer/crates/syntax/src/tests/ast_src.rs
Disable all source-gen tests at compile time
[rust.git] / src / tools / rust-analyzer / crates / syntax / src / tests / ast_src.rs
index cf5be1c30fba2ef47bc3c5891747735c73a76460..93959d4ed796e1b5f8750d2443be459db97e190c 100644 (file)
@@ -1,5 +1,6 @@
 //! Defines input for code generation process.
 
+#[cfg(not(feature = "in-rust-tree"))]
 pub(crate) struct KindsSrc<'a> {
     pub(crate) punct: &'a [(&'a str, &'a str)],
     pub(crate) keywords: &'a [&'a str],
@@ -9,6 +10,7 @@ pub(crate) struct KindsSrc<'a> {
     pub(crate) nodes: &'a [&'a str],
 }
 
+#[cfg(not(feature = "in-rust-tree"))]
 pub(crate) const KINDS_SRC: KindsSrc<'_> = KindsSrc {
     punct: &[
         (";", "SEMICOLON"),
@@ -216,6 +218,7 @@ pub(crate) struct KindsSrc<'a> {
     ],
 };
 
+#[cfg(not(feature = "in-rust-tree"))]
 #[derive(Default, Debug)]
 pub(crate) struct AstSrc {
     pub(crate) tokens: Vec<String>,
@@ -223,6 +226,7 @@ pub(crate) struct AstSrc {
     pub(crate) enums: Vec<AstEnumSrc>,
 }
 
+#[cfg(not(feature = "in-rust-tree"))]
 #[derive(Debug)]
 pub(crate) struct AstNodeSrc {
     pub(crate) doc: Vec<String>,
@@ -231,18 +235,21 @@ pub(crate) struct AstNodeSrc {
     pub(crate) fields: Vec<Field>,
 }
 
+#[cfg(not(feature = "in-rust-tree"))]
 #[derive(Debug, Eq, PartialEq)]
 pub(crate) enum Field {
     Token(String),
     Node { name: String, ty: String, cardinality: Cardinality },
 }
 
+#[cfg(not(feature = "in-rust-tree"))]
 #[derive(Debug, Eq, PartialEq)]
 pub(crate) enum Cardinality {
     Optional,
     Many,
 }
 
+#[cfg(not(feature = "in-rust-tree"))]
 #[derive(Debug)]
 pub(crate) struct AstEnumSrc {
     pub(crate) doc: Vec<String>,