From e935bd6faf58744d1b69f3faaa418156b1f1b976 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 11:19:06 +0200 Subject: [PATCH 1/7] Rust: expand derive macros --- misc/codegen/templates/rust_classes.mustache | 14 + rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 751 ++++---- rust/extractor/src/translate/base.rs | 98 +- rust/ql/.generated.list | 32 +- rust/ql/.gitattributes | 6 + rust/ql/lib/codeql/rust/elements.qll | 1 + rust/ql/lib/codeql/rust/elements/Adt.qll | 13 + rust/ql/lib/codeql/rust/elements/Enum.qll | 2 +- rust/ql/lib/codeql/rust/elements/Struct.qll | 2 +- rust/ql/lib/codeql/rust/elements/Union.qll | 2 +- .../codeql/rust/elements/internal/AdtImpl.qll | 19 + .../rust/elements/internal/generated/Adt.qll | 45 + .../rust/elements/internal/generated/Enum.qll | 4 +- .../internal/generated/ParentChild.qll | 272 +-- .../rust/elements/internal/generated/Raw.qll | 257 +-- .../elements/internal/generated/Struct.qll | 4 +- .../elements/internal/generated/Synth.qll | 51 +- .../elements/internal/generated/Union.qll | 4 +- rust/ql/lib/rust.dbscheme | 251 +-- .../extractor-tests/generated/Enum/Enum.ql | 12 +- .../Enum/Enum_getDeriveMacroExpansion.ql | 7 + .../generated/Struct/Struct.ql | 13 +- .../Struct/Struct_getDeriveMacroExpansion.ql | 7 + .../extractor-tests/generated/Union/Union.ql | 13 +- .../Union/Union_getDeriveMacroExpansion.ql | 7 + .../macro-expansion/PrintAst.expected | 1635 +++++++++++++++++ .../macro-expansion/macro_expansion.rs | 24 +- .../macro-expansion/proc_macro.rs | 17 + .../macro-expansion/test.expected | 6 + .../extractor-tests/macro-expansion/test.ql | 4 + rust/schema/annotations.py | 13 +- 32 files changed, 2825 insertions(+), 763 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/elements/Adt.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/AdtImpl.qll create mode 100644 rust/ql/lib/codeql/rust/elements/internal/generated/Adt.qll create mode 100644 rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql create mode 100644 rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql create mode 100644 rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql diff --git a/misc/codegen/templates/rust_classes.mustache b/misc/codegen/templates/rust_classes.mustache index 77a0335da518..b30a039e5224 100644 --- a/misc/codegen/templates/rust_classes.mustache +++ b/misc/codegen/templates/rust_classes.mustache @@ -66,6 +66,20 @@ impl {{name}} { pub fn emit_{{singular_field_name}}(id: trap::Label{{^is_predicate}}{{#is_repeated}}{{^is_unordered}}, i: usize{{/is_unordered}}{{/is_repeated}}, value: {{base_type}}{{/is_predicate}}, out: &mut trap::Writer) { out.add_tuple("{{table_name}}", vec![id.into(){{^is_predicate}}{{#is_repeated}}{{^is_unordered}}, i.into(){{/is_unordered}}{{/is_repeated}}, value.into(){{/is_predicate}}]); } + + {{#is_repeated}} + pub fn emit_{{field_name}}(id: trap::Label, values: impl IntoIterator, out: &mut trap::Writer) { + values + .into_iter() + {{^is_unordered}} + .enumerate() + .for_each(|(i, value)| Self::emit_{{singular_field_name}}(id, i, value, out)); + {{/is_unordered}} + {{#is_unordered}} + .for_each(|value| Self::emit_{{singular_field_name}}(id, value, out)); + {{/is_unordered}} + } + {{/is_repeated}} {{/detached_fields}} } {{/has_detached_fields}} diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 121c5b5a7aae..356bff6824f3 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 69c1fcaf0efea87feb898f32fdb7bcb842a22119b69ecedd61c2d946eb7e67de 69c1fcaf0efea87feb898f32fdb7bcb842a22119b69ecedd61c2d946eb7e67de +top.rs 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index fd9b0ca6b91e..88fb5167b2ac 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -335,9 +335,11 @@ impl Addressable { pub fn emit_extended_canonical_path(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("addressable_extended_canonical_paths", vec![id.into(), value.into()]); } + pub fn emit_crate_origin(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("addressable_crate_origins", vec![id.into(), value.into()]); } + } impl trap::TrapClass for Addressable { @@ -2058,9 +2060,11 @@ impl PathSegment { pub fn emit_type_repr(id: trap::Label, value: trap::Label, out: &mut trap::Writer) { out.add_tuple("path_segment_type_reprs", vec![id.into(), value.into()]); } + pub fn emit_trait_type_repr(id: trap::Label, value: trap::Label, out: &mut trap::Writer) { out.add_tuple("path_segment_trait_type_reprs", vec![id.into(), value.into()]); } + } impl trap::TrapClass for PathSegment { @@ -2153,9 +2157,11 @@ impl Resolvable { pub fn emit_resolved_path(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("resolvable_resolved_paths", vec![id.into(), value.into()]); } + pub fn emit_resolved_crate_origin(id: trap::Label, value: String, out: &mut trap::Writer) { out.add_tuple("resolvable_resolved_crate_origins", vec![id.into(), value.into()]); } + } impl trap::TrapClass for Resolvable { @@ -5764,6 +5770,7 @@ impl Item { pub fn emit_attribute_macro_expansion(id: trap::Label, value: trap::Label, out: &mut trap::Writer) { out.add_tuple("item_attribute_macro_expansions", vec![id.into(), value.into()]); } + } impl trap::TrapClass for Item { @@ -8865,6 +8872,82 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct Adt { + _unused: () +} + +impl Adt { + pub fn emit_derive_macro_expansion(id: trap::Label, i: usize, value: trap::Label, out: &mut trap::Writer) { + out.add_tuple("adt_derive_macro_expansions", vec![id.into(), i.into(), value.into()]); + } + + pub fn emit_derive_macro_expansions(id: trap::Label, values: impl IntoIterator>, out: &mut trap::Writer) { + values + .into_iter() + .enumerate() + .for_each(|(i, value)| Self::emit_derive_macro_expansion(id, i, value, out)); + } +} + +impl trap::TrapClass for Adt { + fn class_name() -> &'static str { "Adt" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Item + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Stmt + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Addressable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct BlockExpr { pub id: trap::TrapId, @@ -9088,6 +9171,7 @@ impl Const { pub fn emit_has_implementation(id: trap::Label, out: &mut trap::Writer) { out.add_tuple("const_has_implementation", vec![id.into()]); } + } impl trap::TrapClass for Const { @@ -9157,103 +9241,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct Enum { - pub id: trap::TrapId, - pub attrs: Vec>, - pub generic_param_list: Option>, - pub name: Option>, - pub variant_list: Option>, - pub visibility: Option>, - pub where_clause: Option>, -} - -impl trap::TrapEntry for Enum { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("enums", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("enum_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.generic_param_list { - out.add_tuple("enum_generic_param_lists", vec![id.into(), v.into()]); - } - if let Some(v) = self.name { - out.add_tuple("enum_names", vec![id.into(), v.into()]); - } - if let Some(v) = self.variant_list { - out.add_tuple("enum_variant_lists", vec![id.into(), v.into()]); - } - if let Some(v) = self.visibility { - out.add_tuple("enum_visibilities", vec![id.into(), v.into()]); - } - if let Some(v) = self.where_clause { - out.add_tuple("enum_where_clauses", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for Enum { - fn class_name() -> &'static str { "Enum" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of Item - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of Stmt - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Enum is a subclass of Addressable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct ExternBlock { pub id: trap::TrapId, @@ -9507,6 +9494,7 @@ impl Function { pub fn emit_has_implementation(id: trap::Label, out: &mut trap::Writer) { out.add_tuple("function_has_implementation", vec![id.into()]); } + } impl trap::TrapClass for Function { @@ -9792,6 +9780,7 @@ impl MacroCall { pub fn emit_macro_call_expansion(id: trap::Label, value: trap::Label, out: &mut trap::Writer) { out.add_tuple("macro_call_macro_call_expansions", vec![id.into(), value.into()]); } + } impl trap::TrapClass for MacroCall { @@ -10516,105 +10505,80 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Struct { - pub id: trap::TrapId, - pub attrs: Vec>, - pub field_list: Option>, - pub generic_param_list: Option>, - pub name: Option>, - pub visibility: Option>, - pub where_clause: Option>, +pub struct StructExpr { + pub id: trap::TrapId, + pub path: Option>, + pub struct_expr_field_list: Option>, } -impl trap::TrapEntry for Struct { +impl trap::TrapEntry for StructExpr { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("structs", vec![id.into()]); - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("struct_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.field_list { - out.add_tuple("struct_field_lists_", vec![id.into(), v.into()]); - } - if let Some(v) = self.generic_param_list { - out.add_tuple("struct_generic_param_lists", vec![id.into(), v.into()]); - } - if let Some(v) = self.name { - out.add_tuple("struct_names", vec![id.into(), v.into()]); - } - if let Some(v) = self.visibility { - out.add_tuple("struct_visibilities", vec![id.into(), v.into()]); + out.add_tuple("struct_exprs", vec![id.into()]); + if let Some(v) = self.path { + out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); } - if let Some(v) = self.where_clause { - out.add_tuple("struct_where_clauses", vec![id.into(), v.into()]); + if let Some(v) = self.struct_expr_field_list { + out.add_tuple("struct_expr_struct_expr_field_lists", vec![id.into(), v.into()]); } } } -impl trap::TrapClass for Struct { - fn class_name() -> &'static str { "Struct" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of Item - unsafe { - Self::from_untyped(value.as_untyped()) - } - } +impl trap::TrapClass for StructExpr { + fn class_name() -> &'static str { "StructExpr" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of Stmt +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Expr unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of Addressable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of PathAstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of VariantDef +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Resolvable unsafe { Self::from_untyped(value.as_untyped()) } @@ -10622,105 +10586,24 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct StructExpr { - pub id: trap::TrapId, +pub struct StructPat { + pub id: trap::TrapId, pub path: Option>, - pub struct_expr_field_list: Option>, + pub struct_pat_field_list: Option>, } -impl trap::TrapEntry for StructExpr { +impl trap::TrapEntry for StructPat { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("struct_exprs", vec![id.into()]); + out.add_tuple("struct_pats", vec![id.into()]); if let Some(v) = self.path { out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); } - if let Some(v) = self.struct_expr_field_list { - out.add_tuple("struct_expr_struct_expr_field_lists", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for StructExpr { - fn class_name() -> &'static str { "StructExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of PathAstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme StructExpr is a subclass of Resolvable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -#[derive(Debug)] -pub struct StructPat { - pub id: trap::TrapId, - pub path: Option>, - pub struct_pat_field_list: Option>, -} - -impl trap::TrapEntry for StructPat { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("struct_pats", vec![id.into()]); - if let Some(v) = self.path { - out.add_tuple("path_ast_node_paths", vec![id.into(), v.into()]); - } - if let Some(v) = self.struct_pat_field_list { - out.add_tuple("struct_pat_struct_pat_field_lists", vec![id.into(), v.into()]); + if let Some(v) = self.struct_pat_field_list { + out.add_tuple("struct_pat_struct_pat_field_lists", vec![id.into(), v.into()]); } } } @@ -11194,105 +11077,84 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Union { - pub id: trap::TrapId, +pub struct Use { + pub id: trap::TrapId, pub attrs: Vec>, - pub generic_param_list: Option>, - pub name: Option>, - pub struct_field_list: Option>, + pub use_tree: Option>, pub visibility: Option>, - pub where_clause: Option>, } -impl trap::TrapEntry for Union { +impl trap::TrapEntry for Use { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("unions", vec![id.into()]); + out.add_tuple("uses", vec![id.into()]); for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("union_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.generic_param_list { - out.add_tuple("union_generic_param_lists", vec![id.into(), v.into()]); - } - if let Some(v) = self.name { - out.add_tuple("union_names", vec![id.into(), v.into()]); + out.add_tuple("use_attrs", vec![id.into(), i.into(), v.into()]); } - if let Some(v) = self.struct_field_list { - out.add_tuple("union_struct_field_lists", vec![id.into(), v.into()]); + if let Some(v) = self.use_tree { + out.add_tuple("use_use_trees", vec![id.into(), v.into()]); } if let Some(v) = self.visibility { - out.add_tuple("union_visibilities", vec![id.into(), v.into()]); - } - if let Some(v) = self.where_clause { - out.add_tuple("union_where_clauses", vec![id.into(), v.into()]); + out.add_tuple("use_visibilities", vec![id.into(), v.into()]); } } } -impl trap::TrapClass for Union { - fn class_name() -> &'static str { "Union" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of Item - unsafe { - Self::from_untyped(value.as_untyped()) - } - } +impl trap::TrapClass for Use { + fn class_name() -> &'static str { "Use" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of Stmt +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of Item unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of Stmt unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of Addressable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of VariantDef +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Use is a subclass of Addressable unsafe { Self::from_untyped(value.as_untyped()) } @@ -11300,84 +11162,105 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Use { - pub id: trap::TrapId, +pub struct Enum { + pub id: trap::TrapId, pub attrs: Vec>, - pub use_tree: Option>, + pub generic_param_list: Option>, + pub name: Option>, + pub variant_list: Option>, pub visibility: Option>, + pub where_clause: Option>, } -impl trap::TrapEntry for Use { +impl trap::TrapEntry for Enum { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("uses", vec![id.into()]); + out.add_tuple("enums", vec![id.into()]); for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("use_attrs", vec![id.into(), i.into(), v.into()]); + out.add_tuple("enum_attrs", vec![id.into(), i.into(), v.into()]); } - if let Some(v) = self.use_tree { - out.add_tuple("use_use_trees", vec![id.into(), v.into()]); + if let Some(v) = self.generic_param_list { + out.add_tuple("enum_generic_param_lists", vec![id.into(), v.into()]); + } + if let Some(v) = self.name { + out.add_tuple("enum_names", vec![id.into(), v.into()]); + } + if let Some(v) = self.variant_list { + out.add_tuple("enum_variant_lists", vec![id.into(), v.into()]); } if let Some(v) = self.visibility { - out.add_tuple("use_visibilities", vec![id.into(), v.into()]); + out.add_tuple("enum_visibilities", vec![id.into(), v.into()]); + } + if let Some(v) = self.where_clause { + out.add_tuple("enum_where_clauses", vec![id.into(), v.into()]); } } } -impl trap::TrapClass for Use { - fn class_name() -> &'static str { "Use" } +impl trap::TrapClass for Enum { + fn class_name() -> &'static str { "Enum" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of Item +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Adt unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of Stmt +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Item unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Stmt unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Use is a subclass of Addressable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Enum is a subclass of Addressable unsafe { Self::from_untyped(value.as_untyped()) } @@ -11562,6 +11445,236 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct Struct { + pub id: trap::TrapId, + pub attrs: Vec>, + pub field_list: Option>, + pub generic_param_list: Option>, + pub name: Option>, + pub visibility: Option>, + pub where_clause: Option>, +} + +impl trap::TrapEntry for Struct { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("structs", vec![id.into()]); + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("struct_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.field_list { + out.add_tuple("struct_field_lists_", vec![id.into(), v.into()]); + } + if let Some(v) = self.generic_param_list { + out.add_tuple("struct_generic_param_lists", vec![id.into(), v.into()]); + } + if let Some(v) = self.name { + out.add_tuple("struct_names", vec![id.into(), v.into()]); + } + if let Some(v) = self.visibility { + out.add_tuple("struct_visibilities", vec![id.into(), v.into()]); + } + if let Some(v) = self.where_clause { + out.add_tuple("struct_where_clauses", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for Struct { + fn class_name() -> &'static str { "Struct" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Adt + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Item + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Stmt + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of Addressable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Struct is a subclass of VariantDef + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +#[derive(Debug)] +pub struct Union { + pub id: trap::TrapId, + pub attrs: Vec>, + pub generic_param_list: Option>, + pub name: Option>, + pub struct_field_list: Option>, + pub visibility: Option>, + pub where_clause: Option>, +} + +impl trap::TrapEntry for Union { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("unions", vec![id.into()]); + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("union_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.generic_param_list { + out.add_tuple("union_generic_param_lists", vec![id.into(), v.into()]); + } + if let Some(v) = self.name { + out.add_tuple("union_names", vec![id.into(), v.into()]); + } + if let Some(v) = self.struct_field_list { + out.add_tuple("union_struct_field_lists", vec![id.into(), v.into()]); + } + if let Some(v) = self.visibility { + out.add_tuple("union_visibilities", vec![id.into(), v.into()]); + } + if let Some(v) = self.where_clause { + out.add_tuple("union_where_clauses", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for Union { + fn class_name() -> &'static str { "Union" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Adt + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Item + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Stmt + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of Addressable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Union is a subclass of VariantDef + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct WhileExpr { pub id: trap::TrapId, diff --git a/rust/extractor/src/translate/base.rs b/rust/extractor/src/translate/base.rs index 9e9123c45709..db60b7e29edc 100644 --- a/rust/extractor/src/translate/base.rs +++ b/rust/extractor/src/translate/base.rs @@ -16,7 +16,7 @@ use ra_ap_ide_db::RootDatabase; use ra_ap_ide_db::line_index::{LineCol, LineIndex}; use ra_ap_parser::SyntaxKind; use ra_ap_span::TextSize; -use ra_ap_syntax::ast::HasName; +use ra_ap_syntax::ast::{HasAttrs, HasName}; use ra_ap_syntax::{ AstNode, NodeOrToken, SyntaxElementChildren, SyntaxError, SyntaxNode, SyntaxToken, TextRange, ast, @@ -45,12 +45,15 @@ macro_rules! post_emit { $self.extract_canonical_origin($node, $label.into()); }; (Struct, $self:ident, $node:ident, $label:ident) => { + $self.emit_derive_expansion($node, $label); $self.extract_canonical_origin($node, $label.into()); }; (Enum, $self:ident, $node:ident, $label:ident) => { + $self.emit_derive_expansion($node, $label); $self.extract_canonical_origin($node, $label.into()); }; (Union, $self:ident, $node:ident, $label:ident) => { + $self.emit_derive_expansion($node, $label); $self.extract_canonical_origin($node, $label.into()); }; (Module, $self:ident, $node:ident, $label:ident) => { @@ -250,6 +253,25 @@ impl<'a> Translator<'a> { .emit_diagnostic(severity, tag, message, full_message, location); } } + + pub fn emit_diagnostic_for_node( + &mut self, + node: &impl ast::AstNode, + severity: DiagnosticSeverity, + tag: String, + message: String, + full_message: String, + ) { + let location = self.location_for_node(node); + self.emit_diagnostic( + severity, + tag, + message, + full_message, + location.unwrap_or(UNKNOWN_LOCATION), + ); + } + pub fn emit_parse_error(&mut self, owner: &impl ast::AstNode, err: &SyntaxError) { let owner_range: TextRange = owner.syntax().text_range(); let err_range = err.range(); @@ -726,6 +748,39 @@ impl<'a> Translator<'a> { None } + fn process_item_macro_expansion( + &mut self, + node: &impl ast::AstNode, + ExpandResult { value, err }: ExpandResult, + ) -> Option> { + let semantics = self.semantics.unwrap(); // if we are here, we have semantics + self.emit_macro_expansion_parse_errors(node, &value); + if let Some(err) = err { + let rendered = err.render_to_string(semantics.db); + self.emit_diagnostic_for_node( + node, + DiagnosticSeverity::Warning, + "item_expansion".to_owned(), + format!("item expansion failed ({})", rendered.kind), + rendered.message, + ); + } + if let Some(items) = ast::MacroItems::cast(value) { + self.emit_macro_items(&items) + } else { + let message = + "attribute or derive macro expansion cannot be cast to MacroItems".to_owned(); + self.emit_diagnostic_for_node( + node, + DiagnosticSeverity::Warning, + "item_expansion".to_owned(), + message.clone(), + message, + ); + None + } + } + fn emit_attribute_macro_expansion( &mut self, node: &ast::Item, @@ -741,23 +796,8 @@ impl<'a> Translator<'a> { // only expand the outermost attribute macro return None; } - let ExpandResult { - value: expanded, .. - } = semantics.expand_attr_macro(node)?; - self.emit_macro_expansion_parse_errors(node, &expanded); - let macro_items = ast::MacroItems::cast(expanded).or_else(|| { - let message = "attribute macro expansion cannot be cast to MacroItems".to_owned(); - let location = self.location_for_node(node); - self.emit_diagnostic( - DiagnosticSeverity::Warning, - "item_expansion".to_owned(), - message.clone(), - message, - location.unwrap_or(UNKNOWN_LOCATION), - ); - None - })?; - self.emit_macro_items(¯o_items) + let expansion = semantics.expand_attr_macro(node)?; + self.process_item_macro_expansion(node, expansion) } pub(crate) fn emit_item_expansion(&mut self, node: &ast::Item, label: Label) { @@ -785,4 +825,26 @@ impl<'a> Translator<'a> { generated::Const::emit_has_implementation(label, &mut self.trap.writer); } } + + pub(crate) fn emit_derive_expansion( + &mut self, + node: &(impl Into + Clone), + label: impl Into> + Copy, + ) { + let Some(semantics) = self.semantics else { + return; + }; + let node: ast::Adt = node.clone().into(); + let expansions = node + .attrs() + .filter_map(|attr| semantics.expand_derive_macro(&attr)) + .flatten() + .filter_map(|expansion| self.process_item_macro_expansion(&node, expansion)) + .collect::>(); + generated::Adt::emit_derive_macro_expansions( + label.into(), + expansions, + &mut self.trap.writer, + ); + } } diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 7c60da3abb77..4aa4e6d7da09 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -1,6 +1,7 @@ lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll 6a103a6d04c951ca2f0c2989bed737cdbac56dd5ea9432b858da3416412bbf79 cf2bc67b65a1555de58bbd0a35b834b8867112a2f7c1951307c9416400ce70d0 lib/codeql/rust/elements/Abi.qll 485a2e79f6f7bfd1c02a6e795a71e62dede3c3e150149d5f8f18b761253b7208 6159ba175e7ead0dd2e3f2788f49516c306ee11b1a443bd4bdc00b7017d559bd lib/codeql/rust/elements/Addressable.qll 13011bfd2e1556694c3d440cc34af8527da4df49ad92b62f2939d3699ff2cea5 ddb25935f7553a1a384b1abe2e4b4fa90ab50b952dadec32fd867afcb054f4be +lib/codeql/rust/elements/Adt.qll c2afed4ac2e17039ccd98f74ea22111f4d765c4e232c50ccd3128da0d26da837 1380bde2eb667c6ec2ef5f8710aa24e926851c9e321ebc72ba514fa92c369dc3 lib/codeql/rust/elements/ArgList.qll 3d2f6f5542340b80a4c6e944ac17aba0d00727588bb66e501453ac0f80c82f83 afd52700bf5a337f19827846667cd0fb1fea5abbbcbc353828e292a727ea58c9 lib/codeql/rust/elements/ArrayExpr.qll e4e7cff3518c50ec908271906dd46c1fbe9098faa1e8cd06a27f0a6e8d165ed1 fe02a4f4197f57ecd1e8e82d6c9384148ec29d8b106d7f696795b2f325e4a71b lib/codeql/rust/elements/ArrayListExpr.qll 451aedcecb479c385ff497588c7a07fda304fd5b873270223a4f2c804e96b245 a8cb008f6f732215623b5626c84b37b651ca01ccafb2cf4c835df35d5140c6ad @@ -46,7 +47,7 @@ lib/codeql/rust/elements/ContinueExpr.qll 9f27c5d5c819ad0ebc5bd10967ba8d33a9dc95 lib/codeql/rust/elements/Crate.qll 1426960e6f36195e42ea5ea321405c1a72fccd40cd6c0a33673c321c20302d8d 1571a89f89dab43c5291b71386de7aadf52730755ba10f9d696db9ad2f760aff lib/codeql/rust/elements/DynTraitTypeRepr.qll e4d27112d27ae93c621defd2c976fd4e90663ab7f6115e83ae4fe8106cb5e015 eb9fde89698588f3b7116f62388c54e937f99559b22c93d11a5596e754560072 lib/codeql/rust/elements/Element.qll 0b62d139fef54ed2cf2e2334806aa9bfbc036c9c2085d558f15a42cc3fa84c48 24b999b93df79383ef27ede46e38da752868c88a07fe35fcff5d526684ba7294 -lib/codeql/rust/elements/Enum.qll accb97d0bd8c0f41df873d41886f606b6ae4cd1ffa38b70fe9504cfb89d0bd7d b456103ac992e384165d151eb0f169499be4961c3ec35b94a32201b5e4e22189 +lib/codeql/rust/elements/Enum.qll 55d5a4a775f07d9c1d5183af76f9d8de1d700bfe1dea427cc7ff3083f39e13de f00a585596f1d0ab34e6f2b7cdaba6d4a89005820478f810e8685478cf88100e lib/codeql/rust/elements/Expr.qll e5d65e805ccf440d64d331e55df4c4144ab8c8f63f367382494714087659ffe8 2bbc1e5d3a65f413ec33d9822fa451fbdbe32349158db58cc0bfcfafb0e21bda lib/codeql/rust/elements/ExprStmt.qll 00ac4c7d0192b9e8b0f28d5ae59c27729ff5a831ca11938ea3e677a262337a64 7cc02aa5346cd7c50d75ca63cd6501097b0a3979eb2ed838adff114fe17d35a3 lib/codeql/rust/elements/ExternBlock.qll 96c70d0761ec385fe17aa7228e15fd1711949d5abba5877a1c2f4c180d202125 38ad458868a368d437b2dda44307d788a85c887f45ea76c99adbfc9a53f14d81 @@ -145,7 +146,7 @@ lib/codeql/rust/elements/SourceFile.qll 0b6a3e58767c07602b19975009a2ad53ecf1fd72 lib/codeql/rust/elements/Static.qll a6d73152ddecb53a127aa3a4139f97007cd77b46203691c287600aa7200b8beb 547197e794803b3ea0c0e220f050980adec815a16fdef600f98ff795aa77f677 lib/codeql/rust/elements/Stmt.qll 532b12973037301246daf7d8c0177f734202f43d9261c7a4ca6f5080eea8ca64 b838643c4f2b4623d2c816cddad0e68ca3e11f2879ab7beaece46f489ec4b1f3 lib/codeql/rust/elements/StmtList.qll e874859ce03672d0085e47e0ca5e571b92b539b31bf0d5a8802f9727bef0c6b0 e5fe83237f713cdb57c446a6e1c20f645c2f49d9f5ef2c984032df83acb3c0de -lib/codeql/rust/elements/Struct.qll c1f607aa4b039fc24bbbedc5992e49bd13e9851731296645c7ec2669425f19ad d7720c76a5a50284bd62df707cb113dfb19104226e9ee7578e75eb207da0655c +lib/codeql/rust/elements/Struct.qll 6ae1ce11044a1f6bf3150ddce947c1be17e462613edf7ea4fe7d861aa3dbe0d1 043ef682d71f31e8808962032c05ab3045e7cbc8663ec7e06dc9255e12e53c12 lib/codeql/rust/elements/StructExpr.qll af9059c01a97755e94f1a8b60c66d9c7663ed0705b2845b086b8953f16019fab 2d33d86b035a15c1b31c3e07e0e74c4bbe57a71c5a55d60e720827814e73b7ba lib/codeql/rust/elements/StructExprField.qll 3eb9f17ecd1ad38679689eb4ecc169d3a0b5b7a3fc597ae5a957a7aea2f74e4f 8fcd26f266f203004899a60447ba16e7eae4e3a654fbec7f54e26857730ede93 lib/codeql/rust/elements/StructExprFieldList.qll 6efb2ec4889b38556dc679bb89bbd4bd76ed6a60014c41f8e232288fc23b2d52 dc867a0a4710621e04b36bbec7d317d6f360e0d6ac68b79168c8b714babde31d @@ -174,7 +175,7 @@ lib/codeql/rust/elements/TypeRepr.qll ea41b05ef0aaac71da460f9a6a8331cf98166f2c38 lib/codeql/rust/elements/UnderscoreExpr.qll 233661b82b87c8cda16d8f2e17965658c3dc6b69efb23cb8eb9c4f50c68521e0 8edff8e80aac2ecf83a6b58f310cab688cbaeea0a0e68a298b644e565960cc74 lib/codeql/rust/elements/Unextracted.qll 12e60c79ef5b94d72b579b19970622e7b73822ebc13fbcfedfe953527ab1ac36 ec015db2eb12c3c82693ddc71d32d9ab9ef7a958e741e2510681bb707ceca23e lib/codeql/rust/elements/Unimplemented.qll bf624d28163e5c99accda16c0c99f938bec4a3b1b920a463e86fc8529ff5ff02 013bc7777298d250338f835cd494b5a8accea2d6a4f9561851f283ac129a446b -lib/codeql/rust/elements/Union.qll f035871f9d265a002f8a4535da11d6191f04337c1d22dc54f545e3b527067e20 fdb86022a4f4f7e323899aaf47741d0a4c4e6a987fe1b4e8fea24e28b1377177 +lib/codeql/rust/elements/Union.qll 3e277155fc7ea77f645cb5c5b227efd1474aa745b12a8be228eab694536c49dc a4bf9b54b8262517371000a842e5fdcdaabd324e52afd7919bbf76bc887b18b6 lib/codeql/rust/elements/Use.qll fdcf70574403c2f219353211b6930f2f9bc79f41c2594e07548de5a8c6cbb24d e41f2b689fcbeb7b84c7ba8d09592f7561626559318642b73574bbac83f74546 lib/codeql/rust/elements/UseBoundGenericArg.qll f16903f8fff676d3700eaad5490804624391141472ecc3166ccb1f70c794c120 5efda98088d096b42f53ceccae78c05f15c6953525b514d849681cb2cf65b147 lib/codeql/rust/elements/UseBoundGenericArgs.qll d9821a82a1d57e609fdc5e79d65e9a88b0088f51d03927e09f41b6931d3484ab 181483a95e22622c7cee07cce87e9476053f824a82e67e2bdecabf5a39f672ad @@ -192,6 +193,7 @@ lib/codeql/rust/elements/YeetExpr.qll 4172bf70de31cab17639da6eed4a12a7afcefd7aa9 lib/codeql/rust/elements/YieldExpr.qll de2dc096a077f6c57bba9d1c2b2dcdbecce501333753b866d77c3ffbe06aa516 1f3e8949689c09ed356ff4777394fe39f2ed2b1e6c381fd391790da4f5d5c76a lib/codeql/rust/elements/internal/AbiConstructor.qll 4484538db49d7c1d31c139f0f21879fceb48d00416e24499a1d4b1337b4141ac 460818e397f2a1a8f2e5466d9551698b0e569d4640fcb87de6c4268a519b3da1 lib/codeql/rust/elements/internal/AbiImpl.qll 28a2b6bdb38fd626e5d7d1ed29b839b95976c3a03717d840669eb17c4d6f0c7a 8e83877855abe760f3be8f45c2cf91c1f6e810ec0301313910b8104b2474d9cf +lib/codeql/rust/elements/internal/AdtImpl.qll 2dc727a14a0fc775512d35e224eab7955884ec143dbd7dbf4cada9a1f5516df4 f3991cea544c5537b0a810492979a317b47685e1c0e58b948df2a957c7a18fdc lib/codeql/rust/elements/internal/ArgListConstructor.qll a73685c8792ae23a2d628e7357658efb3f6e34006ff6e9661863ef116ec0b015 0bee572a046e8dfc031b1216d729843991519d94ae66280f5e795d20aea07a22 lib/codeql/rust/elements/internal/ArgListImpl.qll 0903b2ca31b3e5439f631582d12f17d77721d63fdb54dc41372d19b742881ce4 2c71c153ccca4b4988e6a25c37e58dc8ecb5a7483273afff563a8542f33e7949 lib/codeql/rust/elements/internal/ArrayExprInternal.qll 07a219b3d3fba3ff8b18e77686b2f58ab01acd99e0f5d5cad5d91af937e228f5 7528fc0e2064c481f0d6cbff3835950a044e429a2cd00c4d8442d2e132560d37 @@ -459,6 +461,7 @@ lib/codeql/rust/elements/internal/YieldExprConstructor.qll 8cbfa6405acb151ee31cc lib/codeql/rust/elements/internal/YieldExprImpl.qll af184649a348ddd0be16dee9daae307240bf123ace09243950342e9d71ededd9 17df90f67dd51623e8a5715b344ccd8740c8fc415af092469f801b99caacb70d lib/codeql/rust/elements/internal/generated/Abi.qll f5a22afe5596c261b4409395056ce3227b25d67602d51d0b72734d870f614df3 06d1c242ccd31f1cc90212823077e1a7a9e93cd3771a14ebe2f0659c979f3dd1 lib/codeql/rust/elements/internal/generated/Addressable.qll 96a8b45166dd035b8d2c6d36b8b67019f2d4d0b4ccff6d492677c0c87197613e d8f1ce29feafc8ff7179399fc7eac5db031a7e1a8bc6b2cd75cfce1da3132e9b +lib/codeql/rust/elements/internal/generated/Adt.qll 155f4025a26c3d2d5d3c42dfce9274a10f0862ea0574843c5d276179de421569 17138b271eea81d3ee2697c82cccfd7af752cd18cd925dd5fa20d7fce0e2432f lib/codeql/rust/elements/internal/generated/ArgList.qll e41f48258082876a8ceac9107209d94fdd00a62d2e4c632987a01a8394c4aff6 bf1982d14f8cd55fa0c3da2c6aab56fc73b15a3572ffc72d9a94f2c860f8f3b7 lib/codeql/rust/elements/internal/generated/ArrayExpr.qll 73806a0de8168b38a9436fa6b8c6d68c92eeab3d64a1ae7edfff82f871929992 7ad998cdd8f4fed226473517ad7a5765cb35608033047aad53bf8aa3969fd03b lib/codeql/rust/elements/internal/generated/ArrayExprInternal.qll 67a7b0fae04b11cf771727ff39a123fb2d5ce6e2d650d32478fcb33a26ed5688 15833405fa85f6abe0e5146dac283cb5a142a07f08300ccc15a1dae30ed88942 @@ -505,7 +508,7 @@ lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83 lib/codeql/rust/elements/internal/generated/Crate.qll 37f3760d7c0c1c3ca809d07daf7215a8eae6053eda05e88ed7db6e07f4db0781 649a3d7cd7ee99f95f8a4d3d3c41ea2fa848ce7d8415ccbac62977dfc9a49d35 lib/codeql/rust/elements/internal/generated/DynTraitTypeRepr.qll b2e0e728b6708923b862d9d8d6104d13f572da17e393ec1485b8465e4bfdc206 4a87ea9669c55c4905ce4e781b680f674989591b0cb56af1e9fa1058c13300b3 lib/codeql/rust/elements/internal/generated/Element.qll d56d22c060fa929464f837b1e16475a4a2a2e42d68235a014f7369bcb48431db 0e48426ca72179f675ac29aa49bbaadb8b1d27b08ad5cbc72ec5a005c291848e -lib/codeql/rust/elements/internal/generated/Enum.qll ad2a79ae52665f88a41ee045adce4e60beb43483547d958f8230b9917824f0a1 cb12e304d04dffb4d8fb838eb9dbecf00fa8ac18fbf3edc37ee049ad248a4f67 +lib/codeql/rust/elements/internal/generated/Enum.qll 477eaa102c1268f0fa7603ecd88f1b83db1388c17c25e3719d4113ea980256f7 2d60db61ba4a385218f0a01e366e04ba1e7dad386b7e6a027c31f32fb730cca2 lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8 lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b lib/codeql/rust/elements/internal/generated/ExternBlock.qll e7faac92297a53ac6e0420eec36255a54f360eeb962bf663a00da709407832dd 5ff32c54ec7097d43cc3311492090b9b90f411eead3bc849f258858f29405e81 @@ -577,7 +580,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll eaa0cd4402d3665013d47e lib/codeql/rust/elements/internal/generated/ParenExpr.qll 812d2ff65079277f39f15c084657a955a960a7c1c0e96dd60472a58d56b945eb eb8c607f43e1fcbb41f37a10de203a1db806690e10ff4f04d48ed874189cb0eb lib/codeql/rust/elements/internal/generated/ParenPat.qll 24f9dc7fce75827d6fddb856cd48f80168143151b27295c0bab6db5a06567a09 ebadbc6f5498e9ed754b39893ce0763840409a0721036a25b56e1ead7dcc09aa lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 03f5c5b96a37adeb845352d7fcea3e098da9050e534972d14ac0f70d60a2d776 ed3d6e5d02086523087adebce4e89e35461eb95f2a66d1d4100fe23fc691b126 -lib/codeql/rust/elements/internal/generated/ParentChild.qll 5278b74de04d54708f078fd813d83ae5f934fa12d420b188c1334e3a7c3b8324 61cf70eb649f241e2fcd5e0ba34df63f3a14f07032811b9ae151721783a0fd20 +lib/codeql/rust/elements/internal/generated/ParentChild.qll b58a01c0d2cca085a77ed7a98a0318cfc20450e48c64124f8a875ae45416ac25 92e9b6434629508868a5cf69c1236729409dcab4c4cda63af537d591a840127a lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll d901fdc8142a5b8847cc98fc2afcfd16428b8ace4fbffb457e761b5fd3901a77 5dbb0aea5a13f937da666ccb042494af8f11e776ade1459d16b70a4dd193f9fb lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -592,7 +595,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 8d0ea4f6c7f8203340bf lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll b6e439cc24f8c02fe73301cd2bc16d59dfd28e2a8a201388d8318c43937309e2 62139c3df2f6c4dca1c897b1384233ff0151b7e5fb1c41a178c5e8e41b5e7f05 +lib/codeql/rust/elements/internal/generated/Raw.qll f9370ca510d47144f7a22255341dc0f45407fcc8c22d42a74dbc423a68a36635 2301eb8a7b4d59c05413e07f95fe9ac2d0f42d3673d9b7e809bd49a6c1bee506 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 5b0663a6d234572fb3e467e276d019415caa95ef006438cc59b7af4e1783161e 0e27c8a8f0e323c0e4d6db01fca821bf07c0864d293cdf96fa891b10820c1e4b @@ -609,7 +612,7 @@ lib/codeql/rust/elements/internal/generated/SourceFile.qll 4bc95c88b49868d1da1a8 lib/codeql/rust/elements/internal/generated/Static.qll 34a4cdb9f4a93414499a30aeeaad1b3388f2341c982af5688815c3b0a0e9c57b 3c8354336eff68d580b804600df9abf49ee5ee10ec076722089087820cefe731 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll 816aebf8f56e179f5f0ba03e80d257ee85459ea757392356a0af6dbd0cd9ef5e 6aa51cdcdc8d93427555fa93f0e84afdfbbd4ffc8b8d378ae4a22b5b6f94f48b -lib/codeql/rust/elements/internal/generated/Struct.qll 955c7e1e6453685fbc392e32514cf26a9aec948cecf9e62705ddc5c56c9dc97d cf47a9c53eebc0c7165985cd6120530b8a0fe965895d2293d01f7b95013c0102 +lib/codeql/rust/elements/internal/generated/Struct.qll ce40dd64d61f6ca0a8425019dd8368ca3d79d3a238d7afb9b3f1c86c2c95c1b5 214946f9cdbf134a181d98b02bb630504ad524541febc4c0b8490a9a6fab8750 lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll 298d33442d1054922d2f97133a436ee559f1f35b7708523284d1f7eee7ebf443 7febe38a79fadf3dcb53fb8f8caf4c2780f5df55a1f8336269c7b674d53c6272 @@ -618,7 +621,7 @@ lib/codeql/rust/elements/internal/generated/StructFieldList.qll 5da528a51a6a5db9 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf lib/codeql/rust/elements/internal/generated/StructPatFieldList.qll 1a95a1bd9f64fb18e9571657cf2d02a8b13c747048a1f0f74baf31b91f0392ad fc274e414ff4ed54386046505920de92755ad0b4d39a7523cdffa4830bd53b37 -lib/codeql/rust/elements/internal/generated/Synth.qll eb248f4e57985ec8eabf9ed5cfb8ba8f5ebd6ca17fb712c992811bced0e342d4 bbcbdba484d3b977a0d6b9158c5fa506f59ced2ad3ae8239d536bf826bfb7e31 +lib/codeql/rust/elements/internal/generated/Synth.qll ef45765a8e077bc0168ec226b3b84902acd8d774cd7af637e0b1b1b16ff1deaf 58dd7076517e5d680c6d8b0489530bd8e1d15d629a233f1742cca3f028d5ec81 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 1a3c4f5f30659738641abdd28cb793dab3cfde484196b59656fc0a2767e53511 de2ebb210c7759ef7a6f7ee9f805e1cac879221287281775fc80ba34a5492edf @@ -640,7 +643,7 @@ lib/codeql/rust/elements/internal/generated/TypeRepr.qll 1e7b9d2ddab86e35dad7c31 lib/codeql/rust/elements/internal/generated/UnderscoreExpr.qll b3780c99c5d57159bef4c6bd2fd8ec44ebd1854c892c1ca776c740f71249e58c 2fd451cbf0a779e8042e439882e7d9cadc19d1e596df3bbb086d16f2596407c7 lib/codeql/rust/elements/internal/generated/Unextracted.qll 01563dfd769d6dc3c6b8a40d9a4dc0d99a3b6a0c6725c180d2bf4d7633929a17 a93ce90f8c03f4305e59de9c63f089fc7935298fc9a73d091d76933cf63e790c lib/codeql/rust/elements/internal/generated/Unimplemented.qll a3eb304781991bff1227de1e4422b68bf91e7b344e4f6c9e874b324e82a35e60 6bc4839fda3850a56dc993b79ef9ba921008395c8432b184e14438fba4566f21 -lib/codeql/rust/elements/internal/generated/Union.qll 0d5528d9331cc7599f0c7bc4d2b17908a9f90037bc94b8b7cd8bed058df98e45 986b33efddc36ff34acaf3d38bd3f90055aa14ec018432f5d4510037fc8ee59f +lib/codeql/rust/elements/internal/generated/Union.qll 328d714dba5b19f8bf94c17efee21c9ca9e693a3a568a2afed3dc0d03fcc3f50 9be7039ce837a3217e97f64c8667d78e4d69e19c8fe7c19198389acb83a15957 lib/codeql/rust/elements/internal/generated/Use.qll cf95b5c4756b25bee74113207786e37464ffbc0fb5f776a04c651300afc53753 1fe26b3904db510184cb688cb0eeb0a8dbac7ac15e27a3b572d839743c738393 lib/codeql/rust/elements/internal/generated/UseBoundGenericArg.qll 69162794e871291545ea04f61259b2d000671a96f7ca129f7dd9ed6e984067c4 31de9ebc0634b38e2347e0608b4ea888892f1f2732a2892464078cd8a07b4ee8 lib/codeql/rust/elements/internal/generated/UseBoundGenericArgs.qll 2cc8ab0068b7bf44ca17a62b32a8dd1d89cd743532c8a96b262b164fd81b0c36 347e7709a0f5ace197beb6827f6cf04a31ff68ff2dff3707914c6b910658d00a @@ -656,7 +659,7 @@ lib/codeql/rust/elements/internal/generated/WhileExpr.qll 0353aab87c49569e1fbf58 lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll da721d51bc659921998521579df5bff6172d9079d8e243c2b65a5b9eb441b52e da721d51bc659921998521579df5bff6172d9079d8e243c2b65a5b9eb441b52e +lib/codeql/rust/elements.qll 34c5c8e6e25cce86f0617d552f788eb30ad8bb24fbc43723af962ce9cdc7d177 34c5c8e6e25cce86f0617d552f788eb30ad8bb24fbc43723af962ce9cdc7d177 test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 @@ -772,10 +775,11 @@ test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.ql 39dae987 test/extractor-tests/generated/Crate/MISSING_SOURCE.txt b6cf5771fdbbe981aeb3f443ec7a40517b6e99ffc9817fd8872c2e344240dae1 b6cf5771fdbbe981aeb3f443ec7a40517b6e99ffc9817fd8872c2e344240dae1 test/extractor-tests/generated/DynTraitTypeRepr/DynTraitTypeRepr.ql 513d64b564f359e1022ae6f3d6d4a8ad637f595f01f29a6c2a167d1c2e8f1f99 0c7a7af6ee1005126b9ab77b2a7732821f85f1d2d426312c98206cbbedc19bb2 test/extractor-tests/generated/DynTraitTypeRepr/DynTraitTypeRepr_getTypeBoundList.ql b20720ff0b147d55cea6f2de44d5bf297e79991eaf103938ccd7ab9d129e9656 eb8c9db2581cea00c29d7772de0b0a125be02c37092217a419f1a2b6a9711a6c -test/extractor-tests/generated/Enum/Enum.ql eebc780aef77b87e6062724dd8ddb8f3ad33021061c95924c2c2439798ffbb87 0d19552872a2254f66a78b999a488ce2becdb0b0611b858e0bee2b119ee08eae +test/extractor-tests/generated/Enum/Enum.ql 7c96c17f4adae679a7a8b097c5bfb26978263398b77dfa6e5b0e7f547d8bbd64 18375fad5a3d574c627b563529fa9c03f7d140e872ce7db81895fcb8da87f001 test/extractor-tests/generated/Enum/Enum_getAttr.ql 8109ef2495f4a154e3bb408d549a16c6085e28de3aa9b40b51043af3d007afa7 868cf275a582266ffa8da556d99247bc8af0fdf3b43026c49e250cf0cac64687 test/extractor-tests/generated/Enum/Enum_getAttributeMacroExpansion.ql 571ec6396fb7fc703b23aab651b3c6c05c9b5cd9d69a9ae8f5e36d69a18c89d3 c04025992f76bce7638728847f1ef835d3a48d3dc3368a4d3b73b778f1334618 test/extractor-tests/generated/Enum/Enum_getCrateOrigin.ql 76d32838b7800ed8e5cab895c9dbea76129f96afab949598bebec2b0cb34b7ff 226d099377c9d499cc614b45aa7e26756124d82f07b797863ad2ac6a6b2f5acb +test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql c7d3c2f1661a0a39bacf7f4977bd484133d9ee3934956d33f77ae1c83145b027 f5e374a3b620d3ef69bcc23123598179bcb4f1167dd29c18c84ad05c94c7957b test/extractor-tests/generated/Enum/Enum_getExtendedCanonicalPath.ql 001bb634adc4b20afb241bff41194bc91ba8544d1edd55958a01975e2ac428e1 c7c3fe3dc22a1887981a895a1e5262b1d0ad18f5052c67aa73094586de5212f6 test/extractor-tests/generated/Enum/Enum_getGenericParamList.ql 2a858a07195a4b26b8c92e28519995bd6eba64889bddd126e161038f4a8d78e0 db188f238db915c67b084bc85aa0784c6a20b97b5a5f1966b3530c4c945b5527 test/extractor-tests/generated/Enum/Enum_getName.ql 32a8638534f37bfd416a6906114a3bcaf985af118a165b78f2c8fffd9f1841b8 c9ca8030622932dd6ceab7d41e05f86b923f77067b457fb7ec196fe4f4155397 @@ -1091,10 +1095,11 @@ test/extractor-tests/generated/StmtList/StmtList.ql 0010df0d5e30f7bed3bd5d916faf test/extractor-tests/generated/StmtList/StmtList_getAttr.ql 78d4bf65273498f04238706330b03d0b61dd03b001531f05fcb2230f24ceab64 6e02cee05c0b9f104ddea72b20097034edb76e985188b3f10f079bb03163b830 test/extractor-tests/generated/StmtList/StmtList_getStatement.ql abbc3bcf98aab395fc851d5cc58c9c8a13fe1bdd531723bec1bc1b8ddbec6614 e302a26079986fa055306a1f641533dfde36c9bc0dd7958d21e2518b59e808c2 test/extractor-tests/generated/StmtList/StmtList_getTailExpr.ql 578d7c944ef42bdb822fc6ce52fe3d49a0012cf7854cfddbb3d5117133700587 64ea407455a3b4dfbb86202e71a72b5abbff885479367b2834c0dd16d1f9d0ee -test/extractor-tests/generated/Struct/Struct.ql a4e5d3fe4f994bdf911ebed54a65d237cd5a00510337e911bd5286637bc8ea80 a335224605f3cc35635bf5fd0bebcb50800429c0a82a5aa86a37cb9f6eb3f651 +test/extractor-tests/generated/Struct/Struct.ql ffaaa49314c26bd0a206b692d480254acc6e87233f679fbe936094c81c071de2 cae27f50c3bf787aead37077c9fe32e66c1a247a8a8c1f6f9b241493b1b793fc test/extractor-tests/generated/Struct/Struct_getAttr.ql 028d90ddc5189b82cfc8de20f9e05d98e8a12cc185705481f91dd209f2cb1f87 760780a48c12be4581c1675c46aae054a6198196a55b6b989402cc29b7caf245 test/extractor-tests/generated/Struct/Struct_getAttributeMacroExpansion.ql a17504527a307615d26c2c4b6c21fe9b508f5a77a741d68ca605d2e69668e385 f755d8965c10568a57ff44432a795a0a36b86007fc7470bc652d555946e19231 test/extractor-tests/generated/Struct/Struct_getCrateOrigin.ql 289622244a1333277d3b1507c5cea7c7dd29a7905774f974d8c2100cea50b35f d32941a2d08d7830b42c263ee336bf54de5240bfc22082341b4420a20a1886c7 +test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql e4849a63be9f413426dd0f183d1229fa4dd1c521e87479622a80c52179e3bb03 5ae88d61ffa7b0a52a62fd16ba5cc5816c2b7b2c0db726e3125e525bbbc10a18 test/extractor-tests/generated/Struct/Struct_getExtendedCanonicalPath.ql 866a5893bd0869224fb8aadd071fba35b5386183bb476f5de45c9de7ab88c583 267aedc228d69e31ca8e95dcab6bcb1aa30f9ebaea43896a55016b7d68e3c441 test/extractor-tests/generated/Struct/Struct_getFieldList.ql f45d6d5d953741e52aca67129994b80f6904b2e6b43c519d6d42c29c7b663c42 77a7d07e8462fa608efc58af97ce8f17c5369f9573f9d200191136607cb0e600 test/extractor-tests/generated/Struct/Struct_getGenericParamList.ql cd72452713004690b77086163541fa319f8ab5faf503bb4a6a20bcaf2f790d38 4d72e891c5fac6e491d9e18b87ecf680dc423787d6b419da8f700fe1a14bc26f @@ -1206,10 +1211,11 @@ test/extractor-tests/generated/TypeParam/TypeParam_getName.ql 9d5b6d6a9f2a5793e2 test/extractor-tests/generated/TypeParam/TypeParam_getTypeBoundList.ql 080a6b370ad460bf128fdfd632aa443af2ad91c3483e192ad756eb234dbfa4d8 8b048d282963f670db357f1eef9b8339f83d03adf57489a22b441d5c782aff62 test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql 4ad6ed0c803fb4f58094a55b866940b947b16259756c674200172551ee6546e0 d3270bdcc4c026325159bd2a59848eb51d96298b2bf21402ea0a83ac1ea6d291 test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr_getAttr.ql d8502be88bcd97465f387c410b5078a4709e32b2baa556a4918ea5e609c40dd7 b238dc37404254e3e7806d50a7b1453e17e71da122931331b16a55853d3a843f -test/extractor-tests/generated/Union/Union.ql 2795c83d4511fadf24cc66a762adbabca084bc6ac48501715f666979d2ea9ea5 7efae5209ae3ee8c73cd1c9e9e05f01b3fdda65d9a553c2ac5216351b6f15e5c +test/extractor-tests/generated/Union/Union.ql 4974339feb10ab65bef60ba713058cb73ba7dcf5e451ddf6c919e94f96f56a80 f0f0025666940e4b0f72ef2e64b28e96b1a410f25f56c98cbebdd019ceece7b6 test/extractor-tests/generated/Union/Union_getAttr.ql 42fa0878a6566208863b1d884baf7b68b46089827fdb1dbbfacbfccf5966a9a2 54aa94f0281ca80d1a4bdb0e2240f4384af2ab8d50f251875d1877d0964579fc test/extractor-tests/generated/Union/Union_getAttributeMacroExpansion.ql ddd0133a497dc057a353b86acc8ed991fefeaefa335d8ad9fe95109a90e39e54 fcaed4287815226843157c007674b1f1405cae31856fed1113d569bab5608d9b test/extractor-tests/generated/Union/Union_getCrateOrigin.ql c218308cf17b1490550229a725542d248617661b1a5fa14e9b0e18d29c5ecc00 e0489242c8ff7aa4dbfdebcd46a5e0d9bea0aa618eb0617e76b9b6f863a2907a +test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql 82ee99ea42d6de9a45289a4b8e750cba887ac9daa2f6387b8c2a9062224da45c 1f18cd80f93ca2e19d3ac8ce733f264522ba785078f541342c816e16194748d6 test/extractor-tests/generated/Union/Union_getExtendedCanonicalPath.ql 6268ddb68c3e05906e3fc85e40635925b84e5c7290746ded9c6814d362033068 04473b3b9891012e95733463018db8da0e96659ea0b10458b33dc857c091d278 test/extractor-tests/generated/Union/Union_getGenericParamList.ql c55156ae26b766e385be7d21e67f8c3c45c29274201c93d660077fcc47e1ceee 4c4d338e17c32876ef6e51fd19cff67d125dd89c10e939dfaadbac824bef6a68 test/extractor-tests/generated/Union/Union_getName.ql 17247183e1a8c8bbb15e67120f65ca323630bddeb614fa8a48e1e74319f8ed37 e21c2a0205bc991ba86f3e508451ef31398bdf5441f6d2a3f72113aaae9e152b diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 65c3aae0e9e1..e847ecd7644e 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -3,6 +3,7 @@ /lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll linguist-generated /lib/codeql/rust/elements/Abi.qll linguist-generated /lib/codeql/rust/elements/Addressable.qll linguist-generated +/lib/codeql/rust/elements/Adt.qll linguist-generated /lib/codeql/rust/elements/ArgList.qll linguist-generated /lib/codeql/rust/elements/ArrayExpr.qll linguist-generated /lib/codeql/rust/elements/ArrayListExpr.qll linguist-generated @@ -194,6 +195,7 @@ /lib/codeql/rust/elements/YieldExpr.qll linguist-generated /lib/codeql/rust/elements/internal/AbiConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/AbiImpl.qll linguist-generated +/lib/codeql/rust/elements/internal/AdtImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ArgListConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/ArgListImpl.qll linguist-generated /lib/codeql/rust/elements/internal/ArrayExprInternal.qll linguist-generated @@ -461,6 +463,7 @@ /lib/codeql/rust/elements/internal/YieldExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Abi.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Addressable.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/Adt.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ArgList.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ArrayExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ArrayExprInternal.qll linguist-generated @@ -778,6 +781,7 @@ /test/extractor-tests/generated/Enum/Enum_getAttr.ql linguist-generated /test/extractor-tests/generated/Enum/Enum_getAttributeMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Enum/Enum_getCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Enum/Enum_getExtendedCanonicalPath.ql linguist-generated /test/extractor-tests/generated/Enum/Enum_getGenericParamList.ql linguist-generated /test/extractor-tests/generated/Enum/Enum_getName.ql linguist-generated @@ -1097,6 +1101,7 @@ /test/extractor-tests/generated/Struct/Struct_getAttr.ql linguist-generated /test/extractor-tests/generated/Struct/Struct_getAttributeMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Struct/Struct_getCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Struct/Struct_getExtendedCanonicalPath.ql linguist-generated /test/extractor-tests/generated/Struct/Struct_getFieldList.ql linguist-generated /test/extractor-tests/generated/Struct/Struct_getGenericParamList.ql linguist-generated @@ -1212,6 +1217,7 @@ /test/extractor-tests/generated/Union/Union_getAttr.ql linguist-generated /test/extractor-tests/generated/Union/Union_getAttributeMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Union/Union_getCrateOrigin.ql linguist-generated +/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql linguist-generated /test/extractor-tests/generated/Union/Union_getExtendedCanonicalPath.ql linguist-generated /test/extractor-tests/generated/Union/Union_getGenericParamList.ql linguist-generated /test/extractor-tests/generated/Union/Union_getName.ql linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index 4456cb4b44ae..0ae5e4a95140 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -6,6 +6,7 @@ import codeql.files.FileSystem import codeql.rust.elements.Abi import codeql.rust.elements.Addressable +import codeql.rust.elements.Adt import codeql.rust.elements.ArgList import codeql.rust.elements.ArrayExpr import codeql.rust.elements.ArrayListExpr diff --git a/rust/ql/lib/codeql/rust/elements/Adt.qll b/rust/ql/lib/codeql/rust/elements/Adt.qll new file mode 100644 index 000000000000..c8fa30d743db --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/Adt.qll @@ -0,0 +1,13 @@ +// generated by codegen, do not edit +/** + * This module provides the public class `Adt`. + */ + +private import internal.AdtImpl +import codeql.rust.elements.Item +import codeql.rust.elements.MacroItems + +/** + * An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. + */ +final class Adt = Impl::Adt; diff --git a/rust/ql/lib/codeql/rust/elements/Enum.qll b/rust/ql/lib/codeql/rust/elements/Enum.qll index 3901b3827232..9d52b558f538 100644 --- a/rust/ql/lib/codeql/rust/elements/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/Enum.qll @@ -4,9 +4,9 @@ */ private import internal.EnumImpl +import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Struct.qll b/rust/ql/lib/codeql/rust/elements/Struct.qll index 9b57316e0ec6..27b6a37b7913 100644 --- a/rust/ql/lib/codeql/rust/elements/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/Struct.qll @@ -4,10 +4,10 @@ */ private import internal.StructImpl +import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Union.qll b/rust/ql/lib/codeql/rust/elements/Union.qll index fac11390b1bf..4bf596f4d7a4 100644 --- a/rust/ql/lib/codeql/rust/elements/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/Union.qll @@ -4,9 +4,9 @@ */ private import internal.UnionImpl +import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.VariantDef diff --git a/rust/ql/lib/codeql/rust/elements/internal/AdtImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/AdtImpl.qll new file mode 100644 index 000000000000..2243aed17a34 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/AdtImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `Adt`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.Adt + +/** + * INTERNAL: This module contains the customizable definition of `Adt` and should not + * be referenced directly. + */ +module Impl { + /** + * An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. + */ + class Adt extends Generated::Adt { } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Adt.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Adt.qll new file mode 100644 index 000000000000..385e3930fb89 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Adt.qll @@ -0,0 +1,45 @@ +// generated by codegen, do not edit +/** + * This module provides the generated definition of `Adt`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.elements.internal.generated.Synth +private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl +import codeql.rust.elements.MacroItems + +/** + * INTERNAL: This module contains the fully generated definition of `Adt` and should not + * be referenced directly. + */ +module Generated { + /** + * An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. + * INTERNAL: Do not reference the `Generated::Adt` class directly. + * Use the subclass `Adt`, where the following predicates are available. + */ + class Adt extends Synth::TAdt, ItemImpl::Item { + /** + * Gets the `index`th derive macro expansion of this adt (0-based). + */ + MacroItems getDeriveMacroExpansion(int index) { + result = + Synth::convertMacroItemsFromRaw(Synth::convertAdtToRaw(this) + .(Raw::Adt) + .getDeriveMacroExpansion(index)) + } + + /** + * Gets any of the derive macro expansions of this adt. + */ + final MacroItems getADeriveMacroExpansion() { result = this.getDeriveMacroExpansion(_) } + + /** + * Gets the number of derive macro expansions of this adt. + */ + final int getNumberOfDeriveMacroExpansions() { + result = count(int i | exists(this.getDeriveMacroExpansion(i))) + } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll index ec5c97892f5f..b829ead848cc 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll @@ -6,9 +6,9 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility @@ -29,7 +29,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Enum` class directly. * Use the subclass `Enum`, where the following predicates are available. */ - class Enum extends Synth::TEnum, ItemImpl::Item { + class Enum extends Synth::TEnum, AdtImpl::Adt { override string getAPrimaryQlClass() { result = "Enum" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index 5c8e5f868204..a0ccc4d728b2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -3164,6 +3164,24 @@ private module Impl { ) } + private Element getImmediateChildOfAdt(Adt e, int index, string partialPredicateCall) { + exists(int b, int bItem, int n, int nDeriveMacroExpansion | + b = 0 and + bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and + n = bItem and + nDeriveMacroExpansion = + n + 1 + max(int i | i = -1 or exists(e.getDeriveMacroExpansion(i)) | i) and + ( + none() + or + result = getImmediateChildOfItem(e, index - b, partialPredicateCall) + or + result = e.getDeriveMacroExpansion(index - n) and + partialPredicateCall = "DeriveMacroExpansion(" + (index - n).toString() + ")" + ) + ) + } + private Element getImmediateChildOfArrayListExpr( ArrayListExpr e, int index, string partialPredicateCall ) { @@ -3275,47 +3293,6 @@ private module Impl { ) } - private Element getImmediateChildOfEnum(Enum e, int index, string partialPredicateCall) { - exists( - int b, int bItem, int n, int nAttr, int nGenericParamList, int nName, int nVariantList, - int nVisibility, int nWhereClause - | - b = 0 and - bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and - n = bItem and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nGenericParamList = nAttr + 1 and - nName = nGenericParamList + 1 and - nVariantList = nName + 1 and - nVisibility = nVariantList + 1 and - nWhereClause = nVisibility + 1 and - ( - none() - or - result = getImmediateChildOfItem(e, index - b, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and - result = e.getGenericParamList() and - partialPredicateCall = "GenericParamList()" - or - index = nGenericParamList and result = e.getName() and partialPredicateCall = "Name()" - or - index = nName and result = e.getVariantList() and partialPredicateCall = "VariantList()" - or - index = nVariantList and - result = e.getVisibility() and - partialPredicateCall = "Visibility()" - or - index = nVisibility and - result = e.getWhereClause() and - partialPredicateCall = "WhereClause()" - ) - ) - } - private Element getImmediateChildOfExternBlock( ExternBlock e, int index, string partialPredicateCall ) { @@ -3730,49 +3707,6 @@ private module Impl { ) } - private Element getImmediateChildOfStruct(Struct e, int index, string partialPredicateCall) { - exists( - int b, int bItem, int bVariantDef, int n, int nAttr, int nFieldList, int nGenericParamList, - int nName, int nVisibility, int nWhereClause - | - b = 0 and - bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and - bVariantDef = - bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and - n = bVariantDef and - nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nFieldList = nAttr + 1 and - nGenericParamList = nFieldList + 1 and - nName = nGenericParamList + 1 and - nVisibility = nName + 1 and - nWhereClause = nVisibility + 1 and - ( - none() - or - result = getImmediateChildOfItem(e, index - b, partialPredicateCall) - or - result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) - or - result = e.getAttr(index - n) and - partialPredicateCall = "Attr(" + (index - n).toString() + ")" - or - index = nAttr and result = e.getFieldList() and partialPredicateCall = "FieldList()" - or - index = nFieldList and - result = e.getGenericParamList() and - partialPredicateCall = "GenericParamList()" - or - index = nGenericParamList and result = e.getName() and partialPredicateCall = "Name()" - or - index = nName and result = e.getVisibility() and partialPredicateCall = "Visibility()" - or - index = nVisibility and - result = e.getWhereClause() and - partialPredicateCall = "WhereClause()" - ) - ) - } - private Element getImmediateChildOfStructExpr(StructExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int bPathAstNode, int n, int nStructExprFieldList | b = 0 and @@ -3978,28 +3912,47 @@ private module Impl { ) } - private Element getImmediateChildOfUnion(Union e, int index, string partialPredicateCall) { + private Element getImmediateChildOfUse(Use e, int index, string partialPredicateCall) { + exists(int b, int bItem, int n, int nAttr, int nUseTree, int nVisibility | + b = 0 and + bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and + n = bItem and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nUseTree = nAttr + 1 and + nVisibility = nUseTree + 1 and + ( + none() + or + result = getImmediateChildOfItem(e, index - b, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and result = e.getUseTree() and partialPredicateCall = "UseTree()" + or + index = nUseTree and result = e.getVisibility() and partialPredicateCall = "Visibility()" + ) + ) + } + + private Element getImmediateChildOfEnum(Enum e, int index, string partialPredicateCall) { exists( - int b, int bItem, int bVariantDef, int n, int nAttr, int nGenericParamList, int nName, - int nStructFieldList, int nVisibility, int nWhereClause + int b, int bAdt, int n, int nAttr, int nGenericParamList, int nName, int nVariantList, + int nVisibility, int nWhereClause | b = 0 and - bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and - bVariantDef = - bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and - n = bVariantDef and + bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and + n = bAdt and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and nName = nGenericParamList + 1 and - nStructFieldList = nName + 1 and - nVisibility = nStructFieldList + 1 and + nVariantList = nName + 1 and + nVisibility = nVariantList + 1 and nWhereClause = nVisibility + 1 and ( none() or - result = getImmediateChildOfItem(e, index - b, partialPredicateCall) - or - result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) + result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" @@ -4010,11 +3963,9 @@ private module Impl { or index = nGenericParamList and result = e.getName() and partialPredicateCall = "Name()" or - index = nName and - result = e.getStructFieldList() and - partialPredicateCall = "StructFieldList()" + index = nName and result = e.getVariantList() and partialPredicateCall = "VariantList()" or - index = nStructFieldList and + index = nVariantList and result = e.getVisibility() and partialPredicateCall = "Visibility()" or @@ -4025,38 +3976,37 @@ private module Impl { ) } - private Element getImmediateChildOfUse(Use e, int index, string partialPredicateCall) { - exists(int b, int bItem, int n, int nAttr, int nUseTree, int nVisibility | + private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) { + exists(int b, int bLoopingExpr, int n, int nAttr, int nIterable, int nPat | b = 0 and - bItem = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and - n = bItem and + bLoopingExpr = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and + n = bLoopingExpr and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nUseTree = nAttr + 1 and - nVisibility = nUseTree + 1 and + nIterable = nAttr + 1 and + nPat = nIterable + 1 and ( none() or - result = getImmediateChildOfItem(e, index - b, partialPredicateCall) + result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" or - index = nAttr and result = e.getUseTree() and partialPredicateCall = "UseTree()" + index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()" or - index = nUseTree and result = e.getVisibility() and partialPredicateCall = "Visibility()" + index = nIterable and result = e.getPat() and partialPredicateCall = "Pat()" ) ) } - private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) { - exists(int b, int bLoopingExpr, int n, int nAttr, int nIterable, int nPat | + private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) { + exists(int b, int bLoopingExpr, int n, int nAttr | b = 0 and bLoopingExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and n = bLoopingExpr and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nIterable = nAttr + 1 and - nPat = nIterable + 1 and ( none() or @@ -4064,28 +4014,96 @@ private module Impl { or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" + ) + ) + } + + private Element getImmediateChildOfStruct(Struct e, int index, string partialPredicateCall) { + exists( + int b, int bAdt, int bVariantDef, int n, int nAttr, int nFieldList, int nGenericParamList, + int nName, int nVisibility, int nWhereClause + | + b = 0 and + bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and + bVariantDef = + bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + n = bVariantDef and + nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nFieldList = nAttr + 1 and + nGenericParamList = nFieldList + 1 and + nName = nGenericParamList + 1 and + nVisibility = nName + 1 and + nWhereClause = nVisibility + 1 and + ( + none() or - index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()" + result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - index = nIterable and result = e.getPat() and partialPredicateCall = "Pat()" + result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) + or + result = e.getAttr(index - n) and + partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and result = e.getFieldList() and partialPredicateCall = "FieldList()" + or + index = nFieldList and + result = e.getGenericParamList() and + partialPredicateCall = "GenericParamList()" + or + index = nGenericParamList and result = e.getName() and partialPredicateCall = "Name()" + or + index = nName and result = e.getVisibility() and partialPredicateCall = "Visibility()" + or + index = nVisibility and + result = e.getWhereClause() and + partialPredicateCall = "WhereClause()" ) ) } - private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) { - exists(int b, int bLoopingExpr, int n, int nAttr | + private Element getImmediateChildOfUnion(Union e, int index, string partialPredicateCall) { + exists( + int b, int bAdt, int bVariantDef, int n, int nAttr, int nGenericParamList, int nName, + int nStructFieldList, int nVisibility, int nWhereClause + | b = 0 and - bLoopingExpr = - b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and - n = bLoopingExpr and + bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and + bVariantDef = + bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + n = bVariantDef and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + nGenericParamList = nAttr + 1 and + nName = nGenericParamList + 1 and + nStructFieldList = nName + 1 and + nVisibility = nStructFieldList + 1 and + nWhereClause = nVisibility + 1 and ( none() or - result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall) + result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" + or + index = nAttr and + result = e.getGenericParamList() and + partialPredicateCall = "GenericParamList()" + or + index = nGenericParamList and result = e.getName() and partialPredicateCall = "Name()" + or + index = nName and + result = e.getStructFieldList() and + partialPredicateCall = "StructFieldList()" + or + index = nStructFieldList and + result = e.getVisibility() and + partialPredicateCall = "Visibility()" + or + index = nVisibility and + result = e.getWhereClause() and + partialPredicateCall = "WhereClause()" ) ) } @@ -4395,8 +4413,6 @@ private module Impl { or result = getImmediateChildOfConst(e, index, partialAccessor) or - result = getImmediateChildOfEnum(e, index, partialAccessor) - or result = getImmediateChildOfExternBlock(e, index, partialAccessor) or result = getImmediateChildOfExternCrate(e, index, partialAccessor) @@ -4423,8 +4439,6 @@ private module Impl { or result = getImmediateChildOfStatic(e, index, partialAccessor) or - result = getImmediateChildOfStruct(e, index, partialAccessor) - or result = getImmediateChildOfStructExpr(e, index, partialAccessor) or result = getImmediateChildOfStructPat(e, index, partialAccessor) @@ -4437,14 +4451,18 @@ private module Impl { or result = getImmediateChildOfTypeAlias(e, index, partialAccessor) or - result = getImmediateChildOfUnion(e, index, partialAccessor) - or result = getImmediateChildOfUse(e, index, partialAccessor) or + result = getImmediateChildOfEnum(e, index, partialAccessor) + or result = getImmediateChildOfForExpr(e, index, partialAccessor) or result = getImmediateChildOfLoopExpr(e, index, partialAccessor) or + result = getImmediateChildOfStruct(e, index, partialAccessor) + or + result = getImmediateChildOfUnion(e, index, partialAccessor) + or result = getImmediateChildOfWhileExpr(e, index, partialAccessor) } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 503691bb83be..8835f4588c0c 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -3610,6 +3610,19 @@ module Raw { Expr getExpr() { yield_expr_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. + */ + class Adt extends @adt, Item { + /** + * Gets the `index`th derive macro expansion of this adt (0-based). + */ + MacroItems getDeriveMacroExpansion(int index) { + adt_derive_macro_expansions(this, index, result) + } + } + /** * INTERNAL: Do not use. * A block expression. For example: @@ -3744,49 +3757,6 @@ module Raw { predicate hasImplementation() { const_has_implementation(this) } } - /** - * INTERNAL: Do not use. - * An enum declaration. - * - * For example: - * ```rust - * enum E {A, B(i32), C {x: i32}} - * ``` - */ - class Enum extends @enum, Item { - override string toString() { result = "Enum" } - - /** - * Gets the `index`th attr of this enum (0-based). - */ - Attr getAttr(int index) { enum_attrs(this, index, result) } - - /** - * Gets the generic parameter list of this enum, if it exists. - */ - GenericParamList getGenericParamList() { enum_generic_param_lists(this, result) } - - /** - * Gets the name of this enum, if it exists. - */ - Name getName() { enum_names(this, result) } - - /** - * Gets the variant list of this enum, if it exists. - */ - VariantList getVariantList() { enum_variant_lists(this, result) } - - /** - * Gets the visibility of this enum, if it exists. - */ - Visibility getVisibility() { enum_visibilities(this, result) } - - /** - * Gets the where clause of this enum, if it exists. - */ - WhereClause getWhereClause() { enum_where_clauses(this, result) } - } - /** * INTERNAL: Do not use. * An extern block containing foreign function declarations. @@ -4273,50 +4243,6 @@ module Raw { Visibility getVisibility() { static_visibilities(this, result) } } - /** - * INTERNAL: Do not use. - * A Struct. For example: - * ```rust - * struct Point { - * x: i32, - * y: i32, - * } - * ``` - */ - class Struct extends @struct, Item, VariantDef { - override string toString() { result = "Struct" } - - /** - * Gets the `index`th attr of this struct (0-based). - */ - Attr getAttr(int index) { struct_attrs(this, index, result) } - - /** - * Gets the field list of this struct, if it exists. - */ - FieldList getFieldList() { struct_field_lists_(this, result) } - - /** - * Gets the generic parameter list of this struct, if it exists. - */ - GenericParamList getGenericParamList() { struct_generic_param_lists(this, result) } - - /** - * Gets the name of this struct, if it exists. - */ - Name getName() { struct_names(this, result) } - - /** - * Gets the visibility of this struct, if it exists. - */ - Visibility getVisibility() { struct_visibilities(this, result) } - - /** - * Gets the where clause of this struct, if it exists. - */ - WhereClause getWhereClause() { struct_where_clauses(this, result) } - } - /** * INTERNAL: Do not use. * A struct expression. For example: @@ -4540,71 +4466,71 @@ module Raw { /** * INTERNAL: Do not use. - * A union declaration. - * - * For example: + * A `use` statement. For example: * ```rust - * union U { f1: u32, f2: f32 } + * use std::collections::HashMap; * ``` */ - class Union extends @union, Item, VariantDef { - override string toString() { result = "Union" } + class Use extends @use, Item { + override string toString() { result = "Use" } /** - * Gets the `index`th attr of this union (0-based). + * Gets the `index`th attr of this use (0-based). */ - Attr getAttr(int index) { union_attrs(this, index, result) } + Attr getAttr(int index) { use_attrs(this, index, result) } /** - * Gets the generic parameter list of this union, if it exists. + * Gets the use tree of this use, if it exists. */ - GenericParamList getGenericParamList() { union_generic_param_lists(this, result) } + UseTree getUseTree() { use_use_trees(this, result) } /** - * Gets the name of this union, if it exists. + * Gets the visibility of this use, if it exists. */ - Name getName() { union_names(this, result) } + Visibility getVisibility() { use_visibilities(this, result) } + } + + /** + * INTERNAL: Do not use. + * An enum declaration. + * + * For example: + * ```rust + * enum E {A, B(i32), C {x: i32}} + * ``` + */ + class Enum extends @enum, Adt { + override string toString() { result = "Enum" } /** - * Gets the struct field list of this union, if it exists. + * Gets the `index`th attr of this enum (0-based). */ - StructFieldList getStructFieldList() { union_struct_field_lists(this, result) } + Attr getAttr(int index) { enum_attrs(this, index, result) } /** - * Gets the visibility of this union, if it exists. + * Gets the generic parameter list of this enum, if it exists. */ - Visibility getVisibility() { union_visibilities(this, result) } + GenericParamList getGenericParamList() { enum_generic_param_lists(this, result) } /** - * Gets the where clause of this union, if it exists. + * Gets the name of this enum, if it exists. */ - WhereClause getWhereClause() { union_where_clauses(this, result) } - } - - /** - * INTERNAL: Do not use. - * A `use` statement. For example: - * ```rust - * use std::collections::HashMap; - * ``` - */ - class Use extends @use, Item { - override string toString() { result = "Use" } + Name getName() { enum_names(this, result) } /** - * Gets the `index`th attr of this use (0-based). + * Gets the variant list of this enum, if it exists. */ - Attr getAttr(int index) { use_attrs(this, index, result) } + VariantList getVariantList() { enum_variant_lists(this, result) } /** - * Gets the use tree of this use, if it exists. + * Gets the visibility of this enum, if it exists. */ - UseTree getUseTree() { use_use_trees(this, result) } + Visibility getVisibility() { enum_visibilities(this, result) } /** - * Gets the visibility of this use, if it exists. + * Gets the where clause of this enum, if it exists. */ - Visibility getVisibility() { use_visibilities(this, result) } + WhereClause getWhereClause() { enum_where_clauses(this, result) } } /** @@ -4671,6 +4597,93 @@ module Raw { Attr getAttr(int index) { loop_expr_attrs(this, index, result) } } + /** + * INTERNAL: Do not use. + * A Struct. For example: + * ```rust + * struct Point { + * x: i32, + * y: i32, + * } + * ``` + */ + class Struct extends @struct, Adt, VariantDef { + override string toString() { result = "Struct" } + + /** + * Gets the `index`th attr of this struct (0-based). + */ + Attr getAttr(int index) { struct_attrs(this, index, result) } + + /** + * Gets the field list of this struct, if it exists. + */ + FieldList getFieldList() { struct_field_lists_(this, result) } + + /** + * Gets the generic parameter list of this struct, if it exists. + */ + GenericParamList getGenericParamList() { struct_generic_param_lists(this, result) } + + /** + * Gets the name of this struct, if it exists. + */ + Name getName() { struct_names(this, result) } + + /** + * Gets the visibility of this struct, if it exists. + */ + Visibility getVisibility() { struct_visibilities(this, result) } + + /** + * Gets the where clause of this struct, if it exists. + */ + WhereClause getWhereClause() { struct_where_clauses(this, result) } + } + + /** + * INTERNAL: Do not use. + * A union declaration. + * + * For example: + * ```rust + * union U { f1: u32, f2: f32 } + * ``` + */ + class Union extends @union, Adt, VariantDef { + override string toString() { result = "Union" } + + /** + * Gets the `index`th attr of this union (0-based). + */ + Attr getAttr(int index) { union_attrs(this, index, result) } + + /** + * Gets the generic parameter list of this union, if it exists. + */ + GenericParamList getGenericParamList() { union_generic_param_lists(this, result) } + + /** + * Gets the name of this union, if it exists. + */ + Name getName() { union_names(this, result) } + + /** + * Gets the struct field list of this union, if it exists. + */ + StructFieldList getStructFieldList() { union_struct_field_lists(this, result) } + + /** + * Gets the visibility of this union, if it exists. + */ + Visibility getVisibility() { union_visibilities(this, result) } + + /** + * Gets the where clause of this union, if it exists. + */ + WhereClause getWhereClause() { union_where_clauses(this, result) } + } + /** * INTERNAL: Do not use. * A while loop expression. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll index 6776d9a80072..8589273ff4cf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll @@ -6,10 +6,10 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility @@ -31,7 +31,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Struct` class directly. * Use the subclass `Struct`, where the following predicates are available. */ - class Struct extends Synth::TStruct, ItemImpl::Item, VariantDefImpl::VariantDef { + class Struct extends Synth::TStruct, AdtImpl::Adt, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Struct" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 04588e2861e7..28300de45805 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -688,6 +688,11 @@ module Synth { */ class TAddressable = TItem or TVariant; + /** + * INTERNAL: Do not use. + */ + class TAdt = TEnum or TStruct or TUnion; + /** * INTERNAL: Do not use. */ @@ -770,9 +775,9 @@ module Synth { * INTERNAL: Do not use. */ class TItem = - TConst or TEnum or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or - TMacroDef or TMacroRules or TModule or TStatic or TStruct or TTrait or TTraitAlias or - TTypeAlias or TUnion or TUse; + TAdt or TConst or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or + TMacroDef or TMacroRules or TModule or TStatic or TTrait or TTraitAlias or TTypeAlias or + TUse; /** * INTERNAL: Do not use. @@ -1864,6 +1869,18 @@ module Synth { result = convertVariantFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TAdt`, if possible. + */ + TAdt convertAdtFromRaw(Raw::Element e) { + result = convertEnumFromRaw(e) + or + result = convertStructFromRaw(e) + or + result = convertUnionFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TArrayExpr`, if possible. @@ -2213,9 +2230,9 @@ module Synth { * Converts a raw DB element to a synthesized `TItem`, if possible. */ TItem convertItemFromRaw(Raw::Element e) { - result = convertConstFromRaw(e) + result = convertAdtFromRaw(e) or - result = convertEnumFromRaw(e) + result = convertConstFromRaw(e) or result = convertExternBlockFromRaw(e) or @@ -2235,16 +2252,12 @@ module Synth { or result = convertStaticFromRaw(e) or - result = convertStructFromRaw(e) - or result = convertTraitFromRaw(e) or result = convertTraitAliasFromRaw(e) or result = convertTypeAliasFromRaw(e) or - result = convertUnionFromRaw(e) - or result = convertUseFromRaw(e) } @@ -3464,6 +3477,18 @@ module Synth { result = convertVariantToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TAdt` to a raw DB element, if possible. + */ + Raw::Element convertAdtToRaw(TAdt e) { + result = convertEnumToRaw(e) + or + result = convertStructToRaw(e) + or + result = convertUnionToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TArrayExpr` to a raw DB element, if possible. @@ -3813,9 +3838,9 @@ module Synth { * Converts a synthesized `TItem` to a raw DB element, if possible. */ Raw::Element convertItemToRaw(TItem e) { - result = convertConstToRaw(e) + result = convertAdtToRaw(e) or - result = convertEnumToRaw(e) + result = convertConstToRaw(e) or result = convertExternBlockToRaw(e) or @@ -3835,16 +3860,12 @@ module Synth { or result = convertStaticToRaw(e) or - result = convertStructToRaw(e) - or result = convertTraitToRaw(e) or result = convertTraitAliasToRaw(e) or result = convertTypeAliasToRaw(e) or - result = convertUnionToRaw(e) - or result = convertUseToRaw(e) } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll index 63f76703bcb1..88040c4ad137 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll @@ -6,9 +6,9 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl @@ -30,7 +30,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Union` class directly. * Use the subclass `Union`, where the following predicates are available. */ - class Union extends Synth::TUnion, ItemImpl::Item, VariantDefImpl::VariantDef { + class Union extends Synth::TUnion, AdtImpl::Adt, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Union" } /** diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index aa9a0bda17c7..9d208615c27d 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -1917,8 +1917,8 @@ infer_type_reprs( ); @item = - @const -| @enum + @adt +| @const | @extern_block | @extern_crate | @function @@ -1928,11 +1928,9 @@ infer_type_reprs( | @macro_rules | @module | @static -| @struct | @trait | @trait_alias | @type_alias -| @union | @use ; @@ -2714,6 +2712,19 @@ yield_expr_exprs( int expr: @expr ref ); +@adt = + @enum +| @struct +| @union +; + +#keyset[id, index] +adt_derive_macro_expansions( + int id: @adt ref, + int index: int ref, + int derive_macro_expansion: @macro_items ref +); + block_exprs( unique int id: @block_expr ); @@ -2821,47 +2832,6 @@ const_has_implementation( int id: @const ref ); -enums( - unique int id: @enum -); - -#keyset[id, index] -enum_attrs( - int id: @enum ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -enum_generic_param_lists( - int id: @enum ref, - int generic_param_list: @generic_param_list ref -); - -#keyset[id] -enum_names( - int id: @enum ref, - int name: @name ref -); - -#keyset[id] -enum_variant_lists( - int id: @enum ref, - int variant_list: @variant_list ref -); - -#keyset[id] -enum_visibilities( - int id: @enum ref, - int visibility: @visibility ref -); - -#keyset[id] -enum_where_clauses( - int id: @enum ref, - int where_clause: @where_clause ref -); - extern_blocks( unique int id: @extern_block ); @@ -3278,47 +3248,6 @@ static_visibilities( int visibility: @visibility ref ); -structs( - unique int id: @struct -); - -#keyset[id, index] -struct_attrs( - int id: @struct ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -struct_field_lists_( - int id: @struct ref, - int field_list: @field_list ref -); - -#keyset[id] -struct_generic_param_lists( - int id: @struct ref, - int generic_param_list: @generic_param_list ref -); - -#keyset[id] -struct_names( - int id: @struct ref, - int name: @name ref -); - -#keyset[id] -struct_visibilities( - int id: @struct ref, - int visibility: @visibility ref -); - -#keyset[id] -struct_where_clauses( - int id: @struct ref, - int where_clause: @where_clause ref -); - struct_exprs( unique int id: @struct_expr ); @@ -3500,68 +3429,68 @@ type_alias_where_clauses( int where_clause: @where_clause ref ); -unions( - unique int id: @union +uses( + unique int id: @use ); #keyset[id, index] -union_attrs( - int id: @union ref, +use_attrs( + int id: @use ref, int index: int ref, int attr: @attr ref ); #keyset[id] -union_generic_param_lists( - int id: @union ref, - int generic_param_list: @generic_param_list ref +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref ); #keyset[id] -union_names( - int id: @union ref, - int name: @name ref +use_visibilities( + int id: @use ref, + int visibility: @visibility ref ); -#keyset[id] -union_struct_field_lists( - int id: @union ref, - int struct_field_list: @struct_field_list ref +enums( + unique int id: @enum ); -#keyset[id] -union_visibilities( - int id: @union ref, - int visibility: @visibility ref +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref ); #keyset[id] -union_where_clauses( - int id: @union ref, - int where_clause: @where_clause ref +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref ); -uses( - unique int id: @use +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref ); -#keyset[id, index] -use_attrs( - int id: @use ref, - int index: int ref, - int attr: @attr ref +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref ); #keyset[id] -use_use_trees( - int id: @use ref, - int use_tree: @use_tree ref +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref ); #keyset[id] -use_visibilities( - int id: @use ref, - int visibility: @visibility ref +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref ); for_exprs( @@ -3598,6 +3527,88 @@ loop_expr_attrs( int attr: @attr ref ); +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + while_exprs( unique int id: @while_expr ); diff --git a/rust/ql/test/extractor-tests/generated/Enum/Enum.ql b/rust/ql/test/extractor-tests/generated/Enum/Enum.ql index e6639d783d27..4c7f7a835ac6 100644 --- a/rust/ql/test/extractor-tests/generated/Enum/Enum.ql +++ b/rust/ql/test/extractor-tests/generated/Enum/Enum.ql @@ -4,8 +4,8 @@ import TestUtils from Enum x, string hasExtendedCanonicalPath, string hasCrateOrigin, string hasAttributeMacroExpansion, - int getNumberOfAttrs, string hasGenericParamList, string hasName, string hasVariantList, - string hasVisibility, string hasWhereClause + int getNumberOfDeriveMacroExpansions, int getNumberOfAttrs, string hasGenericParamList, + string hasName, string hasVariantList, string hasVisibility, string hasWhereClause where toBeTested(x) and not x.isUnknown() and @@ -20,6 +20,7 @@ where then hasAttributeMacroExpansion = "yes" else hasAttributeMacroExpansion = "no" ) and + getNumberOfDeriveMacroExpansions = x.getNumberOfDeriveMacroExpansions() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and @@ -27,6 +28,7 @@ where (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin, - "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfAttrs:", getNumberOfAttrs, - "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasVariantList:", - hasVariantList, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfDeriveMacroExpansions:", + getNumberOfDeriveMacroExpansions, "getNumberOfAttrs:", getNumberOfAttrs, "hasGenericParamList:", + hasGenericParamList, "hasName:", hasName, "hasVariantList:", hasVariantList, "hasVisibility:", + hasVisibility, "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql b/rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql new file mode 100644 index 000000000000..1bb9710f97db --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from Enum x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getDeriveMacroExpansion(index) diff --git a/rust/ql/test/extractor-tests/generated/Struct/Struct.ql b/rust/ql/test/extractor-tests/generated/Struct/Struct.ql index 4471b94700c9..f5f0439f1758 100644 --- a/rust/ql/test/extractor-tests/generated/Struct/Struct.ql +++ b/rust/ql/test/extractor-tests/generated/Struct/Struct.ql @@ -4,8 +4,9 @@ import TestUtils from Struct x, string hasExtendedCanonicalPath, string hasCrateOrigin, - string hasAttributeMacroExpansion, int getNumberOfAttrs, string hasFieldList, - string hasGenericParamList, string hasName, string hasVisibility, string hasWhereClause + string hasAttributeMacroExpansion, int getNumberOfDeriveMacroExpansions, int getNumberOfAttrs, + string hasFieldList, string hasGenericParamList, string hasName, string hasVisibility, + string hasWhereClause where toBeTested(x) and not x.isUnknown() and @@ -20,6 +21,7 @@ where then hasAttributeMacroExpansion = "yes" else hasAttributeMacroExpansion = "no" ) and + getNumberOfDeriveMacroExpansions = x.getNumberOfDeriveMacroExpansions() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasFieldList() then hasFieldList = "yes" else hasFieldList = "no") and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and @@ -27,6 +29,7 @@ where (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin, - "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfAttrs:", getNumberOfAttrs, - "hasFieldList:", hasFieldList, "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, - "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfDeriveMacroExpansions:", + getNumberOfDeriveMacroExpansions, "getNumberOfAttrs:", getNumberOfAttrs, "hasFieldList:", + hasFieldList, "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasVisibility:", + hasVisibility, "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql b/rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql new file mode 100644 index 000000000000..3009a782a88f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from Struct x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getDeriveMacroExpansion(index) diff --git a/rust/ql/test/extractor-tests/generated/Union/Union.ql b/rust/ql/test/extractor-tests/generated/Union/Union.ql index 81d3ffb3adf9..a67dee68ec19 100644 --- a/rust/ql/test/extractor-tests/generated/Union/Union.ql +++ b/rust/ql/test/extractor-tests/generated/Union/Union.ql @@ -4,8 +4,9 @@ import TestUtils from Union x, string hasExtendedCanonicalPath, string hasCrateOrigin, - string hasAttributeMacroExpansion, int getNumberOfAttrs, string hasGenericParamList, - string hasName, string hasStructFieldList, string hasVisibility, string hasWhereClause + string hasAttributeMacroExpansion, int getNumberOfDeriveMacroExpansions, int getNumberOfAttrs, + string hasGenericParamList, string hasName, string hasStructFieldList, string hasVisibility, + string hasWhereClause where toBeTested(x) and not x.isUnknown() and @@ -20,6 +21,7 @@ where then hasAttributeMacroExpansion = "yes" else hasAttributeMacroExpansion = "no" ) and + getNumberOfDeriveMacroExpansions = x.getNumberOfDeriveMacroExpansions() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and @@ -27,6 +29,7 @@ where (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin, - "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfAttrs:", getNumberOfAttrs, - "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasStructFieldList:", - hasStructFieldList, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfDeriveMacroExpansions:", + getNumberOfDeriveMacroExpansions, "getNumberOfAttrs:", getNumberOfAttrs, "hasGenericParamList:", + hasGenericParamList, "hasName:", hasName, "hasStructFieldList:", hasStructFieldList, + "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql b/rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql new file mode 100644 index 000000000000..1851791caefe --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.ql @@ -0,0 +1,7 @@ +// generated by codegen, do not edit +import codeql.rust.elements +import TestUtils + +from Union x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getDeriveMacroExpansion(index) diff --git a/rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected b/rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected index 092c26051d65..288bc25d58bb 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected +++ b/rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected @@ -169,6 +169,10 @@ macro_expansion.rs: # 1| getPath(): [Path] erase # 1| getSegment(): [PathSegment] erase # 1| getIdentifier(): [NameRef] erase +# 1| getUseTree(3): [UseTree] MyTrait +# 1| getPath(): [Path] MyTrait +# 1| getSegment(): [PathSegment] MyTrait +# 1| getIdentifier(): [NameRef] MyTrait # 3| getItem(1): [Function] fn foo # 4| getAttributeMacroExpansion(): [MacroItems] MacroItems # 4| getItem(0): [Function] fn foo @@ -686,6 +690,295 @@ macro_expansion.rs: # 79| getSegment(): [PathSegment] i32 # 79| getIdentifier(): [NameRef] i32 # 78| getName(): [Name] MyStruct +# 83| getItem(17): [Struct] struct MyDerive +# 84| getDeriveMacroExpansion(0): [MacroItems] MacroItems +# 84| getItem(0): [Impl] impl ...::Debug for MyDerive::<...> { ... } +# 84| getAssocItemList(): [AssocItemList] AssocItemList +# 84| getAssocItem(0): [Function] fn fmt +# 83| getParamList(): [ParamList] ParamList +# 83| getParam(0): [Param] ...: ... +# 83| getTypeRepr(): [RefTypeRepr] RefTypeRepr +# 83| getTypeRepr(): [PathTypeRepr] ...::Formatter +# 83| getPath(): [Path] ...::Formatter +# 83| getQualifier(): [Path] ...::fmt +# 83| getQualifier(): [Path] $crate +# 83| getSegment(): [PathSegment] $crate +# 83| getIdentifier(): [NameRef] $crate +# 83| getSegment(): [PathSegment] fmt +# 83| getIdentifier(): [NameRef] fmt +# 83| getSegment(): [PathSegment] Formatter +# 83| getIdentifier(): [NameRef] Formatter +# 83| getPat(): [IdentPat] f +# 83| getName(): [Name] f +# 83| getSelfParam(): [SelfParam] SelfParam +# 83| getName(): [Name] self +# 84| getBody(): [BlockExpr] { ... } +# 84| getStmtList(): [StmtList] StmtList +# 84| getTailExpr(): [MatchExpr] match self { ... } +# 83| getScrutinee(): [PathExpr,VariableAccess] self +# 83| getPath(): [Path] self +# 83| getSegment(): [PathSegment] self +# 83| getIdentifier(): [NameRef] self +# 84| getMatchArmList(): [MatchArmList] MatchArmList +# 84| getArm(0): [MatchArm] ... => ... +# 85| getExpr(): [MethodCallExpr] ... .finish() +# 83| getArgList(): [ArgList] ArgList +# 83| getIdentifier(): [NameRef] finish +# 85| getReceiver(): [MethodCallExpr] ... .field(...) +# 85| getArgList(): [ArgList] ArgList +# 83| getArg(0): [StringLiteralExpr] "field" +# 85| getArg(1): [RefExpr] &field +# 85| getExpr(): [PathExpr,VariableAccess] field +# 85| getPath(): [Path] field +# 85| getSegment(): [PathSegment] field +# 85| getIdentifier(): [NameRef] field +# 83| getIdentifier(): [NameRef] field +# 83| getReceiver(): [MethodCallExpr] f.debug_struct(...) +# 83| getArgList(): [ArgList] ArgList +# 83| getArg(0): [StringLiteralExpr] "MyDerive" +# 83| getIdentifier(): [NameRef] debug_struct +# 83| getReceiver(): [PathExpr,VariableAccess] f +# 83| getPath(): [Path] f +# 83| getSegment(): [PathSegment] f +# 83| getIdentifier(): [NameRef] f +# 84| getPat(): [StructPat] MyDerive {...} +# 84| getPath(): [Path] MyDerive +# 84| getSegment(): [PathSegment] MyDerive +# 84| getIdentifier(): [NameRef] MyDerive +# 85| getStructPatFieldList(): [StructPatFieldList] StructPatFieldList +# 85| getField(0): [StructPatField] field: ... +# 85| getIdentifier(): [NameRef] field +# 85| getPat(): [IdentPat] field +# 85| getName(): [Name] field +# 83| getName(): [Name] fmt +# 83| getRetType(): [RetTypeRepr] RetTypeRepr +# 83| getTypeRepr(): [PathTypeRepr] ...::Result +# 83| getPath(): [Path] ...::Result +# 83| getQualifier(): [Path] ...::fmt +# 83| getQualifier(): [Path] $crate +# 83| getSegment(): [PathSegment] $crate +# 83| getIdentifier(): [NameRef] $crate +# 83| getSegment(): [PathSegment] fmt +# 83| getIdentifier(): [NameRef] fmt +# 83| getSegment(): [PathSegment] Result +# 83| getIdentifier(): [NameRef] Result +# 83| getGenericParamList(): [GenericParamList] <...> +# 84| getSelfTy(): [PathTypeRepr] MyDerive::<...> +# 84| getPath(): [Path] MyDerive::<...> +# 84| getSegment(): [PathSegment] MyDerive::<...> +# 83| getGenericArgList(): [GenericArgList] <...> +# 84| getIdentifier(): [NameRef] MyDerive +# 83| getTrait(): [PathTypeRepr] ...::Debug +# 83| getPath(): [Path] ...::Debug +# 83| getQualifier(): [Path] ...::fmt +# 83| getQualifier(): [Path] $crate +# 83| getSegment(): [PathSegment] $crate +# 83| getIdentifier(): [NameRef] $crate +# 83| getSegment(): [PathSegment] fmt +# 83| getIdentifier(): [NameRef] fmt +# 83| getSegment(): [PathSegment] Debug +# 83| getIdentifier(): [NameRef] Debug +# 83| getWhereClause(): [WhereClause] WhereClause +# 83| getAttr(0): [Attr] Attr +# 83| getMeta(): [Meta] Meta +# 83| getPath(): [Path] derive +# 83| getSegment(): [PathSegment] derive +# 83| getIdentifier(): [NameRef] derive +# 83| getTokenTree(): [TokenTree] TokenTree +# 84| getFieldList(): [StructFieldList] StructFieldList +# 85| getField(0): [StructField] StructField +# 85| getName(): [Name] field +# 85| getTypeRepr(): [PathTypeRepr] usize +# 85| getPath(): [Path] usize +# 85| getSegment(): [PathSegment] usize +# 85| getIdentifier(): [NameRef] usize +# 84| getName(): [Name] MyDerive +# 88| getItem(18): [Enum] enum MyDeriveEnum +# 89| getDeriveMacroExpansion(0): [MacroItems] MacroItems +# 89| getItem(0): [Impl] impl ...::PartialEq for MyDeriveEnum::<...> { ... } +# 89| getAssocItemList(): [AssocItemList] AssocItemList +# 89| getAssocItem(0): [Function] fn eq +# 88| getParamList(): [ParamList] ParamList +# 88| getParam(0): [Param] ...: ... +# 88| getTypeRepr(): [RefTypeRepr] RefTypeRepr +# 88| getTypeRepr(): [PathTypeRepr] Self +# 88| getPath(): [Path] Self +# 88| getSegment(): [PathSegment] Self +# 88| getIdentifier(): [NameRef] Self +# 88| getPat(): [IdentPat] other +# 88| getName(): [Name] other +# 88| getSelfParam(): [SelfParam] SelfParam +# 88| getName(): [Name] self +# 89| getBody(): [BlockExpr] { ... } +# 89| getStmtList(): [StmtList] StmtList +# 89| getTailExpr(): [MatchExpr] match ... { ... } +# 88| getScrutinee(): [TupleExpr] TupleExpr +# 88| getField(0): [PathExpr,VariableAccess] self +# 88| getPath(): [Path] self +# 88| getSegment(): [PathSegment] self +# 88| getIdentifier(): [NameRef] self +# 88| getField(1): [PathExpr,VariableAccess] other +# 88| getPath(): [Path] other +# 88| getSegment(): [PathSegment] other +# 88| getIdentifier(): [NameRef] other +# 89| getMatchArmList(): [MatchArmList] MatchArmList +# 89| getArm(0): [MatchArm] ... => true +# 88| getExpr(): [BooleanLiteralExpr] true +# 89| getPat(): [TuplePat] TuplePat +# 89| getField(0): [PathPat] ...::Variant1 +# 89| getPath(): [Path] ...::Variant1 +# 89| getQualifier(): [Path] MyDeriveEnum +# 89| getSegment(): [PathSegment] MyDeriveEnum +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 90| getSegment(): [PathSegment] Variant1 +# 90| getIdentifier(): [NameRef] Variant1 +# 89| getField(1): [PathPat] ...::Variant1 +# 89| getPath(): [Path] ...::Variant1 +# 89| getQualifier(): [Path] MyDeriveEnum +# 89| getSegment(): [PathSegment] MyDeriveEnum +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 90| getSegment(): [PathSegment] Variant1 +# 90| getIdentifier(): [NameRef] Variant1 +# 89| getArm(1): [MatchArm] ... => true +# 88| getExpr(): [BooleanLiteralExpr] true +# 89| getPat(): [TuplePat] TuplePat +# 89| getField(0): [PathPat] ...::Variant2 +# 89| getPath(): [Path] ...::Variant2 +# 89| getQualifier(): [Path] MyDeriveEnum +# 89| getSegment(): [PathSegment] MyDeriveEnum +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 91| getSegment(): [PathSegment] Variant2 +# 91| getIdentifier(): [NameRef] Variant2 +# 89| getField(1): [PathPat] ...::Variant2 +# 89| getPath(): [Path] ...::Variant2 +# 89| getQualifier(): [Path] MyDeriveEnum +# 89| getSegment(): [PathSegment] MyDeriveEnum +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 91| getSegment(): [PathSegment] Variant2 +# 91| getIdentifier(): [NameRef] Variant2 +# 88| getArm(2): [MatchArm] ... => false +# 88| getExpr(): [BooleanLiteralExpr] false +# 88| getPat(): [IdentPat] _unused +# 88| getName(): [Name] _unused +# 88| getName(): [Name] eq +# 88| getRetType(): [RetTypeRepr] RetTypeRepr +# 88| getTypeRepr(): [PathTypeRepr] bool +# 88| getPath(): [Path] bool +# 88| getSegment(): [PathSegment] bool +# 88| getIdentifier(): [NameRef] bool +# 88| getGenericParamList(): [GenericParamList] <...> +# 89| getSelfTy(): [PathTypeRepr] MyDeriveEnum::<...> +# 89| getPath(): [Path] MyDeriveEnum::<...> +# 89| getSegment(): [PathSegment] MyDeriveEnum::<...> +# 88| getGenericArgList(): [GenericArgList] <...> +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 88| getTrait(): [PathTypeRepr] ...::PartialEq +# 88| getPath(): [Path] ...::PartialEq +# 88| getQualifier(): [Path] ...::cmp +# 88| getQualifier(): [Path] $crate +# 88| getSegment(): [PathSegment] $crate +# 88| getIdentifier(): [NameRef] $crate +# 88| getSegment(): [PathSegment] cmp +# 88| getIdentifier(): [NameRef] cmp +# 88| getSegment(): [PathSegment] PartialEq +# 88| getIdentifier(): [NameRef] PartialEq +# 88| getWhereClause(): [WhereClause] WhereClause +# 89| getDeriveMacroExpansion(1): [MacroItems] MacroItems +# 89| getItem(0): [Impl] impl ...::Eq for MyDeriveEnum::<...> { ... } +# 88| getAssocItemList(): [AssocItemList] AssocItemList +# 88| getGenericParamList(): [GenericParamList] <...> +# 89| getSelfTy(): [PathTypeRepr] MyDeriveEnum::<...> +# 89| getPath(): [Path] MyDeriveEnum::<...> +# 89| getSegment(): [PathSegment] MyDeriveEnum::<...> +# 88| getGenericArgList(): [GenericArgList] <...> +# 89| getIdentifier(): [NameRef] MyDeriveEnum +# 88| getTrait(): [PathTypeRepr] ...::Eq +# 88| getPath(): [Path] ...::Eq +# 88| getQualifier(): [Path] ...::cmp +# 88| getQualifier(): [Path] $crate +# 88| getSegment(): [PathSegment] $crate +# 88| getIdentifier(): [NameRef] $crate +# 88| getSegment(): [PathSegment] cmp +# 88| getIdentifier(): [NameRef] cmp +# 88| getSegment(): [PathSegment] Eq +# 88| getIdentifier(): [NameRef] Eq +# 88| getWhereClause(): [WhereClause] WhereClause +# 88| getAttr(0): [Attr] Attr +# 88| getMeta(): [Meta] Meta +# 88| getPath(): [Path] derive +# 88| getSegment(): [PathSegment] derive +# 88| getIdentifier(): [NameRef] derive +# 88| getTokenTree(): [TokenTree] TokenTree +# 89| getName(): [Name] MyDeriveEnum +# 89| getVariantList(): [VariantList] VariantList +# 90| getVariant(0): [Variant] Variant1 +# 90| getName(): [Name] Variant1 +# 91| getVariant(1): [Variant] Variant2 +# 91| getName(): [Name] Variant2 +# 94| getItem(19): [Trait] trait MyTrait +# 94| getAssocItemList(): [AssocItemList] AssocItemList +# 95| getAssocItem(0): [Function] fn my_method +# 95| getParamList(): [ParamList] ParamList +# 95| getName(): [Name] my_method +# 95| getRetType(): [RetTypeRepr] RetTypeRepr +# 95| getTypeRepr(): [PathTypeRepr] u32 +# 95| getPath(): [Path] u32 +# 95| getSegment(): [PathSegment] u32 +# 95| getIdentifier(): [NameRef] u32 +# 94| getName(): [Name] MyTrait +# 98| getItem(20): [Union] union MyDeriveUnion +# 99| getDeriveMacroExpansion(0): [MacroItems] MacroItems +# 99| getItem(0): [Const] Const +# 98| getBody(): [IntegerLiteralExpr] 42 +# 99| getName(): [Name] CONST_MyDeriveUnion +# 98| getTypeRepr(): [PathTypeRepr] u32 +# 98| getPath(): [Path] u32 +# 98| getSegment(): [PathSegment] u32 +# 98| getIdentifier(): [NameRef] u32 +# 99| getItem(1): [Impl] impl MyTrait for MyDeriveUnion { ... } +# 99| getAssocItemList(): [AssocItemList] AssocItemList +# 99| getAssocItem(0): [Function] fn my_method +# 98| getParamList(): [ParamList] ParamList +# 99| getBody(): [BlockExpr] { ... } +# 99| getStmtList(): [StmtList] StmtList +# 99| getTailExpr(): [PathExpr] CONST_MyDeriveUnion +# 99| getPath(): [Path] CONST_MyDeriveUnion +# 99| getSegment(): [PathSegment] CONST_MyDeriveUnion +# 99| getIdentifier(): [NameRef] CONST_MyDeriveUnion +# 98| getName(): [Name] my_method +# 98| getRetType(): [RetTypeRepr] RetTypeRepr +# 98| getTypeRepr(): [PathTypeRepr] u32 +# 98| getPath(): [Path] u32 +# 98| getSegment(): [PathSegment] u32 +# 98| getIdentifier(): [NameRef] u32 +# 99| getSelfTy(): [PathTypeRepr] MyDeriveUnion +# 99| getPath(): [Path] MyDeriveUnion +# 99| getSegment(): [PathSegment] MyDeriveUnion +# 99| getIdentifier(): [NameRef] MyDeriveUnion +# 98| getTrait(): [PathTypeRepr] MyTrait +# 98| getPath(): [Path] MyTrait +# 98| getSegment(): [PathSegment] MyTrait +# 98| getIdentifier(): [NameRef] MyTrait +# 98| getAttr(0): [Attr] Attr +# 98| getMeta(): [Meta] Meta +# 98| getPath(): [Path] derive +# 98| getSegment(): [PathSegment] derive +# 98| getIdentifier(): [NameRef] derive +# 98| getTokenTree(): [TokenTree] TokenTree +# 99| getName(): [Name] MyDeriveUnion +# 99| getStructFieldList(): [StructFieldList] StructFieldList +# 100| getField(0): [StructField] StructField +# 100| getName(): [Name] field1 +# 100| getTypeRepr(): [PathTypeRepr] usize +# 100| getPath(): [Path] usize +# 100| getSegment(): [PathSegment] usize +# 100| getIdentifier(): [NameRef] usize +# 101| getField(1): [StructField] StructField +# 101| getName(): [Name] field2 +# 101| getTypeRepr(): [PathTypeRepr] f64 +# 101| getPath(): [Path] f64 +# 101| getSegment(): [PathSegment] f64 +# 101| getIdentifier(): [NameRef] f64 # 44| [Comment] //... # 56| [Comment] //... # 63| [Comment] //... @@ -2172,3 +2465,1345 @@ proc_macro.rs: # 32| getSegment(): [PathSegment] TokenStream # 32| getIdentifier(): [NameRef] TokenStream # 32| getVisibility(): [Visibility] Visibility +# 36| getItem(5): [Function] fn my_trait_derive +# 37| getParamList(): [ParamList] ParamList +# 37| getParam(0): [Param] ...: TokenStream +# 37| getTypeRepr(): [PathTypeRepr] TokenStream +# 37| getPath(): [Path] TokenStream +# 37| getSegment(): [PathSegment] TokenStream +# 37| getIdentifier(): [NameRef] TokenStream +# 37| getPat(): [IdentPat] input +# 37| getName(): [Name] input +# 36| getAttr(0): [Attr] Attr +# 36| getMeta(): [Meta] Meta +# 36| getPath(): [Path] proc_macro_derive +# 36| getSegment(): [PathSegment] proc_macro_derive +# 36| getIdentifier(): [NameRef] proc_macro_derive +# 36| getTokenTree(): [TokenTree] TokenTree +# 37| getBody(): [BlockExpr] { ... } +# 37| getStmtList(): [StmtList] StmtList +# 38| getStatement(0): [LetStmt] let ... = ... +# 38| getInitializer(): [MacroExpr] MacroExpr +# 38| getMacroCall(): [MacroCall] ...::parse_macro_input!... +# 38| getPath(): [Path] ...::parse_macro_input +# 38| getQualifier(): [Path] syn +# 38| getSegment(): [PathSegment] syn +# 38| getIdentifier(): [NameRef] syn +# 38| getSegment(): [PathSegment] parse_macro_input +# 38| getIdentifier(): [NameRef] parse_macro_input +# 38| getTokenTree(): [TokenTree] TokenTree +# 38| getMacroCallExpansion(): [MatchExpr] match ... { ... } +# 38| getScrutinee(): [CallExpr] ...::parse::<...>(...) +# 38| getArgList(): [ArgList] ArgList +# 38| getArg(0): [PathExpr,VariableAccess] input +# 38| getPath(): [Path] input +# 38| getSegment(): [PathSegment] input +# 38| getIdentifier(): [NameRef] input +# 38| getFunction(): [PathExpr] ...::parse::<...> +# 38| getPath(): [Path] ...::parse::<...> +# 38| getQualifier(): [Path] $crate +# 38| getSegment(): [PathSegment] $crate +# 38| getIdentifier(): [NameRef] $crate +# 38| getSegment(): [PathSegment] parse::<...> +# 38| getGenericArgList(): [GenericArgList] <...> +# 38| getGenericArg(0): [TypeArg] TypeArg +# 38| getTypeRepr(): [PathTypeRepr] ...::DeriveInput +# 38| getPath(): [Path] ...::DeriveInput +# 38| getQualifier(): [Path] syn +# 38| getSegment(): [PathSegment] syn +# 38| getIdentifier(): [NameRef] syn +# 38| getSegment(): [PathSegment] DeriveInput +# 38| getIdentifier(): [NameRef] DeriveInput +# 38| getIdentifier(): [NameRef] parse +# 38| getMatchArmList(): [MatchArmList] MatchArmList +# 38| getArm(0): [MatchArm] ... => data +# 38| getExpr(): [PathExpr,VariableAccess] data +# 38| getPath(): [Path] data +# 38| getSegment(): [PathSegment] data +# 38| getIdentifier(): [NameRef] data +# 38| getPat(): [TupleStructPat] ...::Ok(...) +# 38| getPath(): [Path] ...::Ok +# 38| getQualifier(): [Path] ...::__private +# 38| getQualifier(): [Path] $crate +# 38| getSegment(): [PathSegment] $crate +# 38| getIdentifier(): [NameRef] $crate +# 38| getSegment(): [PathSegment] __private +# 38| getIdentifier(): [NameRef] __private +# 38| getSegment(): [PathSegment] Ok +# 38| getIdentifier(): [NameRef] Ok +# 38| getField(0): [IdentPat] data +# 38| getName(): [Name] data +# 38| getArm(1): [MatchArm] ... => ... +# 38| getExpr(): [BlockExpr] { ... } +# 38| getStmtList(): [StmtList] StmtList +# 38| getStatement(0): [ExprStmt] ExprStmt +# 38| getExpr(): [ReturnExpr] return ... +# 38| getExpr(): [CallExpr] ...::from(...) +# 38| getArgList(): [ArgList] ArgList +# 38| getArg(0): [MethodCallExpr] err.to_compile_error() +# 38| getArgList(): [ArgList] ArgList +# 38| getIdentifier(): [NameRef] to_compile_error +# 38| getReceiver(): [PathExpr,VariableAccess] err +# 38| getPath(): [Path] err +# 38| getSegment(): [PathSegment] err +# 38| getIdentifier(): [NameRef] err +# 38| getFunction(): [PathExpr] ...::from +# 38| getPath(): [Path] ...::from +# 38| getQualifier(): [Path] ...::TokenStream +# 38| getQualifier(): [Path] ...::__private +# 38| getQualifier(): [Path] $crate +# 38| getSegment(): [PathSegment] $crate +# 38| getIdentifier(): [NameRef] $crate +# 38| getSegment(): [PathSegment] __private +# 38| getIdentifier(): [NameRef] __private +# 38| getSegment(): [PathSegment] TokenStream +# 38| getIdentifier(): [NameRef] TokenStream +# 38| getSegment(): [PathSegment] from +# 38| getIdentifier(): [NameRef] from +# 38| getPat(): [TupleStructPat] ...::Err(...) +# 38| getPath(): [Path] ...::Err +# 38| getQualifier(): [Path] ...::__private +# 38| getQualifier(): [Path] $crate +# 38| getSegment(): [PathSegment] $crate +# 38| getIdentifier(): [NameRef] $crate +# 38| getSegment(): [PathSegment] __private +# 38| getIdentifier(): [NameRef] __private +# 38| getSegment(): [PathSegment] Err +# 38| getIdentifier(): [NameRef] Err +# 38| getField(0): [IdentPat] err +# 38| getName(): [Name] err +# 38| getPat(): [IdentPat] ast +# 38| getName(): [Name] ast +# 39| getStatement(1): [LetStmt] let ... = ... +# 39| getInitializer(): [RefExpr] &... +# 39| getExpr(): [FieldExpr] ast.ident +# 39| getContainer(): [PathExpr,VariableAccess] ast +# 39| getPath(): [Path] ast +# 39| getSegment(): [PathSegment] ast +# 39| getIdentifier(): [NameRef] ast +# 39| getIdentifier(): [NameRef] ident +# 39| getPat(): [IdentPat] name +# 39| getName(): [Name] name +# 40| getStatement(2): [LetStmt] let ... = ... +# 40| getInitializer(): [CallExpr] ...::new(...) +# 40| getArgList(): [ArgList] ArgList +# 40| getArg(0): [RefExpr] &... +# 40| getExpr(): [MacroExpr] MacroExpr +# 40| getMacroCall(): [MacroCall] format!... +# 40| getPath(): [Path] format +# 40| getSegment(): [PathSegment] format +# 40| getIdentifier(): [NameRef] format +# 40| getTokenTree(): [TokenTree] TokenTree +# 40| getMacroCallExpansion(): [CallExpr] ...::must_use(...) +# 40| getArgList(): [ArgList] ArgList +# 40| getArg(0): [BlockExpr] { ... } +# 40| getStmtList(): [StmtList] StmtList +# 40| getStatement(0): [LetStmt] let ... = ... +# 40| getInitializer(): [CallExpr] ...::format(...) +# 40| getArgList(): [ArgList] ArgList +# 40| getArg(0): [MacroExpr] MacroExpr +# 40| getMacroCall(): [MacroCall] ...::format_args!... +# 40| getPath(): [Path] ...::format_args +# 40| getQualifier(): [Path] ...::__export +# 40| getQualifier(): [Path] $crate +# 40| getSegment(): [PathSegment] $crate +# 40| getIdentifier(): [NameRef] $crate +# 40| getSegment(): [PathSegment] __export +# 40| getIdentifier(): [NameRef] __export +# 40| getSegment(): [PathSegment] format_args +# 40| getIdentifier(): [NameRef] format_args +# 40| getTokenTree(): [TokenTree] TokenTree +# 40| getMacroCallExpansion(): [FormatArgsExpr] FormatArgsExpr +# 40| getArg(0): [FormatArgsArg] FormatArgsArg +# 40| getExpr(): [PathExpr,VariableAccess] name +# 40| getPath(): [Path] name +# 40| getSegment(): [PathSegment] name +# 40| getIdentifier(): [NameRef] name +# 40| getTemplate(): [StringLiteralExpr] "CONST_{}" +# 40| getFormat(0): [Format] {} +# 40| getFunction(): [PathExpr] ...::format +# 40| getPath(): [Path] ...::format +# 40| getQualifier(): [Path] ...::fmt +# 40| getQualifier(): [Path] $crate +# 40| getSegment(): [PathSegment] $crate +# 40| getIdentifier(): [NameRef] $crate +# 40| getSegment(): [PathSegment] fmt +# 40| getIdentifier(): [NameRef] fmt +# 40| getSegment(): [PathSegment] format +# 40| getIdentifier(): [NameRef] format +# 40| getPat(): [IdentPat] res +# 40| getName(): [Name] res +# 40| getTailExpr(): [PathExpr,VariableAccess] res +# 40| getPath(): [Path] res +# 40| getSegment(): [PathSegment] res +# 40| getIdentifier(): [NameRef] res +# 40| getFunction(): [PathExpr] ...::must_use +# 40| getPath(): [Path] ...::must_use +# 40| getQualifier(): [Path] ...::__export +# 40| getQualifier(): [Path] $crate +# 40| getSegment(): [PathSegment] $crate +# 40| getIdentifier(): [NameRef] $crate +# 40| getSegment(): [PathSegment] __export +# 40| getIdentifier(): [NameRef] __export +# 40| getSegment(): [PathSegment] must_use +# 40| getIdentifier(): [NameRef] must_use +# 40| getArg(1): [MethodCallExpr] name.span() +# 40| getArgList(): [ArgList] ArgList +# 40| getIdentifier(): [NameRef] span +# 40| getReceiver(): [PathExpr,VariableAccess] name +# 40| getPath(): [Path] name +# 40| getSegment(): [PathSegment] name +# 40| getIdentifier(): [NameRef] name +# 40| getFunction(): [PathExpr] ...::new +# 40| getPath(): [Path] ...::new +# 40| getQualifier(): [Path] ...::Ident +# 40| getQualifier(): [Path] syn +# 40| getSegment(): [PathSegment] syn +# 40| getIdentifier(): [NameRef] syn +# 40| getSegment(): [PathSegment] Ident +# 40| getIdentifier(): [NameRef] Ident +# 40| getSegment(): [PathSegment] new +# 40| getIdentifier(): [NameRef] new +# 40| getPat(): [IdentPat] const_ident +# 40| getName(): [Name] const_ident +# 41| getTailExpr(): [MethodCallExpr] ... .into() +# 49| getArgList(): [ArgList] ArgList +# 49| getIdentifier(): [NameRef] into +# 41| getReceiver(): [MacroExpr] MacroExpr +# 41| getMacroCall(): [MacroCall] quote!... +# 41| getPath(): [Path] quote +# 41| getSegment(): [PathSegment] quote +# 41| getIdentifier(): [NameRef] quote +# 41| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [BlockExpr] { ... } +# 42| getStmtList(): [StmtList] StmtList +# 41| getStatement(0): [LetStmt] let ... = ... +# 41| getInitializer(): [CallExpr] ...::new(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getFunction(): [PathExpr] ...::new +# 41| getPath(): [Path] ...::new +# 41| getQualifier(): [Path] ...::TokenStream +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] TokenStream +# 41| getIdentifier(): [NameRef] TokenStream +# 41| getSegment(): [PathSegment] new +# 41| getIdentifier(): [NameRef] new +# 41| getPat(): [IdentPat] mut _s +# 41| getName(): [Name] _s +# 42| getStatement(1): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_each_token!... +# 41| getPath(): [Path] ...::quote_each_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_each_token +# 41| getIdentifier(): [NameRef] quote_each_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_tokens_with_context!... +# 41| getPath(): [Path] ...::quote_tokens_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_tokens_with_context +# 41| getIdentifier(): [NameRef] quote_tokens_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getTailExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(0): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(1): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(2): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(3): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(0): [ExprStmt] ExprStmt +# 42| getExpr(): [CallExpr] ...::push_ident(...) +# 42| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 42| getArg(1): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "const" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 42| getStatement(4): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(0): [ExprStmt] ExprStmt +# 42| getExpr(): [CallExpr] ...::to_tokens(...) +# 42| getArgList(): [ArgList] ArgList +# 42| getArg(0): [RefExpr] &const_ident +# 42| getExpr(): [PathExpr,VariableAccess] const_ident +# 42| getPath(): [Path] const_ident +# 42| getSegment(): [PathSegment] const_ident +# 42| getIdentifier(): [NameRef] const_ident +# 41| getArg(1): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::to_tokens +# 41| getPath(): [Path] ...::to_tokens +# 41| getQualifier(): [Path] ...::ToTokens +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] ToTokens +# 41| getIdentifier(): [NameRef] ToTokens +# 41| getSegment(): [PathSegment] to_tokens +# 41| getIdentifier(): [NameRef] to_tokens +# 42| getStatement(5): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(6): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getStatement(0): [ExprStmt] ExprStmt +# 41| getExpr(): [CallExpr] ...::push_colon(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_colon +# 41| getPath(): [Path] ...::push_colon +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_colon +# 41| getIdentifier(): [NameRef] push_colon +# 42| getStatement(7): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(0): [ExprStmt] ExprStmt +# 42| getExpr(): [CallExpr] ...::push_ident(...) +# 42| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 42| getArg(1): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "u32" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 42| getStatement(8): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getStatement(0): [ExprStmt] ExprStmt +# 41| getExpr(): [CallExpr] ...::push_eq(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_eq +# 41| getPath(): [Path] ...::push_eq +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_eq +# 41| getIdentifier(): [NameRef] push_eq +# 42| getStatement(9): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getStatement(0): [ExprStmt] ExprStmt +# 42| getExpr(): [CallExpr] ...::parse(...) +# 42| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 42| getArg(1): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "42" +# 41| getFunction(): [PathExpr] ...::parse +# 41| getPath(): [Path] ...::parse +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] parse +# 41| getIdentifier(): [NameRef] parse +# 42| getStatement(10): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 42| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 42| getTailExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 42| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getStatement(0): [ExprStmt] ExprStmt +# 41| getExpr(): [CallExpr] ...::push_semi(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_semi +# 41| getPath(): [Path] ...::push_semi +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_semi +# 41| getIdentifier(): [NameRef] push_semi +# 42| getStatement(11): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getTailExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 44| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(0): [ExprStmt] ExprStmt +# 44| getExpr(): [CallExpr] ...::push_ident(...) +# 44| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 44| getArg(1): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "impl" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 42| getStatement(12): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getTailExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 44| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(0): [ExprStmt] ExprStmt +# 44| getExpr(): [CallExpr] ...::push_ident(...) +# 44| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 44| getArg(1): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "MyTrait" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 42| getStatement(13): [ExprStmt] ExprStmt +# 42| getExpr(): [MacroExpr] MacroExpr +# 42| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 42| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getTailExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 44| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(0): [ExprStmt] ExprStmt +# 44| getExpr(): [CallExpr] ...::push_ident(...) +# 44| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 44| getArg(1): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "for" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 44| getStatement(14): [ExprStmt] ExprStmt +# 44| getExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(0): [ExprStmt] ExprStmt +# 44| getExpr(): [CallExpr] ...::to_tokens(...) +# 44| getArgList(): [ArgList] ArgList +# 44| getArg(0): [RefExpr] &name +# 44| getExpr(): [PathExpr,VariableAccess] name +# 44| getPath(): [Path] name +# 44| getSegment(): [PathSegment] name +# 44| getIdentifier(): [NameRef] name +# 41| getArg(1): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::to_tokens +# 41| getPath(): [Path] ...::to_tokens +# 41| getQualifier(): [Path] ...::ToTokens +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] ToTokens +# 41| getIdentifier(): [NameRef] ToTokens +# 41| getSegment(): [PathSegment] to_tokens +# 41| getIdentifier(): [NameRef] to_tokens +# 44| getStatement(15): [ExprStmt] ExprStmt +# 44| getExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(16): [ExprStmt] ExprStmt +# 44| getExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 44| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getTailExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 44| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(0): [ExprStmt] ExprStmt +# 45| getExpr(): [CallExpr] ...::push_group(...) +# 45| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getArg(1): [PathExpr] ...::Brace +# 41| getPath(): [Path] ...::Brace +# 41| getQualifier(): [Path] ...::Delimiter +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] Delimiter +# 41| getIdentifier(): [NameRef] Delimiter +# 41| getSegment(): [PathSegment] Brace +# 41| getIdentifier(): [NameRef] Brace +# 45| getArg(2): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote!... +# 41| getPath(): [Path] ...::quote +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote +# 41| getIdentifier(): [NameRef] quote +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [BlockExpr] { ... } +# 45| getStmtList(): [StmtList] StmtList +# 41| getStatement(0): [LetStmt] let ... = ... +# 41| getInitializer(): [CallExpr] ...::new(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getFunction(): [PathExpr] ...::new +# 41| getPath(): [Path] ...::new +# 41| getQualifier(): [Path] ...::TokenStream +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] TokenStream +# 41| getIdentifier(): [NameRef] TokenStream +# 41| getSegment(): [PathSegment] new +# 41| getIdentifier(): [NameRef] new +# 41| getPat(): [IdentPat] mut _s +# 41| getName(): [Name] _s +# 45| getStatement(1): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_each_token!... +# 41| getPath(): [Path] ...::quote_each_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_each_token +# 41| getIdentifier(): [NameRef] quote_each_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_tokens_with_context!... +# 41| getPath(): [Path] ...::quote_tokens_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_tokens_with_context +# 41| getIdentifier(): [NameRef] quote_tokens_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(0): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(1): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(2): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(3): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(0): [ExprStmt] ExprStmt +# 45| getExpr(): [CallExpr] ...::push_ident(...) +# 45| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 45| getArg(1): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "fn" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 45| getStatement(4): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(0): [ExprStmt] ExprStmt +# 45| getExpr(): [CallExpr] ...::push_ident(...) +# 45| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 45| getArg(1): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "my_method" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 45| getStatement(5): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getStatement(0): [ExprStmt] ExprStmt +# 41| getExpr(): [CallExpr] ...::push_group(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getArg(1): [PathExpr] ...::Parenthesis +# 41| getPath(): [Path] ...::Parenthesis +# 41| getQualifier(): [Path] ...::Delimiter +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] Delimiter +# 41| getIdentifier(): [NameRef] Delimiter +# 41| getSegment(): [PathSegment] Parenthesis +# 41| getIdentifier(): [NameRef] Parenthesis +# 41| getArg(2): [MacroExpr] MacroExpr +# 41| getMacroCall(): [MacroCall] ...::quote!... +# 41| getPath(): [Path] ...::quote +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote +# 41| getIdentifier(): [NameRef] quote +# 41| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [CallExpr] ...::new(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getFunction(): [PathExpr] ...::new +# 41| getPath(): [Path] ...::new +# 41| getQualifier(): [Path] ...::TokenStream +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] TokenStream +# 41| getIdentifier(): [NameRef] TokenStream +# 41| getSegment(): [PathSegment] new +# 41| getIdentifier(): [NameRef] new +# 41| getFunction(): [PathExpr] ...::push_group +# 41| getPath(): [Path] ...::push_group +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_group +# 41| getIdentifier(): [NameRef] push_group +# 45| getStatement(6): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getStatement(0): [ExprStmt] ExprStmt +# 41| getExpr(): [CallExpr] ...::push_rarrow(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_rarrow +# 41| getPath(): [Path] ...::push_rarrow +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_rarrow +# 41| getIdentifier(): [NameRef] push_rarrow +# 45| getStatement(7): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(0): [ExprStmt] ExprStmt +# 45| getExpr(): [CallExpr] ...::push_ident(...) +# 45| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 45| getArg(1): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] stringify!... +# 41| getPath(): [Path] stringify +# 41| getSegment(): [PathSegment] stringify +# 41| getIdentifier(): [NameRef] stringify +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [StringLiteralExpr] "u32" +# 41| getFunction(): [PathExpr] ...::push_ident +# 41| getPath(): [Path] ...::push_ident +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_ident +# 41| getIdentifier(): [NameRef] push_ident +# 45| getStatement(8): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 45| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getTailExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token!... +# 41| getPath(): [Path] ...::quote_token +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token +# 41| getIdentifier(): [NameRef] quote_token +# 45| getTokenTree(): [TokenTree] TokenTree +# 46| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 46| getStatement(0): [ExprStmt] ExprStmt +# 46| getExpr(): [CallExpr] ...::push_group(...) +# 46| getArgList(): [ArgList] ArgList +# 41| getArg(0): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getArg(1): [PathExpr] ...::Brace +# 41| getPath(): [Path] ...::Brace +# 41| getQualifier(): [Path] ...::Delimiter +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] Delimiter +# 41| getIdentifier(): [NameRef] Delimiter +# 41| getSegment(): [PathSegment] Brace +# 41| getIdentifier(): [NameRef] Brace +# 46| getArg(2): [MacroExpr] MacroExpr +# 46| getMacroCall(): [MacroCall] ...::quote!... +# 41| getPath(): [Path] ...::quote +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote +# 41| getIdentifier(): [NameRef] quote +# 46| getTokenTree(): [TokenTree] TokenTree +# 46| getMacroCallExpansion(): [BlockExpr] { ... } +# 46| getStmtList(): [StmtList] StmtList +# 41| getStatement(0): [LetStmt] let ... = ... +# 41| getInitializer(): [CallExpr] ...::new(...) +# 41| getArgList(): [ArgList] ArgList +# 41| getFunction(): [PathExpr] ...::new +# 41| getPath(): [Path] ...::new +# 41| getQualifier(): [Path] ...::TokenStream +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] TokenStream +# 41| getIdentifier(): [NameRef] TokenStream +# 41| getSegment(): [PathSegment] new +# 41| getIdentifier(): [NameRef] new +# 41| getPat(): [IdentPat] mut _s +# 41| getName(): [Name] _s +# 46| getStatement(1): [ExprStmt] ExprStmt +# 46| getExpr(): [CallExpr] ...::to_tokens(...) +# 46| getArgList(): [ArgList] ArgList +# 46| getArg(0): [RefExpr] &const_ident +# 46| getExpr(): [PathExpr,VariableAccess] const_ident +# 46| getPath(): [Path] const_ident +# 46| getSegment(): [PathSegment] const_ident +# 46| getIdentifier(): [NameRef] const_ident +# 41| getArg(1): [RefExpr] &mut _s +# 41| getExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::to_tokens +# 41| getPath(): [Path] ...::to_tokens +# 41| getQualifier(): [Path] ...::ToTokens +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] ToTokens +# 41| getIdentifier(): [NameRef] ToTokens +# 41| getSegment(): [PathSegment] to_tokens +# 41| getIdentifier(): [NameRef] to_tokens +# 41| getTailExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_group +# 41| getPath(): [Path] ...::push_group +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_group +# 41| getIdentifier(): [NameRef] push_group +# 45| getStatement(9): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 45| getStatement(10): [ExprStmt] ExprStmt +# 45| getExpr(): [MacroExpr] MacroExpr +# 45| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 45| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getTailExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 41| getFunction(): [PathExpr] ...::push_group +# 41| getPath(): [Path] ...::push_group +# 41| getQualifier(): [Path] ...::__private +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] __private +# 41| getIdentifier(): [NameRef] __private +# 41| getSegment(): [PathSegment] push_group +# 41| getIdentifier(): [NameRef] push_group +# 44| getStatement(17): [ExprStmt] ExprStmt +# 44| getExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 44| getStatement(18): [ExprStmt] ExprStmt +# 44| getExpr(): [MacroExpr] MacroExpr +# 44| getMacroCall(): [MacroCall] ...::quote_token_with_context!... +# 41| getPath(): [Path] ...::quote_token_with_context +# 41| getQualifier(): [Path] $crate +# 41| getSegment(): [PathSegment] $crate +# 41| getIdentifier(): [NameRef] $crate +# 41| getSegment(): [PathSegment] quote_token_with_context +# 41| getIdentifier(): [NameRef] quote_token_with_context +# 44| getTokenTree(): [TokenTree] TokenTree +# 41| getMacroCallExpansion(): [MacroBlockExpr] MacroBlockExpr +# 41| getTailExpr(): [PathExpr] _s +# 41| getPath(): [Path] _s +# 41| getSegment(): [PathSegment] _s +# 41| getIdentifier(): [NameRef] _s +# 37| getName(): [Name] my_trait_derive +# 37| getRetType(): [RetTypeRepr] RetTypeRepr +# 37| getTypeRepr(): [PathTypeRepr] TokenStream +# 37| getPath(): [Path] TokenStream +# 37| getSegment(): [PathSegment] TokenStream +# 37| getIdentifier(): [NameRef] TokenStream +# 37| getVisibility(): [Visibility] Visibility diff --git a/rust/ql/test/extractor-tests/macro-expansion/macro_expansion.rs b/rust/ql/test/extractor-tests/macro-expansion/macro_expansion.rs index 419105547a1e..145672528837 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/macro_expansion.rs +++ b/rust/ql/test/extractor-tests/macro-expansion/macro_expansion.rs @@ -1,4 +1,4 @@ -use proc_macro::{repeat, add_one, erase}; +use proc_macro::{repeat, add_one, erase, MyTrait}; #[add_one] pub fn foo() { @@ -78,3 +78,25 @@ type MyInt = my_int!(); // this didn't expand in 0.0.274..0.0.287 struct MyStruct { field: my_int!(), // this didn't expand in 0.0.274..0.0.287 } + + +#[derive(Debug)] +struct MyDerive { + field: usize, +} + +#[derive(PartialEq, Eq)] +enum MyDeriveEnum { + Variant1, + Variant2, +} + +trait MyTrait { + fn my_method() -> u32; +} + +#[derive(MyTrait)] +union MyDeriveUnion { + field1: usize, + field2: f64, +} \ No newline at end of file diff --git a/rust/ql/test/extractor-tests/macro-expansion/proc_macro.rs b/rust/ql/test/extractor-tests/macro-expansion/proc_macro.rs index 3e9e7ccd1cf1..05c6f0b09a6a 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/proc_macro.rs +++ b/rust/ql/test/extractor-tests/macro-expansion/proc_macro.rs @@ -32,3 +32,20 @@ pub fn add_one(_attr: TokenStream, item: TokenStream) -> TokenStream { pub fn erase(_attr: TokenStream, _item: TokenStream) -> TokenStream { TokenStream::new() } + +#[proc_macro_derive(MyTrait)] +pub fn my_trait_derive(input: TokenStream) -> TokenStream { + let ast = syn::parse_macro_input!(input as syn::DeriveInput); + let name = &ast.ident; + let const_ident = syn::Ident::new(&format!("CONST_{}", name), name.span()); + quote! { + const #const_ident: u32 = 42; + + impl MyTrait for #name { + fn my_method() -> u32 { + #const_ident + } + } + }.into() +} + diff --git a/rust/ql/test/extractor-tests/macro-expansion/test.expected b/rust/ql/test/extractor-tests/macro-expansion/test.expected index 10a73fd947c8..19bceca92129 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/test.expected +++ b/rust/ql/test/extractor-tests/macro-expansion/test.expected @@ -11,6 +11,12 @@ attribute_macros | macro_expansion.rs:15:1:16:14 | fn bar_0 | 1 | macro_expansion.rs:16:1:16:14 | fn bar_0_new | | macro_expansion.rs:15:1:16:14 | fn bar_1 | 0 | macro_expansion.rs:16:1:16:14 | fn bar_1 | | macro_expansion.rs:15:1:16:14 | fn bar_1 | 1 | macro_expansion.rs:16:1:16:14 | fn bar_1_new | +derive_macros +| macro_expansion.rs:83:1:86:1 | struct MyDerive | 0 | 0 | macro_expansion.rs:84:8:85:9 | impl ...::Debug for MyDerive::<...> { ... } | +| macro_expansion.rs:88:1:92:1 | enum MyDeriveEnum | 0 | 0 | macro_expansion.rs:89:6:91:12 | impl ...::PartialEq for MyDeriveEnum::<...> { ... } | +| macro_expansion.rs:88:1:92:1 | enum MyDeriveEnum | 1 | 0 | macro_expansion.rs:89:6:89:17 | impl ...::Eq for MyDeriveEnum::<...> { ... } | +| macro_expansion.rs:98:1:102:1 | union MyDeriveUnion | 0 | 0 | macro_expansion.rs:99:7:99:19 | Const | +| macro_expansion.rs:98:1:102:1 | union MyDeriveUnion | 0 | 1 | macro_expansion.rs:99:7:99:19 | impl MyTrait for MyDeriveUnion { ... } | macro_calls | included/included.rs:2:9:2:39 | concat!... | included/included.rs:2:17:2:38 | "Hello world!" | | macro_expansion.rs:5:9:5:34 | concat!... | macro_expansion.rs:5:17:5:34 | "Hello world!" | diff --git a/rust/ql/test/extractor-tests/macro-expansion/test.ql b/rust/ql/test/extractor-tests/macro-expansion/test.ql index 1952dff3041f..7d97ea6a10f0 100644 --- a/rust/ql/test/extractor-tests/macro-expansion/test.ql +++ b/rust/ql/test/extractor-tests/macro-expansion/test.ql @@ -5,6 +5,10 @@ query predicate attribute_macros(Item i, int index, Item expanded) { i.fromSource() and expanded = i.getAttributeMacroExpansion().getItem(index) } +query predicate derive_macros(Adt i, int index, int subIndex, Item expanded) { + i.fromSource() and expanded = i.getDeriveMacroExpansion(index).getItem(subIndex) +} + query predicate macro_calls(MacroCall c, AstNode expansion) { c.fromSource() and not c.getLocation().getFile().getAbsolutePath().matches("%proc_macro.rs") and diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index aebf9a7a410d..ab5a62d9a98a 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -16,6 +16,13 @@ class LoopingExpr(LabelableExpr): loop_body: optional["BlockExpr"] | child +class Adt(Item): + """ + An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. + """ + derive_macro_expansions: list[MacroItems] | child | rust.detach + + @annotate(Module) @rust.doc_test_signature(None) class _: @@ -1032,7 +1039,7 @@ class _: """ -@annotate(Enum) +@annotate(Enum, replace_bases={Item: Adt}) class _: """ An enum declaration. @@ -1827,7 +1834,7 @@ class _: """ -@annotate(Struct) +@annotate(Struct, replace_bases={Item: Adt}) class _: """ A Struct. For example: @@ -2006,7 +2013,7 @@ class _: """ -@annotate(Union) +@annotate(Union, replace_bases={Item: Adt}) class _: """ A union declaration. From 3590ccaa69a252fa4a00d7fe73cfe2a7fc104b46 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 14:32:24 +0200 Subject: [PATCH 2/7] Rust: fix tests --- .../canonical_path/canonical_paths.expected | 8 + .../canonical_paths.expected | 8 + .../generated/Enum/Enum.expected | 2 +- .../generated/MacroItems/MacroItems.expected | 1 + .../MacroItems/MacroItems_getItem.expected | 1 + .../generated/Struct/Struct.expected | 2 +- .../generated/Union/Union.expected | 2 +- .../PathResolutionConsistency.expected | 4 + .../type-inference/type-inference.expected | 1059 +++++++++++++++++ rust/ql/test/library-tests/variables/main.rs | 2 +- .../PathResolutionConsistency.expected | 14 +- 11 files changed, 1092 insertions(+), 11 deletions(-) diff --git a/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected b/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected index 0376d52b26ed..49bf47841d0c 100644 --- a/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected +++ b/rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected @@ -5,6 +5,9 @@ canonicalPath | lib.rs:1:1:1:14 | mod anonymous | test::anonymous | | lib.rs:2:1:2:12 | mod regular | test::regular | | regular.rs:1:1:2:18 | struct Struct | test::regular::Struct | +| regular.rs:2:12:2:17 | fn eq | ::eq | +| regular.rs:2:12:2:17 | impl ...::Eq for Struct::<...> { ... } | | +| regular.rs:2:12:2:17 | impl ...::PartialEq for Struct::<...> { ... } | | | regular.rs:4:1:6:1 | trait Trait | test::regular::Trait | | regular.rs:5:5:5:16 | fn f | <_ as test::regular::Trait>::f | | regular.rs:8:1:10:1 | impl Trait for Struct { ... } | | @@ -42,6 +45,9 @@ canonicalPaths | lib.rs:1:1:1:14 | mod anonymous | repo::test | crate::anonymous | | lib.rs:2:1:2:12 | mod regular | repo::test | crate::regular | | regular.rs:1:1:2:18 | struct Struct | repo::test | crate::regular::Struct | +| regular.rs:2:12:2:17 | fn eq | repo::test | ::eq | +| regular.rs:2:12:2:17 | impl ...::Eq for Struct::<...> { ... } | None | None | +| regular.rs:2:12:2:17 | impl ...::PartialEq for Struct::<...> { ... } | None | None | | regular.rs:4:1:6:1 | trait Trait | repo::test | crate::regular::Trait | | regular.rs:5:5:5:16 | fn f | repo::test | crate::regular::Trait::f | | regular.rs:8:1:10:1 | impl Trait for Struct { ... } | None | None | @@ -66,6 +72,8 @@ resolvedPaths | anonymous.rs:29:9:29:9 | s | None | None | | anonymous.rs:29:9:29:13 | s.g() | None | None | | anonymous.rs:30:9:30:14 | nested | None | None | +| regular.rs:1:1:1:24 | other | None | None | +| regular.rs:1:1:1:24 | self | None | None | | regular.rs:27:13:27:21 | Struct {...} | repo::test | crate::regular::Struct | | regular.rs:28:5:28:5 | s | None | None | | regular.rs:28:5:28:9 | s.f() | repo::test | ::f | diff --git a/rust/ql/test/extractor-tests/canonical_path_disabled/canonical_paths.expected b/rust/ql/test/extractor-tests/canonical_path_disabled/canonical_paths.expected index 215645153853..d411ab289c93 100644 --- a/rust/ql/test/extractor-tests/canonical_path_disabled/canonical_paths.expected +++ b/rust/ql/test/extractor-tests/canonical_path_disabled/canonical_paths.expected @@ -5,6 +5,9 @@ canonicalPath | lib.rs:1:1:1:14 | mod anonymous | test::anonymous | | lib.rs:2:1:2:12 | mod regular | test::regular | | regular.rs:4:1:5:18 | struct Struct | test::regular::Struct | +| regular.rs:5:12:5:17 | fn eq | ::eq | +| regular.rs:5:12:5:17 | impl ...::Eq for Struct::<...> { ... } | | +| regular.rs:5:12:5:17 | impl ...::PartialEq for Struct::<...> { ... } | | | regular.rs:7:1:9:1 | trait Trait | test::regular::Trait | | regular.rs:8:5:8:16 | fn f | <_ as test::regular::Trait>::f | | regular.rs:11:1:13:1 | impl Trait for Struct { ... } | | @@ -42,6 +45,9 @@ canonicalPaths | lib.rs:1:1:1:14 | mod anonymous | None | None | | lib.rs:2:1:2:12 | mod regular | None | None | | regular.rs:4:1:5:18 | struct Struct | None | None | +| regular.rs:5:12:5:17 | fn eq | None | None | +| regular.rs:5:12:5:17 | impl ...::Eq for Struct::<...> { ... } | None | None | +| regular.rs:5:12:5:17 | impl ...::PartialEq for Struct::<...> { ... } | None | None | | regular.rs:7:1:9:1 | trait Trait | None | None | | regular.rs:8:5:8:16 | fn f | None | None | | regular.rs:11:1:13:1 | impl Trait for Struct { ... } | None | None | @@ -66,6 +72,8 @@ resolvedPaths | anonymous.rs:32:9:32:9 | s | None | None | | anonymous.rs:32:9:32:13 | s.g() | None | None | | anonymous.rs:33:9:33:14 | nested | None | None | +| regular.rs:4:1:4:24 | other | None | None | +| regular.rs:4:1:4:24 | self | None | None | | regular.rs:30:13:30:21 | Struct {...} | None | None | | regular.rs:31:5:31:5 | s | None | None | | regular.rs:31:5:31:9 | s.f() | None | None | diff --git a/rust/ql/test/extractor-tests/generated/Enum/Enum.expected b/rust/ql/test/extractor-tests/generated/Enum/Enum.expected index 02547a2400ee..cefb56b3334d 100644 --- a/rust/ql/test/extractor-tests/generated/Enum/Enum.expected +++ b/rust/ql/test/extractor-tests/generated/Enum/Enum.expected @@ -1 +1 @@ -| gen_enum.rs:4:5:7:34 | enum E | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfAttrs: | 0 | hasGenericParamList: | no | hasName: | yes | hasVariantList: | yes | hasVisibility: | no | hasWhereClause: | no | +| gen_enum.rs:4:5:7:34 | enum E | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfDeriveMacroExpansions: | 0 | getNumberOfAttrs: | 0 | hasGenericParamList: | no | hasName: | yes | hasVariantList: | yes | hasVisibility: | no | hasWhereClause: | no | diff --git a/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems.expected b/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems.expected index 651c7cdec66e..00f51a7b82bf 100644 --- a/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems.expected +++ b/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems.expected @@ -1 +1,2 @@ | gen_macro_items.rs:5:5:5:38 | MacroItems | getNumberOfItems: | 2 | +| gen_macro_items.rs:13:12:13:14 | MacroItems | getNumberOfItems: | 1 | diff --git a/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems_getItem.expected b/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems_getItem.expected index e86dfee101a5..803bf159c945 100644 --- a/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems_getItem.expected +++ b/rust/ql/test/extractor-tests/generated/MacroItems/MacroItems_getItem.expected @@ -1,2 +1,3 @@ | gen_macro_items.rs:5:5:5:38 | MacroItems | 0 | gen_macro_items.rs:5:5:5:38 | use ...::Path | | gen_macro_items.rs:5:5:5:38 | MacroItems | 1 | gen_macro_items.rs:5:5:5:38 | fn get_parent | +| gen_macro_items.rs:13:12:13:14 | MacroItems | 0 | gen_macro_items.rs:13:12:13:14 | impl ...::Debug for Bar::<...> { ... } | diff --git a/rust/ql/test/extractor-tests/generated/Struct/Struct.expected b/rust/ql/test/extractor-tests/generated/Struct/Struct.expected index 63c314de8695..971e141a2024 100644 --- a/rust/ql/test/extractor-tests/generated/Struct/Struct.expected +++ b/rust/ql/test/extractor-tests/generated/Struct/Struct.expected @@ -1 +1 @@ -| gen_struct.rs:4:5:8:5 | struct Point | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfAttrs: | 0 | hasFieldList: | yes | hasGenericParamList: | no | hasName: | yes | hasVisibility: | no | hasWhereClause: | no | +| gen_struct.rs:4:5:8:5 | struct Point | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfDeriveMacroExpansions: | 0 | getNumberOfAttrs: | 0 | hasFieldList: | yes | hasGenericParamList: | no | hasName: | yes | hasVisibility: | no | hasWhereClause: | no | diff --git a/rust/ql/test/extractor-tests/generated/Union/Union.expected b/rust/ql/test/extractor-tests/generated/Union/Union.expected index bc0b9974b409..22d383104ea6 100644 --- a/rust/ql/test/extractor-tests/generated/Union/Union.expected +++ b/rust/ql/test/extractor-tests/generated/Union/Union.expected @@ -1 +1 @@ -| gen_union.rs:4:5:7:32 | union U | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfAttrs: | 0 | hasGenericParamList: | no | hasName: | yes | hasStructFieldList: | yes | hasVisibility: | no | hasWhereClause: | no | +| gen_union.rs:4:5:7:32 | union U | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfDeriveMacroExpansions: | 0 | getNumberOfAttrs: | 0 | hasGenericParamList: | no | hasName: | yes | hasStructFieldList: | yes | hasVisibility: | no | hasWhereClause: | no | diff --git a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected index 5667ceb627d7..e7649be55f99 100644 --- a/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/CONSISTENCY/PathResolutionConsistency.expected @@ -86,6 +86,10 @@ multiplePathResolutions | test_futures_io.rs:25:23:25:61 | ...::try_from | file://:0:0:0:0 | fn try_from | | test_futures_io.rs:145:26:145:43 | ...::with_capacity | file://:0:0:0:0 | fn with_capacity | | test_futures_io.rs:145:26:145:43 | ...::with_capacity | file://:0:0:0:0 | fn with_capacity | +| web_frameworks.rs:40:5:40:26 | ...::write_str | file://:0:0:0:0 | fn write_str | +| web_frameworks.rs:40:5:40:26 | ...::write_str | file://:0:0:0:0 | fn write_str | +| web_frameworks.rs:40:5:40:26 | ...::write_str | file://:0:0:0:0 | fn write_str | +| web_frameworks.rs:40:5:40:26 | ...::write_str | file://:0:0:0:0 | fn write_str | multipleCanonicalPaths | file://:0:0:0:0 | fn to_ordering | file://:0:0:0:0 | Crate(typenum@1.18.0) | ::to_ordering | | file://:0:0:0:0 | fn to_ordering | file://:0:0:0:0 | Crate(typenum@1.18.0) | ::to_ordering | diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 758882f52d84..4f3361d12a07 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -2,6 +2,90 @@ inferType | loop/main.rs:7:12:7:15 | SelfParam | | loop/main.rs:6:1:8:1 | Self [trait T1] | | loop/main.rs:11:12:11:15 | SelfParam | | loop/main.rs:10:1:14:1 | Self [trait T2] | | loop/main.rs:12:9:12:12 | self | | loop/main.rs:10:1:14:1 | Self [trait T2] | +| main.rs:2:5:2:20 | "S" | | {EXTERNAL LOCATION} | str | +| main.rs:2:5:2:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:2:5:2:20 | SelfParam | &T | main.rs:2:5:3:13 | S | +| main.rs:2:5:2:20 | f | | file://:0:0:0:0 | & | +| main.rs:2:5:2:20 | f | | file://:0:0:0:0 | & | +| main.rs:2:5:2:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:2:5:2:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:2:5:2:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:2:5:2:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:2:5:2:20 | self | | file://:0:0:0:0 | & | +| main.rs:2:5:2:20 | self | &T | main.rs:2:5:3:13 | S | +| main.rs:3:12:3:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:3:12:3:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:3:12:3:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:3:12:3:12 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:5:5:5:20 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:5:5:5:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:5:5:5:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:5:5:5:20 | SelfParam | &T | main.rs:5:5:8:5 | MyThing | +| main.rs:5:5:5:20 | f | | file://:0:0:0:0 | & | +| main.rs:5:5:5:20 | f | | file://:0:0:0:0 | & | +| main.rs:5:5:5:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:5:5:5:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:5:5:5:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:5:5:5:20 | self | | file://:0:0:0:0 | & | +| main.rs:5:5:5:20 | self | &T | main.rs:5:5:8:5 | MyThing | +| main.rs:6:12:7:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:6:12:7:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:6:12:7:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:6:12:7:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:7:9:7:9 | &a | | file://:0:0:0:0 | & | +| main.rs:7:9:7:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:7:9:7:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:7:9:7:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:7:9:7:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:10:5:10:20 | "MyNone" | | {EXTERNAL LOCATION} | str | +| main.rs:10:5:10:20 | "MySome" | | {EXTERNAL LOCATION} | str | +| main.rs:10:5:10:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:10:5:10:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:10:5:10:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:10:5:10:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:10:5:10:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:10:5:10:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | SelfParam | &T | main.rs:10:5:14:5 | MyOption | +| main.rs:10:5:10:20 | SelfParam | &T.T | main.rs:11:19:11:19 | T | +| main.rs:10:5:10:20 | f | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | f | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | f | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:10:5:10:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:10:5:10:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:10:5:10:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:10:5:10:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:10:5:10:20 | self | | file://:0:0:0:0 | & | +| main.rs:10:5:10:20 | self | &T | main.rs:10:5:14:5 | MyOption | +| main.rs:10:5:10:20 | self | &T.T | main.rs:11:19:11:19 | T | +| main.rs:11:10:13:14 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:11:10:13:14 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:11:10:13:14 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:11:10:13:14 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:16:5:16:20 | "GenericThing" | | {EXTERNAL LOCATION} | str | +| main.rs:16:5:16:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:16:5:16:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:16:5:16:20 | SelfParam | &T | main.rs:16:5:19:5 | GenericThing | +| main.rs:16:5:16:20 | SelfParam | &T.A | main.rs:17:25:17:25 | A | +| main.rs:16:5:16:20 | f | | file://:0:0:0:0 | & | +| main.rs:16:5:16:20 | f | | file://:0:0:0:0 | & | +| main.rs:16:5:16:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:16:5:16:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:16:5:16:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:16:5:16:20 | self | | file://:0:0:0:0 | & | +| main.rs:16:5:16:20 | self | &T | main.rs:16:5:19:5 | GenericThing | +| main.rs:16:5:16:20 | self | &T.A | main.rs:17:25:17:25 | A | +| main.rs:17:12:18:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:17:12:18:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:17:12:18:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:17:12:18:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:18:9:18:9 | &a | | file://:0:0:0:0 | & | +| main.rs:18:9:18:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:18:9:18:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:18:9:18:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:18:9:18:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | | main.rs:26:13:26:13 | x | | main.rs:5:5:8:5 | MyThing | | main.rs:26:17:26:32 | MyThing {...} | | main.rs:5:5:8:5 | MyThing | | main.rs:26:30:26:30 | S | | main.rs:2:5:3:13 | S | @@ -95,6 +179,26 @@ inferType | main.rs:93:9:93:14 | x.m1() | | main.rs:72:5:72:21 | Foo | | main.rs:94:9:94:9 | y | | main.rs:72:5:72:21 | Foo | | main.rs:94:9:94:14 | y.m2() | | main.rs:72:5:72:21 | Foo | +| main.rs:99:5:99:20 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:99:5:99:20 | "field" | | {EXTERNAL LOCATION} | str | +| main.rs:99:5:99:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:99:5:99:20 | SelfParam | &T | main.rs:99:5:102:5 | MyThing | +| main.rs:99:5:99:20 | f | | file://:0:0:0:0 | & | +| main.rs:99:5:99:20 | f | | file://:0:0:0:0 | & | +| main.rs:99:5:99:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:99:5:99:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:99:5:99:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:99:5:99:20 | self | | file://:0:0:0:0 | & | +| main.rs:99:5:99:20 | self | &T | main.rs:99:5:102:5 | MyThing | +| main.rs:100:12:101:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:100:12:101:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:100:12:101:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:100:12:101:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:101:9:101:13 | &field | | file://:0:0:0:0 | & | +| main.rs:101:9:101:13 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:101:9:101:13 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:101:9:101:13 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:101:9:101:13 | ... .finish() | E | {EXTERNAL LOCATION} | Error | | main.rs:105:25:105:28 | SelfParam | | main.rs:104:5:106:5 | Self [trait MyTrait] | | main.rs:110:25:110:28 | SelfParam | | main.rs:99:5:102:5 | MyThing | | main.rs:110:39:112:9 | { ... } | | {EXTERNAL LOCATION} | bool | @@ -112,6 +216,58 @@ inferType | main.rs:120:13:120:13 | b | | {EXTERNAL LOCATION} | bool | | main.rs:120:17:120:40 | ...::trait_method(...) | | {EXTERNAL LOCATION} | bool | | main.rs:120:39:120:39 | y | | main.rs:99:5:102:5 | MyThing | +| main.rs:125:5:125:20 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:125:5:125:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:125:5:125:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:125:5:125:20 | SelfParam | &T | main.rs:125:5:128:5 | MyThing | +| main.rs:125:5:125:20 | SelfParam | &T.A | main.rs:126:20:126:20 | A | +| main.rs:125:5:125:20 | f | | file://:0:0:0:0 | & | +| main.rs:125:5:125:20 | f | | file://:0:0:0:0 | & | +| main.rs:125:5:125:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:125:5:125:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:125:5:125:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:125:5:125:20 | self | | file://:0:0:0:0 | & | +| main.rs:125:5:125:20 | self | &T | main.rs:125:5:128:5 | MyThing | +| main.rs:125:5:125:20 | self | &T.A | main.rs:126:20:126:20 | A | +| main.rs:126:12:127:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:126:12:127:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:126:12:127:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:126:12:127:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:127:9:127:9 | &a | | file://:0:0:0:0 | & | +| main.rs:127:9:127:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:127:9:127:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:127:9:127:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:127:9:127:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:130:5:130:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:130:5:130:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:130:5:130:20 | SelfParam | &T | main.rs:130:5:131:14 | S1 | +| main.rs:130:5:130:20 | f | | file://:0:0:0:0 | & | +| main.rs:130:5:130:20 | f | | file://:0:0:0:0 | & | +| main.rs:130:5:130:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:130:5:130:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:130:5:130:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:130:5:130:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:130:5:130:20 | self | | file://:0:0:0:0 | & | +| main.rs:130:5:130:20 | self | &T | main.rs:130:5:131:14 | S1 | +| main.rs:131:12:131:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:131:12:131:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:131:12:131:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:131:12:131:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:132:5:132:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:132:5:132:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:132:5:132:20 | SelfParam | &T | main.rs:132:5:133:14 | S2 | +| main.rs:132:5:132:20 | f | | file://:0:0:0:0 | & | +| main.rs:132:5:132:20 | f | | file://:0:0:0:0 | & | +| main.rs:132:5:132:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:132:5:132:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:132:5:132:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:132:5:132:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:132:5:132:20 | self | | file://:0:0:0:0 | & | +| main.rs:132:5:132:20 | self | &T | main.rs:132:5:133:14 | S2 | +| main.rs:133:12:133:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:133:12:133:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:133:12:133:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:133:12:133:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:137:15:137:18 | SelfParam | | main.rs:125:5:128:5 | MyThing | | main.rs:137:15:137:18 | SelfParam | A | main.rs:130:5:131:14 | S1 | | main.rs:137:27:139:9 | { ... } | | main.rs:130:5:131:14 | S1 | @@ -179,6 +335,156 @@ inferType | main.rs:170:26:170:26 | y | | main.rs:125:5:128:5 | MyThing | | main.rs:170:26:170:26 | y | A | main.rs:132:5:133:14 | S2 | | main.rs:170:26:170:31 | y.m2() | | main.rs:132:5:133:14 | S2 | +| main.rs:175:5:175:33 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:175:5:175:33 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:175:5:175:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | SelfParam | &T | main.rs:175:5:178:5 | MyThing | +| main.rs:175:5:175:33 | SelfParam | &T | main.rs:175:5:178:5 | MyThing | +| main.rs:175:5:175:33 | SelfParam | &T.A | main.rs:176:20:176:20 | A | +| main.rs:175:5:175:33 | SelfParam | &T.A | main.rs:176:20:176:20 | A | +| main.rs:175:5:175:33 | f | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | f | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:175:5:175:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:175:5:175:33 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:175:5:175:33 | self | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | self | | file://:0:0:0:0 | & | +| main.rs:175:5:175:33 | self | &T | main.rs:175:5:178:5 | MyThing | +| main.rs:175:5:175:33 | self | &T | main.rs:175:5:178:5 | MyThing | +| main.rs:175:5:175:33 | self | &T.A | main.rs:176:20:176:20 | A | +| main.rs:175:5:175:33 | self | &T.A | main.rs:176:20:176:20 | A | +| main.rs:176:12:177:9 | MyThing {...} | | main.rs:175:5:178:5 | MyThing | +| main.rs:176:12:177:9 | MyThing {...} | A | main.rs:176:20:176:20 | A | +| main.rs:176:12:177:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:176:12:177:9 | match self { ... } | | main.rs:175:5:178:5 | MyThing | +| main.rs:176:12:177:9 | match self { ... } | A | main.rs:176:20:176:20 | A | +| main.rs:176:12:177:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:176:12:177:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:176:12:177:9 | { ... } | | main.rs:175:5:178:5 | MyThing | +| main.rs:176:12:177:9 | { ... } | A | main.rs:176:20:176:20 | A | +| main.rs:176:12:177:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:177:9:177:9 | &a | | file://:0:0:0:0 | & | +| main.rs:177:9:177:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:177:9:177:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:177:9:177:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:177:9:177:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:177:9:177:9 | a.clone() | | main.rs:176:20:176:20 | A | +| main.rs:180:5:180:33 | "MyPair" | | {EXTERNAL LOCATION} | str | +| main.rs:180:5:180:33 | "p1" | | {EXTERNAL LOCATION} | str | +| main.rs:180:5:180:33 | "p2" | | {EXTERNAL LOCATION} | str | +| main.rs:180:5:180:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | SelfParam | &T | main.rs:180:5:184:5 | MyPair | +| main.rs:180:5:180:33 | SelfParam | &T | main.rs:180:5:184:5 | MyPair | +| main.rs:180:5:180:33 | SelfParam | &T.P1 | main.rs:181:19:181:20 | P1 | +| main.rs:180:5:180:33 | SelfParam | &T.P1 | main.rs:181:19:181:20 | P1 | +| main.rs:180:5:180:33 | SelfParam | &T.P2 | main.rs:181:23:181:24 | P2 | +| main.rs:180:5:180:33 | SelfParam | &T.P2 | main.rs:181:23:181:24 | P2 | +| main.rs:180:5:180:33 | f | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | f | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:180:5:180:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:180:5:180:33 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:180:5:180:33 | self | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | self | | file://:0:0:0:0 | & | +| main.rs:180:5:180:33 | self | &T | main.rs:180:5:184:5 | MyPair | +| main.rs:180:5:180:33 | self | &T | main.rs:180:5:184:5 | MyPair | +| main.rs:180:5:180:33 | self | &T.P1 | main.rs:181:19:181:20 | P1 | +| main.rs:180:5:180:33 | self | &T.P1 | main.rs:181:19:181:20 | P1 | +| main.rs:180:5:180:33 | self | &T.P2 | main.rs:181:23:181:24 | P2 | +| main.rs:180:5:180:33 | self | &T.P2 | main.rs:181:23:181:24 | P2 | +| main.rs:181:12:183:10 | MyPair {...} | | main.rs:180:5:184:5 | MyPair | +| main.rs:181:12:183:10 | MyPair {...} | P1 | main.rs:181:19:181:20 | P1 | +| main.rs:181:12:183:10 | MyPair {...} | P2 | main.rs:181:23:181:24 | P2 | +| main.rs:181:12:183:10 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:181:12:183:10 | match self { ... } | | main.rs:180:5:184:5 | MyPair | +| main.rs:181:12:183:10 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:181:12:183:10 | match self { ... } | P1 | main.rs:181:19:181:20 | P1 | +| main.rs:181:12:183:10 | match self { ... } | P2 | main.rs:181:23:181:24 | P2 | +| main.rs:181:12:183:10 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:181:12:183:10 | { ... } | | main.rs:180:5:184:5 | MyPair | +| main.rs:181:12:183:10 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:181:12:183:10 | { ... } | P1 | main.rs:181:19:181:20 | P1 | +| main.rs:181:12:183:10 | { ... } | P2 | main.rs:181:23:181:24 | P2 | +| main.rs:182:9:182:10 | &p1 | | file://:0:0:0:0 | & | +| main.rs:182:9:182:10 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:182:9:182:10 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:182:9:182:10 | p1.clone() | | main.rs:181:19:181:20 | P1 | +| main.rs:182:9:183:10 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:182:9:183:10 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:182:9:183:10 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:182:9:183:10 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:183:9:183:10 | &p2 | | file://:0:0:0:0 | & | +| main.rs:183:9:183:10 | p2.clone() | | main.rs:181:23:181:24 | P2 | +| main.rs:186:5:186:33 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:186:5:186:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | SelfParam | &T | main.rs:186:5:187:14 | S1 | +| main.rs:186:5:186:33 | SelfParam | &T | main.rs:186:5:187:14 | S1 | +| main.rs:186:5:186:33 | f | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | f | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:186:5:186:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:186:5:186:33 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:186:5:186:33 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:186:5:186:33 | self | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | self | | file://:0:0:0:0 | & | +| main.rs:186:5:186:33 | self | &T | main.rs:186:5:187:14 | S1 | +| main.rs:186:5:186:33 | self | &T | main.rs:186:5:187:14 | S1 | +| main.rs:187:12:187:13 | S1 | | main.rs:186:5:187:14 | S1 | +| main.rs:187:12:187:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:187:12:187:13 | match self { ... } | | main.rs:186:5:187:14 | S1 | +| main.rs:187:12:187:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:187:12:187:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:187:12:187:13 | { ... } | | main.rs:186:5:187:14 | S1 | +| main.rs:187:12:187:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:188:5:188:33 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:188:5:188:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | SelfParam | &T | main.rs:188:5:189:14 | S2 | +| main.rs:188:5:188:33 | SelfParam | &T | main.rs:188:5:189:14 | S2 | +| main.rs:188:5:188:33 | f | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | f | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:188:5:188:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:188:5:188:33 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:188:5:188:33 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:188:5:188:33 | self | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | self | | file://:0:0:0:0 | & | +| main.rs:188:5:188:33 | self | &T | main.rs:188:5:189:14 | S2 | +| main.rs:188:5:188:33 | self | &T | main.rs:188:5:189:14 | S2 | +| main.rs:189:12:189:13 | S2 | | main.rs:188:5:189:14 | S2 | +| main.rs:189:12:189:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:189:12:189:13 | match self { ... } | | main.rs:188:5:189:14 | S2 | +| main.rs:189:12:189:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:189:12:189:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:189:12:189:13 | { ... } | | main.rs:188:5:189:14 | S2 | +| main.rs:189:12:189:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:190:5:190:42 | "S3" | | {EXTERNAL LOCATION} | str | +| main.rs:190:5:190:42 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | SelfParam | &T | main.rs:190:5:191:14 | S3 | +| main.rs:190:5:190:42 | SelfParam | &T | main.rs:190:5:191:14 | S3 | +| main.rs:190:5:190:42 | f | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | f | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:190:5:190:42 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:190:5:190:42 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:190:5:190:42 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:190:5:190:42 | self | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | self | | file://:0:0:0:0 | & | +| main.rs:190:5:190:42 | self | &T | main.rs:190:5:191:14 | S3 | +| main.rs:190:5:190:42 | self | &T | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | S3 | | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | S3 | | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:191:12:191:13 | match self { ... } | | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:191:12:191:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:191:12:191:13 | { ... } | | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | { ... } | | main.rs:190:5:191:14 | S3 | +| main.rs:191:12:191:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:194:15:194:18 | SelfParam | | main.rs:193:5:202:5 | Self [trait MyTrait] | | main.rs:196:15:196:18 | SelfParam | | main.rs:193:5:202:5 | Self [trait MyTrait] | | main.rs:199:9:201:9 | { ... } | | main.rs:193:5:202:5 | Self [trait MyTrait] | @@ -512,6 +818,28 @@ inferType | main.rs:392:17:392:33 | convert_to(...) | | main.rs:186:5:187:14 | S1 | | main.rs:392:28:392:32 | thing | | main.rs:175:5:178:5 | MyThing | | main.rs:392:28:392:32 | thing | A | main.rs:186:5:187:14 | S1 | +| main.rs:397:5:397:33 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:397:5:397:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | SelfParam | &T | main.rs:397:5:398:14 | S1 | +| main.rs:397:5:397:33 | SelfParam | &T | main.rs:397:5:398:14 | S1 | +| main.rs:397:5:397:33 | f | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | f | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:397:5:397:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:397:5:397:33 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:397:5:397:33 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:397:5:397:33 | self | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | self | | file://:0:0:0:0 | & | +| main.rs:397:5:397:33 | self | &T | main.rs:397:5:398:14 | S1 | +| main.rs:397:5:397:33 | self | &T | main.rs:397:5:398:14 | S1 | +| main.rs:398:12:398:13 | S1 | | main.rs:397:5:398:14 | S1 | +| main.rs:398:12:398:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:398:12:398:13 | match self { ... } | | main.rs:397:5:398:14 | S1 | +| main.rs:398:12:398:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:398:12:398:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:398:12:398:13 | { ... } | | main.rs:397:5:398:14 | S1 | +| main.rs:398:12:398:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:401:26:401:29 | SelfParam | | main.rs:400:5:404:5 | Self [trait OverlappingTrait] | | main.rs:403:28:403:31 | SelfParam | | main.rs:400:5:404:5 | Self [trait OverlappingTrait] | | main.rs:403:34:403:35 | s1 | | main.rs:397:5:398:14 | S1 | @@ -536,6 +864,36 @@ inferType | main.rs:433:18:433:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str | | main.rs:433:26:433:26 | x | | main.rs:397:5:398:14 | S1 | | main.rs:433:26:433:44 | x.common_method_2() | | main.rs:397:5:398:14 | S1 | +| main.rs:440:5:440:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:440:5:440:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:440:5:440:20 | SelfParam | &T | main.rs:440:5:441:14 | S1 | +| main.rs:440:5:440:20 | f | | file://:0:0:0:0 | & | +| main.rs:440:5:440:20 | f | | file://:0:0:0:0 | & | +| main.rs:440:5:440:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:440:5:440:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:440:5:440:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:440:5:440:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:440:5:440:20 | self | | file://:0:0:0:0 | & | +| main.rs:440:5:440:20 | self | &T | main.rs:440:5:441:14 | S1 | +| main.rs:441:12:441:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:441:12:441:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:441:12:441:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:441:12:441:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:443:5:443:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:443:5:443:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:443:5:443:20 | SelfParam | &T | main.rs:443:5:444:14 | S2 | +| main.rs:443:5:443:20 | f | | file://:0:0:0:0 | & | +| main.rs:443:5:443:20 | f | | file://:0:0:0:0 | & | +| main.rs:443:5:443:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:443:5:443:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:443:5:443:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:443:5:443:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:443:5:443:20 | self | | file://:0:0:0:0 | & | +| main.rs:443:5:443:20 | self | &T | main.rs:443:5:444:14 | S2 | +| main.rs:444:12:444:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:444:12:444:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:444:12:444:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:444:12:444:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:450:19:450:22 | SelfParam | | main.rs:448:5:451:5 | Self [trait FirstTrait] | | main.rs:455:19:455:22 | SelfParam | | main.rs:453:5:456:5 | Self [trait SecondTrait] | | main.rs:458:64:458:64 | x | | main.rs:458:45:458:61 | T | @@ -608,6 +966,58 @@ inferType | main.rs:511:18:511:29 | "{:?}, {:?}\\n" | | {EXTERNAL LOCATION} | str | | main.rs:511:32:511:33 | s1 | | {EXTERNAL LOCATION} | u8 | | main.rs:511:36:511:37 | s2 | | {EXTERNAL LOCATION} | i64 | +| main.rs:516:5:516:20 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:516:5:516:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:516:5:516:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:516:5:516:20 | SelfParam | &T | main.rs:516:5:519:5 | MyThing | +| main.rs:516:5:516:20 | SelfParam | &T.T | main.rs:517:20:517:20 | T | +| main.rs:516:5:516:20 | f | | file://:0:0:0:0 | & | +| main.rs:516:5:516:20 | f | | file://:0:0:0:0 | & | +| main.rs:516:5:516:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:516:5:516:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:516:5:516:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:516:5:516:20 | self | | file://:0:0:0:0 | & | +| main.rs:516:5:516:20 | self | &T | main.rs:516:5:519:5 | MyThing | +| main.rs:516:5:516:20 | self | &T.T | main.rs:517:20:517:20 | T | +| main.rs:517:12:518:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:517:12:518:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:517:12:518:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:517:12:518:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:518:9:518:9 | &a | | file://:0:0:0:0 | & | +| main.rs:518:9:518:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:518:9:518:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:518:9:518:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:518:9:518:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:521:5:521:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:521:5:521:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:521:5:521:20 | SelfParam | &T | main.rs:521:5:522:14 | S1 | +| main.rs:521:5:521:20 | f | | file://:0:0:0:0 | & | +| main.rs:521:5:521:20 | f | | file://:0:0:0:0 | & | +| main.rs:521:5:521:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:521:5:521:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:521:5:521:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:521:5:521:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:521:5:521:20 | self | | file://:0:0:0:0 | & | +| main.rs:521:5:521:20 | self | &T | main.rs:521:5:522:14 | S1 | +| main.rs:522:12:522:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:522:12:522:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:522:12:522:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:522:12:522:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:523:5:523:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:523:5:523:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:523:5:523:20 | SelfParam | &T | main.rs:523:5:524:14 | S2 | +| main.rs:523:5:523:20 | f | | file://:0:0:0:0 | & | +| main.rs:523:5:523:20 | f | | file://:0:0:0:0 | & | +| main.rs:523:5:523:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:523:5:523:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:523:5:523:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:523:5:523:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:523:5:523:20 | self | | file://:0:0:0:0 | & | +| main.rs:523:5:523:20 | self | &T | main.rs:523:5:524:14 | S2 | +| main.rs:524:12:524:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:524:12:524:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:524:12:524:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:524:12:524:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:527:15:527:18 | SelfParam | | main.rs:526:5:535:5 | Self [trait MyTrait] | | main.rs:529:15:529:18 | SelfParam | | main.rs:526:5:535:5 | Self [trait MyTrait] | | main.rs:532:9:534:9 | { ... } | | main.rs:526:19:526:19 | A | @@ -716,6 +1126,28 @@ inferType | main.rs:581:37:581:38 | y3 | T.T | main.rs:523:5:524:14 | S2 | | main.rs:582:18:582:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str | | main.rs:582:26:582:26 | b | | main.rs:523:5:524:14 | S2 | +| main.rs:587:5:587:20 | "Wrapper" | | {EXTERNAL LOCATION} | str | +| main.rs:587:5:587:20 | "field" | | {EXTERNAL LOCATION} | str | +| main.rs:587:5:587:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:587:5:587:20 | SelfParam | &T | main.rs:587:5:590:5 | Wrapper | +| main.rs:587:5:587:20 | SelfParam | &T.A | main.rs:588:20:588:20 | A | +| main.rs:587:5:587:20 | f | | file://:0:0:0:0 | & | +| main.rs:587:5:587:20 | f | | file://:0:0:0:0 | & | +| main.rs:587:5:587:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:587:5:587:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:587:5:587:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:587:5:587:20 | self | | file://:0:0:0:0 | & | +| main.rs:587:5:587:20 | self | &T | main.rs:587:5:590:5 | Wrapper | +| main.rs:587:5:587:20 | self | &T.A | main.rs:588:20:588:20 | A | +| main.rs:588:12:589:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:588:12:589:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:588:12:589:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:588:12:589:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:589:9:589:13 | &field | | file://:0:0:0:0 | & | +| main.rs:589:9:589:13 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:589:9:589:13 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:589:9:589:13 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:589:9:589:13 | ... .finish() | E | {EXTERNAL LOCATION} | Error | | main.rs:593:19:593:22 | SelfParam | | main.rs:587:5:590:5 | Wrapper | | main.rs:593:19:593:22 | SelfParam | A | main.rs:592:10:592:10 | A | | main.rs:593:30:595:9 | { ... } | | main.rs:592:10:592:10 | A | @@ -750,6 +1182,57 @@ inferType | main.rs:633:20:633:24 | SelfParam | &T | main.rs:626:5:636:5 | Self [trait TraitMultipleAssoc] | | main.rs:635:20:635:24 | SelfParam | | file://:0:0:0:0 | & | | main.rs:635:20:635:24 | SelfParam | &T | main.rs:626:5:636:5 | Self [trait TraitMultipleAssoc] | +| main.rs:638:5:638:29 | "S" | | {EXTERNAL LOCATION} | str | +| main.rs:638:5:638:29 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:638:5:638:29 | SelfParam | &T | main.rs:638:5:639:13 | S | +| main.rs:638:5:638:29 | f | | file://:0:0:0:0 | & | +| main.rs:638:5:638:29 | f | | file://:0:0:0:0 | & | +| main.rs:638:5:638:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:638:5:638:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:638:5:638:29 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:638:5:638:29 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:638:5:638:29 | self | | file://:0:0:0:0 | & | +| main.rs:638:5:638:29 | self | &T | main.rs:638:5:639:13 | S | +| main.rs:639:12:639:12 | S | | main.rs:638:5:639:13 | S | +| main.rs:639:12:639:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:639:12:639:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:639:12:639:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:639:12:639:12 | { ... } | | main.rs:638:5:639:13 | S | +| main.rs:639:12:639:12 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:641:5:641:29 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:641:5:641:29 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:641:5:641:29 | SelfParam | &T | main.rs:641:5:642:14 | S2 | +| main.rs:641:5:641:29 | f | | file://:0:0:0:0 | & | +| main.rs:641:5:641:29 | f | | file://:0:0:0:0 | & | +| main.rs:641:5:641:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:641:5:641:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:641:5:641:29 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:641:5:641:29 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:641:5:641:29 | self | | file://:0:0:0:0 | & | +| main.rs:641:5:641:29 | self | &T | main.rs:641:5:642:14 | S2 | +| main.rs:642:12:642:13 | S2 | | main.rs:641:5:642:14 | S2 | +| main.rs:642:12:642:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:642:12:642:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:642:12:642:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:642:12:642:13 | { ... } | | main.rs:641:5:642:14 | S2 | +| main.rs:642:12:642:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:644:5:644:29 | "AT" | | {EXTERNAL LOCATION} | str | +| main.rs:644:5:644:29 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:644:5:644:29 | SelfParam | &T | main.rs:644:5:645:14 | AT | +| main.rs:644:5:644:29 | f | | file://:0:0:0:0 | & | +| main.rs:644:5:644:29 | f | | file://:0:0:0:0 | & | +| main.rs:644:5:644:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:644:5:644:29 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:644:5:644:29 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:644:5:644:29 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:644:5:644:29 | self | | file://:0:0:0:0 | & | +| main.rs:644:5:644:29 | self | &T | main.rs:644:5:645:14 | AT | +| main.rs:645:12:645:13 | AT | | main.rs:644:5:645:14 | AT | +| main.rs:645:12:645:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:645:12:645:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:645:12:645:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:645:12:645:13 | { ... } | | main.rs:644:5:645:14 | AT | +| main.rs:645:12:645:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:651:15:651:18 | SelfParam | | main.rs:638:5:639:13 | S | | main.rs:651:45:653:9 | { ... } | | main.rs:644:5:645:14 | AT | | main.rs:652:13:652:14 | AT | | main.rs:644:5:645:14 | AT | @@ -836,6 +1319,67 @@ inferType | main.rs:731:13:731:21 | assoc_two | | main.rs:641:5:642:14 | S2 | | main.rs:731:25:731:26 | AT | | main.rs:644:5:645:14 | AT | | main.rs:731:25:731:36 | AT.get_two() | | main.rs:641:5:642:14 | S2 | +| main.rs:736:5:736:20 | "C1" | | {EXTERNAL LOCATION} | str | +| main.rs:736:5:736:20 | "C2" | | {EXTERNAL LOCATION} | str | +| main.rs:736:5:736:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:736:5:736:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:736:5:736:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:736:5:736:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:736:5:736:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | SelfParam | &T | main.rs:736:5:740:5 | MyEnum | +| main.rs:736:5:736:20 | SelfParam | &T.A | main.rs:737:17:737:17 | A | +| main.rs:736:5:736:20 | f | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | f | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | f | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:736:5:736:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:736:5:736:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:736:5:736:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:736:5:736:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:736:5:736:20 | self | | file://:0:0:0:0 | & | +| main.rs:736:5:736:20 | self | &T | main.rs:736:5:740:5 | MyEnum | +| main.rs:736:5:736:20 | self | &T.A | main.rs:737:17:737:17 | A | +| main.rs:737:10:739:14 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:737:10:739:14 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:737:10:739:14 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:737:10:739:14 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:739:14:739:14 | &a | | file://:0:0:0:0 | & | +| main.rs:739:14:739:14 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:739:14:739:14 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:739:14:739:14 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:739:14:739:14 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:742:5:742:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:742:5:742:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:742:5:742:20 | SelfParam | &T | main.rs:742:5:743:14 | S1 | +| main.rs:742:5:742:20 | f | | file://:0:0:0:0 | & | +| main.rs:742:5:742:20 | f | | file://:0:0:0:0 | & | +| main.rs:742:5:742:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:742:5:742:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:742:5:742:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:742:5:742:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:742:5:742:20 | self | | file://:0:0:0:0 | & | +| main.rs:742:5:742:20 | self | &T | main.rs:742:5:743:14 | S1 | +| main.rs:743:12:743:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:743:12:743:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:743:12:743:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:743:12:743:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:744:5:744:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:744:5:744:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:744:5:744:20 | SelfParam | &T | main.rs:744:5:745:14 | S2 | +| main.rs:744:5:744:20 | f | | file://:0:0:0:0 | & | +| main.rs:744:5:744:20 | f | | file://:0:0:0:0 | & | +| main.rs:744:5:744:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:744:5:744:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:744:5:744:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:744:5:744:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:744:5:744:20 | self | | file://:0:0:0:0 | & | +| main.rs:744:5:744:20 | self | &T | main.rs:744:5:745:14 | S2 | +| main.rs:745:12:745:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:745:12:745:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:745:12:745:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:745:12:745:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:748:15:748:18 | SelfParam | | main.rs:736:5:740:5 | MyEnum | | main.rs:748:15:748:18 | SelfParam | A | main.rs:747:10:747:10 | T | | main.rs:748:26:753:9 | { ... } | | main.rs:747:10:747:10 | T | @@ -864,6 +1408,80 @@ inferType | main.rs:761:26:761:26 | y | | main.rs:736:5:740:5 | MyEnum | | main.rs:761:26:761:26 | y | A | main.rs:744:5:745:14 | S2 | | main.rs:761:26:761:31 | y.m1() | | main.rs:744:5:745:14 | S2 | +| main.rs:766:5:766:20 | "MyThing" | | {EXTERNAL LOCATION} | str | +| main.rs:766:5:766:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:766:5:766:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:766:5:766:20 | SelfParam | &T | main.rs:766:5:769:5 | MyThing | +| main.rs:766:5:766:20 | SelfParam | &T.A | main.rs:767:20:767:20 | A | +| main.rs:766:5:766:20 | f | | file://:0:0:0:0 | & | +| main.rs:766:5:766:20 | f | | file://:0:0:0:0 | & | +| main.rs:766:5:766:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:766:5:766:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:766:5:766:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:766:5:766:20 | self | | file://:0:0:0:0 | & | +| main.rs:766:5:766:20 | self | &T | main.rs:766:5:769:5 | MyThing | +| main.rs:766:5:766:20 | self | &T.A | main.rs:767:20:767:20 | A | +| main.rs:767:12:768:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:767:12:768:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:767:12:768:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:767:12:768:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:768:9:768:9 | &a | | file://:0:0:0:0 | & | +| main.rs:768:9:768:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:768:9:768:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:768:9:768:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:768:9:768:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:771:5:771:20 | "MyThing2" | | {EXTERNAL LOCATION} | str | +| main.rs:771:5:771:20 | "a" | | {EXTERNAL LOCATION} | str | +| main.rs:771:5:771:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:771:5:771:20 | SelfParam | &T | main.rs:771:5:774:5 | MyThing2 | +| main.rs:771:5:771:20 | SelfParam | &T.A | main.rs:772:21:772:21 | A | +| main.rs:771:5:771:20 | f | | file://:0:0:0:0 | & | +| main.rs:771:5:771:20 | f | | file://:0:0:0:0 | & | +| main.rs:771:5:771:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:771:5:771:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:771:5:771:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:771:5:771:20 | self | | file://:0:0:0:0 | & | +| main.rs:771:5:771:20 | self | &T | main.rs:771:5:774:5 | MyThing2 | +| main.rs:771:5:771:20 | self | &T.A | main.rs:772:21:772:21 | A | +| main.rs:772:12:773:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:772:12:773:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:772:12:773:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:772:12:773:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:773:9:773:9 | &a | | file://:0:0:0:0 | & | +| main.rs:773:9:773:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:773:9:773:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:773:9:773:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:773:9:773:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:776:5:776:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:776:5:776:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:776:5:776:20 | SelfParam | &T | main.rs:776:5:777:14 | S1 | +| main.rs:776:5:776:20 | f | | file://:0:0:0:0 | & | +| main.rs:776:5:776:20 | f | | file://:0:0:0:0 | & | +| main.rs:776:5:776:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:776:5:776:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:776:5:776:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:776:5:776:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:776:5:776:20 | self | | file://:0:0:0:0 | & | +| main.rs:776:5:776:20 | self | &T | main.rs:776:5:777:14 | S1 | +| main.rs:777:12:777:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:777:12:777:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:777:12:777:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:777:12:777:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:778:5:778:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:778:5:778:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:778:5:778:20 | SelfParam | &T | main.rs:778:5:779:14 | S2 | +| main.rs:778:5:778:20 | f | | file://:0:0:0:0 | & | +| main.rs:778:5:778:20 | f | | file://:0:0:0:0 | & | +| main.rs:778:5:778:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:778:5:778:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:778:5:778:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:778:5:778:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:778:5:778:20 | self | | file://:0:0:0:0 | & | +| main.rs:778:5:778:20 | self | &T | main.rs:778:5:779:14 | S2 | +| main.rs:779:12:779:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:779:12:779:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:779:12:779:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:779:12:779:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:783:15:783:18 | SelfParam | | main.rs:781:5:784:5 | Self [trait MyTrait1] | | main.rs:788:15:788:18 | SelfParam | | main.rs:786:5:798:5 | Self [trait MyTrait2] | | main.rs:791:9:797:9 | { ... } | | main.rs:786:20:786:22 | Tr2 | @@ -995,6 +1613,36 @@ inferType | main.rs:867:17:867:32 | call_trait_m1(...) | A | main.rs:778:5:779:14 | S2 | | main.rs:867:31:867:31 | x | | main.rs:771:5:774:5 | MyThing2 | | main.rs:867:31:867:31 | x | A | main.rs:778:5:779:14 | S2 | +| main.rs:875:5:875:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:875:5:875:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:875:5:875:20 | SelfParam | &T | main.rs:875:5:876:14 | S1 | +| main.rs:875:5:875:20 | f | | file://:0:0:0:0 | & | +| main.rs:875:5:875:20 | f | | file://:0:0:0:0 | & | +| main.rs:875:5:875:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:875:5:875:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:875:5:875:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:875:5:875:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:875:5:875:20 | self | | file://:0:0:0:0 | & | +| main.rs:875:5:875:20 | self | &T | main.rs:875:5:876:14 | S1 | +| main.rs:876:12:876:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:876:12:876:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:876:12:876:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:876:12:876:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:878:5:878:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:878:5:878:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:878:5:878:20 | SelfParam | &T | main.rs:878:5:879:14 | S2 | +| main.rs:878:5:878:20 | f | | file://:0:0:0:0 | & | +| main.rs:878:5:878:20 | f | | file://:0:0:0:0 | & | +| main.rs:878:5:878:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:878:5:878:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:878:5:878:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:878:5:878:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:878:5:878:20 | self | | file://:0:0:0:0 | & | +| main.rs:878:5:878:20 | self | &T | main.rs:878:5:879:14 | S2 | +| main.rs:879:12:879:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:879:12:879:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:879:12:879:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:879:12:879:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:885:22:885:22 | x | | file://:0:0:0:0 | & | | main.rs:885:22:885:22 | x | &T | main.rs:885:11:885:19 | T | | main.rs:885:35:887:5 | { ... } | | file://:0:0:0:0 | & | @@ -1041,6 +1689,56 @@ inferType | main.rs:916:13:916:13 | y | | main.rs:878:5:879:14 | S2 | | main.rs:916:21:916:27 | into(...) | | main.rs:878:5:879:14 | S2 | | main.rs:916:26:916:26 | x | | main.rs:875:5:876:14 | S1 | +| main.rs:921:5:921:20 | "PairBoth" | | {EXTERNAL LOCATION} | str | +| main.rs:921:5:921:20 | "PairFst" | | {EXTERNAL LOCATION} | str | +| main.rs:921:5:921:20 | "PairNone" | | {EXTERNAL LOCATION} | str | +| main.rs:921:5:921:20 | "PairSnd" | | {EXTERNAL LOCATION} | str | +| main.rs:921:5:921:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | &f1 | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:921:5:921:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:921:5:921:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:921:5:921:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:921:5:921:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:921:5:921:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:921:5:921:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:921:5:921:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:921:5:921:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | SelfParam | &T | main.rs:921:5:927:5 | PairOption | +| main.rs:921:5:921:20 | SelfParam | &T.Fst | main.rs:922:21:922:23 | Fst | +| main.rs:921:5:921:20 | SelfParam | &T.Snd | main.rs:922:26:922:28 | Snd | +| main.rs:921:5:921:20 | f | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | f | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | f | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | f | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | f | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:921:5:921:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:921:5:921:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:921:5:921:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:921:5:921:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:921:5:921:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:921:5:921:20 | self | | file://:0:0:0:0 | & | +| main.rs:921:5:921:20 | self | &T | main.rs:921:5:927:5 | PairOption | +| main.rs:921:5:921:20 | self | &T.Fst | main.rs:922:21:922:23 | Fst | +| main.rs:921:5:921:20 | self | &T.Snd | main.rs:922:26:922:28 | Snd | +| main.rs:922:10:926:16 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:922:10:926:16 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:922:10:926:16 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:922:10:926:16 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:930:22:930:25 | SelfParam | | main.rs:921:5:927:5 | PairOption | | main.rs:930:22:930:25 | SelfParam | Fst | main.rs:929:10:929:12 | Fst | | main.rs:930:22:930:25 | SelfParam | Snd | main.rs:929:15:929:17 | Snd | @@ -1061,6 +1759,51 @@ inferType | main.rs:934:45:934:47 | snd | | main.rs:929:15:929:17 | Snd | | main.rs:935:41:935:43 | snd | | main.rs:929:15:929:17 | Snd | | main.rs:935:49:935:51 | snd | | main.rs:929:15:929:17 | Snd | +| main.rs:940:5:940:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:940:5:940:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:940:5:940:20 | SelfParam | &T | main.rs:940:5:941:14 | S1 | +| main.rs:940:5:940:20 | f | | file://:0:0:0:0 | & | +| main.rs:940:5:940:20 | f | | file://:0:0:0:0 | & | +| main.rs:940:5:940:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:940:5:940:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:940:5:940:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:940:5:940:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:940:5:940:20 | self | | file://:0:0:0:0 | & | +| main.rs:940:5:940:20 | self | &T | main.rs:940:5:941:14 | S1 | +| main.rs:941:12:941:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:941:12:941:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:941:12:941:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:941:12:941:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:943:5:943:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:943:5:943:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:943:5:943:20 | SelfParam | &T | main.rs:943:5:944:14 | S2 | +| main.rs:943:5:943:20 | f | | file://:0:0:0:0 | & | +| main.rs:943:5:943:20 | f | | file://:0:0:0:0 | & | +| main.rs:943:5:943:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:943:5:943:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:943:5:943:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:943:5:943:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:943:5:943:20 | self | | file://:0:0:0:0 | & | +| main.rs:943:5:943:20 | self | &T | main.rs:943:5:944:14 | S2 | +| main.rs:944:12:944:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:944:12:944:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:944:12:944:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:944:12:944:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:946:5:946:20 | "S3" | | {EXTERNAL LOCATION} | str | +| main.rs:946:5:946:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:946:5:946:20 | SelfParam | &T | main.rs:946:5:947:14 | S3 | +| main.rs:946:5:946:20 | f | | file://:0:0:0:0 | & | +| main.rs:946:5:946:20 | f | | file://:0:0:0:0 | & | +| main.rs:946:5:946:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:946:5:946:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:946:5:946:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:946:5:946:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:946:5:946:20 | self | | file://:0:0:0:0 | & | +| main.rs:946:5:946:20 | self | &T | main.rs:946:5:947:14 | S3 | +| main.rs:947:12:947:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:947:12:947:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:947:12:947:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:947:12:947:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:961:10:961:10 | t | | main.rs:921:5:927:5 | PairOption | | main.rs:961:10:961:10 | t | Fst | main.rs:943:5:944:14 | S2 | | main.rs:961:10:961:10 | t | Snd | main.rs:921:5:927:5 | PairOption | @@ -1130,6 +1873,33 @@ inferType | main.rs:983:31:983:53 | ...::PairSnd(...) | Fst | main.rs:943:5:944:14 | S2 | | main.rs:983:31:983:53 | ...::PairSnd(...) | Snd | main.rs:946:5:947:14 | S3 | | main.rs:983:51:983:52 | S3 | | main.rs:946:5:947:14 | S3 | +| main.rs:988:5:988:20 | "MyNone" | | {EXTERNAL LOCATION} | str | +| main.rs:988:5:988:20 | "MySome" | | {EXTERNAL LOCATION} | str | +| main.rs:988:5:988:20 | &f0 | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:988:5:988:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:988:5:988:20 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:988:5:988:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:988:5:988:20 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:988:5:988:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | SelfParam | &T | main.rs:988:5:992:5 | MyOption | +| main.rs:988:5:988:20 | SelfParam | &T.T | main.rs:989:19:989:19 | T | +| main.rs:988:5:988:20 | f | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | f | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | f | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:988:5:988:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:988:5:988:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:988:5:988:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:988:5:988:20 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:988:5:988:20 | self | | file://:0:0:0:0 | & | +| main.rs:988:5:988:20 | self | &T | main.rs:988:5:992:5 | MyOption | +| main.rs:988:5:988:20 | self | &T.T | main.rs:989:19:989:19 | T | +| main.rs:989:10:991:14 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:989:10:991:14 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:989:10:991:14 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:989:10:991:14 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:996:16:996:24 | SelfParam | | file://:0:0:0:0 | & | | main.rs:996:16:996:24 | SelfParam | &T | main.rs:994:5:1001:5 | Self [trait MyTrait] | | main.rs:996:27:996:31 | value | | main.rs:994:19:994:19 | S | @@ -1163,6 +1933,21 @@ inferType | main.rs:1018:34:1018:34 | x | T | main.rs:1014:10:1014:10 | T | | main.rs:1018:40:1018:40 | x | | main.rs:988:5:992:5 | MyOption | | main.rs:1018:40:1018:40 | x | T | main.rs:1014:10:1014:10 | T | +| main.rs:1023:5:1023:20 | "S" | | {EXTERNAL LOCATION} | str | +| main.rs:1023:5:1023:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1023:5:1023:20 | SelfParam | &T | main.rs:1023:5:1024:13 | S | +| main.rs:1023:5:1023:20 | f | | file://:0:0:0:0 | & | +| main.rs:1023:5:1023:20 | f | | file://:0:0:0:0 | & | +| main.rs:1023:5:1023:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1023:5:1023:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1023:5:1023:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1023:5:1023:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:1023:5:1023:20 | self | | file://:0:0:0:0 | & | +| main.rs:1023:5:1023:20 | self | &T | main.rs:1023:5:1024:13 | S | +| main.rs:1024:12:1024:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1024:12:1024:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1024:12:1024:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1024:12:1024:12 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:1027:13:1027:14 | x1 | | main.rs:988:5:992:5 | MyOption | | main.rs:1027:18:1027:37 | ...::new(...) | | main.rs:988:5:992:5 | MyOption | | main.rs:1028:18:1028:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str | @@ -1275,6 +2060,62 @@ inferType | main.rs:1070:18:1070:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str | | main.rs:1070:26:1070:34 | from_loop | | main.rs:988:5:992:5 | MyOption | | main.rs:1070:26:1070:34 | from_loop | T | main.rs:1023:5:1024:13 | S | +| main.rs:1076:5:1076:33 | "S" | | {EXTERNAL LOCATION} | str | +| main.rs:1076:5:1076:33 | &f0 | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:1076:5:1076:33 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:1076:5:1076:33 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:1076:5:1076:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | SelfParam | &T | main.rs:1076:5:1077:19 | S | +| main.rs:1076:5:1076:33 | SelfParam | &T | main.rs:1076:5:1077:19 | S | +| main.rs:1076:5:1076:33 | SelfParam | &T.T | main.rs:1077:14:1077:14 | T | +| main.rs:1076:5:1076:33 | SelfParam | &T.T | main.rs:1077:14:1077:14 | T | +| main.rs:1076:5:1076:33 | f | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | f | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1076:5:1076:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1076:5:1076:33 | f0.clone() | | main.rs:1077:14:1077:14 | T | +| main.rs:1076:5:1076:33 | f.debug_tuple(...) | | {EXTERNAL LOCATION} | DebugTuple | +| main.rs:1076:5:1076:33 | self | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | self | | file://:0:0:0:0 | & | +| main.rs:1076:5:1076:33 | self | &T | main.rs:1076:5:1077:19 | S | +| main.rs:1076:5:1076:33 | self | &T | main.rs:1076:5:1077:19 | S | +| main.rs:1076:5:1076:33 | self | &T.T | main.rs:1077:14:1077:14 | T | +| main.rs:1076:5:1076:33 | self | &T.T | main.rs:1077:14:1077:14 | T | +| main.rs:1077:12:1077:12 | S(...) | | main.rs:1076:5:1077:19 | S | +| main.rs:1077:12:1077:12 | S(...) | T | main.rs:1077:14:1077:14 | T | +| main.rs:1077:12:1077:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1077:12:1077:12 | match self { ... } | | main.rs:1076:5:1077:19 | S | +| main.rs:1077:12:1077:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1077:12:1077:12 | match self { ... } | T | main.rs:1077:14:1077:14 | T | +| main.rs:1077:12:1077:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1077:12:1077:12 | { ... } | | main.rs:1076:5:1077:19 | S | +| main.rs:1077:12:1077:12 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1077:12:1077:12 | { ... } | T | main.rs:1077:14:1077:14 | T | +| main.rs:1079:5:1079:33 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:1079:5:1079:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | SelfParam | &T | main.rs:1079:5:1080:14 | S2 | +| main.rs:1079:5:1079:33 | SelfParam | &T | main.rs:1079:5:1080:14 | S2 | +| main.rs:1079:5:1079:33 | f | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | f | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1079:5:1079:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1079:5:1079:33 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1079:5:1079:33 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:1079:5:1079:33 | self | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | self | | file://:0:0:0:0 | & | +| main.rs:1079:5:1079:33 | self | &T | main.rs:1079:5:1080:14 | S2 | +| main.rs:1079:5:1079:33 | self | &T | main.rs:1079:5:1080:14 | S2 | +| main.rs:1080:12:1080:13 | S2 | | main.rs:1079:5:1080:14 | S2 | +| main.rs:1080:12:1080:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1080:12:1080:13 | match self { ... } | | main.rs:1079:5:1080:14 | S2 | +| main.rs:1080:12:1080:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1080:12:1080:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1080:12:1080:13 | { ... } | | main.rs:1079:5:1080:14 | S2 | +| main.rs:1080:12:1080:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:1083:15:1083:18 | SelfParam | | main.rs:1076:5:1077:19 | S | | main.rs:1083:15:1083:18 | SelfParam | T | main.rs:1082:10:1082:10 | T | | main.rs:1083:26:1085:9 | { ... } | | main.rs:1082:10:1082:10 | T | @@ -1492,6 +2333,37 @@ inferType | main.rs:1177:9:1177:15 | x.foo() | | file://:0:0:0:0 | & | | main.rs:1177:9:1177:15 | x.foo() | &T | main.rs:1167:5:1167:26 | MyStruct | | main.rs:1177:9:1177:15 | x.foo() | &T.T | main.rs:1165:5:1165:13 | S | +| main.rs:1182:5:1182:42 | "MyFlag" | | {EXTERNAL LOCATION} | str | +| main.rs:1182:5:1182:42 | "bool" | | {EXTERNAL LOCATION} | str | +| main.rs:1182:5:1182:42 | ...::default(...) | | {EXTERNAL LOCATION} | bool | +| main.rs:1182:5:1182:42 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | SelfParam | &T | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1182:5:1182:42 | SelfParam | &T | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1182:5:1182:42 | f | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | f | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1182:5:1182:42 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1182:5:1182:42 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1182:5:1182:42 | self | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | self | | file://:0:0:0:0 | & | +| main.rs:1182:5:1182:42 | self | &T | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1182:5:1182:42 | self | &T | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | MyFlag {...} | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | MyFlag {...} | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1183:12:1184:12 | match self { ... } | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1183:12:1184:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1183:12:1184:12 | { ... } | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | { ... } | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1183:12:1184:12 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1184:9:1184:12 | &bool | | file://:0:0:0:0 | & | +| main.rs:1184:9:1184:12 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:1184:9:1184:12 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1184:9:1184:12 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:1184:9:1184:12 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:1184:9:1184:12 | bool.clone() | | {EXTERNAL LOCATION} | bool | | main.rs:1188:17:1188:25 | SelfParam | | file://:0:0:0:0 | & | | main.rs:1188:17:1188:25 | SelfParam | &T | main.rs:1182:5:1185:5 | MyFlag | | main.rs:1189:13:1189:16 | self | | file://:0:0:0:0 | & | @@ -1616,6 +2488,36 @@ inferType | main.rs:1224:27:1224:30 | flag | | main.rs:1182:5:1185:5 | MyFlag | | main.rs:1225:18:1225:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str | | main.rs:1225:26:1225:29 | flag | | main.rs:1182:5:1185:5 | MyFlag | +| main.rs:1232:5:1232:20 | "S1" | | {EXTERNAL LOCATION} | str | +| main.rs:1232:5:1232:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1232:5:1232:20 | SelfParam | &T | main.rs:1232:5:1233:14 | S1 | +| main.rs:1232:5:1232:20 | f | | file://:0:0:0:0 | & | +| main.rs:1232:5:1232:20 | f | | file://:0:0:0:0 | & | +| main.rs:1232:5:1232:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1232:5:1232:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1232:5:1232:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1232:5:1232:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:1232:5:1232:20 | self | | file://:0:0:0:0 | & | +| main.rs:1232:5:1232:20 | self | &T | main.rs:1232:5:1233:14 | S1 | +| main.rs:1233:12:1233:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1233:12:1233:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1233:12:1233:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1233:12:1233:13 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1235:5:1235:20 | "S2" | | {EXTERNAL LOCATION} | str | +| main.rs:1235:5:1235:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1235:5:1235:20 | SelfParam | &T | main.rs:1235:5:1236:14 | S2 | +| main.rs:1235:5:1235:20 | f | | file://:0:0:0:0 | & | +| main.rs:1235:5:1235:20 | f | | file://:0:0:0:0 | & | +| main.rs:1235:5:1235:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1235:5:1235:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1235:5:1235:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1235:5:1235:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:1235:5:1235:20 | self | | file://:0:0:0:0 | & | +| main.rs:1235:5:1235:20 | self | &T | main.rs:1235:5:1236:14 | S2 | +| main.rs:1236:12:1236:13 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1236:12:1236:13 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1236:12:1236:13 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1236:12:1236:13 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:1239:43:1242:5 | { ... } | | {EXTERNAL LOCATION} | Result | | main.rs:1239:43:1242:5 | { ... } | E | main.rs:1232:5:1233:14 | S1 | | main.rs:1239:43:1242:5 | { ... } | T | main.rs:1232:5:1233:14 | S1 | @@ -1754,6 +2656,39 @@ inferType | main.rs:1313:13:1313:17 | ... = ... | | file://:0:0:0:0 | () | | main.rs:1313:17:1313:17 | 2 | | {EXTERNAL LOCATION} | i32 | | main.rs:1315:9:1315:9 | a | | {EXTERNAL LOCATION} | i32 | +| main.rs:1323:5:1323:33 | "Vec2" | | {EXTERNAL LOCATION} | str | +| main.rs:1323:5:1323:33 | "x" | | {EXTERNAL LOCATION} | str | +| main.rs:1323:5:1323:33 | "y" | | {EXTERNAL LOCATION} | str | +| main.rs:1323:5:1323:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | SelfParam | &T | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1323:5:1323:33 | SelfParam | &T | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1323:5:1323:33 | f | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | f | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1323:5:1323:33 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1323:5:1323:33 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1323:5:1323:33 | self | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | self | | file://:0:0:0:0 | & | +| main.rs:1323:5:1323:33 | self | &T | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1323:5:1323:33 | self | &T | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1324:12:1326:9 | Vec2 {...} | | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1324:12:1326:9 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1324:12:1326:9 | match self { ... } | | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1324:12:1326:9 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1324:12:1326:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1324:12:1326:9 | { ... } | | main.rs:1322:5:1327:5 | Vec2 | +| main.rs:1324:12:1326:9 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1325:9:1325:9 | &x | | file://:0:0:0:0 | & | +| main.rs:1325:9:1325:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:1325:9:1325:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1325:9:1325:9 | x.clone() | | {EXTERNAL LOCATION} | i64 | +| main.rs:1325:9:1326:9 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:1325:9:1326:9 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1325:9:1326:9 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:1325:9:1326:9 | ... .finish() | E | {EXTERNAL LOCATION} | Error | +| main.rs:1326:9:1326:9 | &y | | file://:0:0:0:0 | & | +| main.rs:1326:9:1326:9 | y.clone() | | {EXTERNAL LOCATION} | i64 | | main.rs:1329:30:1331:9 | { ... } | | main.rs:1322:5:1327:5 | Vec2 | | main.rs:1330:13:1330:31 | Vec2 {...} | | main.rs:1322:5:1327:5 | Vec2 | | main.rs:1330:23:1330:23 | 0 | | {EXTERNAL LOCATION} | i32 | @@ -2562,10 +3497,47 @@ inferType | main.rs:1784:13:1784:13 | d | | main.rs:1732:5:1732:14 | S2 | | main.rs:1784:17:1784:34 | uses_my_trait2(...) | | main.rs:1732:5:1732:14 | S2 | | main.rs:1784:32:1784:33 | S1 | | main.rs:1731:5:1731:14 | S1 | +| main.rs:1791:5:1791:20 | "S" | | {EXTERNAL LOCATION} | str | +| main.rs:1791:5:1791:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1791:5:1791:20 | SelfParam | &T | main.rs:1791:5:1792:13 | S | +| main.rs:1791:5:1791:20 | f | | file://:0:0:0:0 | & | +| main.rs:1791:5:1791:20 | f | | file://:0:0:0:0 | & | +| main.rs:1791:5:1791:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1791:5:1791:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1791:5:1791:20 | f.write_str(...) | | {EXTERNAL LOCATION} | Result | +| main.rs:1791:5:1791:20 | f.write_str(...) | E | {EXTERNAL LOCATION} | Error | +| main.rs:1791:5:1791:20 | self | | file://:0:0:0:0 | & | +| main.rs:1791:5:1791:20 | self | &T | main.rs:1791:5:1792:13 | S | +| main.rs:1792:12:1792:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1792:12:1792:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1792:12:1792:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1792:12:1792:12 | { ... } | E | {EXTERNAL LOCATION} | Error | | main.rs:1795:16:1795:20 | SelfParam | | file://:0:0:0:0 | & | | main.rs:1795:16:1795:20 | SelfParam | &T | main.rs:1791:5:1792:13 | S | | main.rs:1795:31:1797:9 | { ... } | | main.rs:1791:5:1792:13 | S | | main.rs:1796:13:1796:13 | S | | main.rs:1791:5:1792:13 | S | +| main.rs:1800:5:1800:20 | "MyVec" | | {EXTERNAL LOCATION} | str | +| main.rs:1800:5:1800:20 | "data" | | {EXTERNAL LOCATION} | str | +| main.rs:1800:5:1800:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:1800:5:1800:20 | SelfParam | &T | main.rs:1800:5:1803:5 | MyVec | +| main.rs:1800:5:1800:20 | SelfParam | &T.T | main.rs:1801:18:1801:18 | T | +| main.rs:1800:5:1800:20 | f | | file://:0:0:0:0 | & | +| main.rs:1800:5:1800:20 | f | | file://:0:0:0:0 | & | +| main.rs:1800:5:1800:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1800:5:1800:20 | f | &T | {EXTERNAL LOCATION} | Formatter | +| main.rs:1800:5:1800:20 | f.debug_struct(...) | | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1800:5:1800:20 | self | | file://:0:0:0:0 | & | +| main.rs:1800:5:1800:20 | self | &T | main.rs:1800:5:1803:5 | MyVec | +| main.rs:1800:5:1800:20 | self | &T.T | main.rs:1801:18:1801:18 | T | +| main.rs:1801:12:1802:12 | match self { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1801:12:1802:12 | match self { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1801:12:1802:12 | { ... } | | {EXTERNAL LOCATION} | Result | +| main.rs:1801:12:1802:12 | { ... } | E | {EXTERNAL LOCATION} | Error | +| main.rs:1802:9:1802:12 | &data | | file://:0:0:0:0 | & | +| main.rs:1802:9:1802:12 | ... .field(...) | | file://:0:0:0:0 | & | +| main.rs:1802:9:1802:12 | ... .field(...) | &T | {EXTERNAL LOCATION} | DebugStruct | +| main.rs:1802:9:1802:12 | ... .finish() | | {EXTERNAL LOCATION} | Result | +| main.rs:1802:9:1802:12 | ... .finish() | E | {EXTERNAL LOCATION} | Error | | main.rs:1806:26:1808:9 | { ... } | | main.rs:1800:5:1803:5 | MyVec | | main.rs:1806:26:1808:9 | { ... } | T | main.rs:1805:10:1805:10 | T | | main.rs:1807:13:1807:38 | MyVec {...} | | main.rs:1800:5:1803:5 | MyVec | @@ -2711,3 +3683,90 @@ inferType | main.rs:1887:41:1887:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo | | main.rs:1903:5:1903:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future | testFailures +| main.rs:2:5:2:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:5:5:5:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:7:9:7:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:7:9:7:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:10:5:10:20 | ... .field(...) | Unexpected result: method=field | +| main.rs:10:5:10:20 | ... .finish() | Unexpected result: method=finish | +| main.rs:10:5:10:20 | f.debug_tuple(...) | Unexpected result: method=debug_tuple | +| main.rs:16:5:16:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:18:9:18:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:18:9:18:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:99:5:99:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:101:9:101:13 | ... .field(...) | Unexpected result: method=field | +| main.rs:101:9:101:13 | ... .finish() | Unexpected result: method=finish | +| main.rs:125:5:125:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:127:9:127:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:127:9:127:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:130:5:130:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:132:5:132:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:175:5:175:33 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:177:9:177:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:177:9:177:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:180:5:180:33 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:182:9:182:10 | ... .field(...) | Unexpected result: method=field | +| main.rs:182:9:183:10 | ... .field(...) | Unexpected result: method=field | +| main.rs:182:9:183:10 | ... .finish() | Unexpected result: method=finish | +| main.rs:186:5:186:33 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:188:5:188:33 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:190:5:190:42 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:397:5:397:33 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:440:5:440:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:443:5:443:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:516:5:516:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:518:9:518:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:518:9:518:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:521:5:521:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:523:5:523:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:587:5:587:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:589:9:589:13 | ... .field(...) | Unexpected result: method=field | +| main.rs:589:9:589:13 | ... .finish() | Unexpected result: method=finish | +| main.rs:638:5:638:29 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:641:5:641:29 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:644:5:644:29 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:736:5:736:20 | ... .field(...) | Unexpected result: method=field | +| main.rs:736:5:736:20 | ... .finish() | Unexpected result: method=finish | +| main.rs:736:5:736:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:736:5:736:20 | f.debug_tuple(...) | Unexpected result: method=debug_tuple | +| main.rs:739:14:739:14 | ... .field(...) | Unexpected result: method=field | +| main.rs:739:14:739:14 | ... .finish() | Unexpected result: method=finish | +| main.rs:742:5:742:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:744:5:744:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:766:5:766:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:768:9:768:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:768:9:768:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:771:5:771:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:773:9:773:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:773:9:773:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:776:5:776:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:778:5:778:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:875:5:875:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:878:5:878:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:921:5:921:20 | ... .field(...) | Unexpected result: method=field | +| main.rs:921:5:921:20 | ... .finish() | Unexpected result: method=finish | +| main.rs:921:5:921:20 | f.debug_tuple(...) | Unexpected result: method=debug_tuple | +| main.rs:940:5:940:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:943:5:943:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:946:5:946:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:988:5:988:20 | ... .field(...) | Unexpected result: method=field | +| main.rs:988:5:988:20 | ... .finish() | Unexpected result: method=finish | +| main.rs:988:5:988:20 | f.debug_tuple(...) | Unexpected result: method=debug_tuple | +| main.rs:1023:5:1023:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:1076:5:1076:33 | ... .field(...) | Unexpected result: method=field | +| main.rs:1076:5:1076:33 | ... .finish() | Unexpected result: method=finish | +| main.rs:1076:5:1076:33 | f.debug_tuple(...) | Unexpected result: method=debug_tuple | +| main.rs:1079:5:1079:33 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:1182:5:1182:42 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:1184:9:1184:12 | ... .field(...) | Unexpected result: method=field | +| main.rs:1184:9:1184:12 | ... .finish() | Unexpected result: method=finish | +| main.rs:1232:5:1232:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:1235:5:1235:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:1323:5:1323:33 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:1325:9:1325:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:1325:9:1326:9 | ... .field(...) | Unexpected result: method=field | +| main.rs:1325:9:1326:9 | ... .finish() | Unexpected result: method=finish | +| main.rs:1791:5:1791:20 | f.write_str(...) | Unexpected result: method=write_str | +| main.rs:1800:5:1800:20 | f.debug_struct(...) | Unexpected result: method=debug_struct | +| main.rs:1802:9:1802:12 | ... .field(...) | Unexpected result: method=field | +| main.rs:1802:9:1802:12 | ... .finish() | Unexpected result: method=finish | diff --git a/rust/ql/test/library-tests/variables/main.rs b/rust/ql/test/library-tests/variables/main.rs index 89f9fffa8862..493bf8df5409 100644 --- a/rust/ql/test/library-tests/variables/main.rs +++ b/rust/ql/test/library-tests/variables/main.rs @@ -503,7 +503,7 @@ fn phi_read(b1 : bool, b2 : bool) { } } -#[derive(Debug)] + struct MyStruct { val: i64, } diff --git a/rust/ql/test/query-tests/security/CWE-770/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-770/CONSISTENCY/PathResolutionConsistency.expected index 767f33660084..e3bd532388b3 100644 --- a/rust/ql/test/query-tests/security/CWE-770/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/query-tests/security/CWE-770/CONSISTENCY/PathResolutionConsistency.expected @@ -1,30 +1,30 @@ multiplePathResolutions -| main.rs:218:14:218:17 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:218:14:218:17 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:218:14:218:17 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:218:14:218:25 | ...::malloc | file://:0:0:0:0 | fn malloc | | main.rs:218:14:218:25 | ...::malloc | file://:0:0:0:0 | fn malloc | -| main.rs:219:13:219:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:219:13:219:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:219:13:219:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:219:13:219:24 | ...::malloc | file://:0:0:0:0 | fn malloc | | main.rs:219:13:219:24 | ...::malloc | file://:0:0:0:0 | fn malloc | -| main.rs:220:13:220:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:220:13:220:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:220:13:220:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:220:13:220:31 | ...::aligned_alloc | file://:0:0:0:0 | fn aligned_alloc | | main.rs:220:13:220:31 | ...::aligned_alloc | file://:0:0:0:0 | fn aligned_alloc | -| main.rs:221:13:221:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:221:13:221:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:221:13:221:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:221:13:221:31 | ...::aligned_alloc | file://:0:0:0:0 | fn aligned_alloc | | main.rs:221:13:221:31 | ...::aligned_alloc | file://:0:0:0:0 | fn aligned_alloc | -| main.rs:222:13:222:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:222:13:222:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:222:13:222:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:222:13:222:24 | ...::calloc | file://:0:0:0:0 | fn calloc | | main.rs:222:13:222:24 | ...::calloc | file://:0:0:0:0 | fn calloc | -| main.rs:223:13:223:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:223:13:223:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:223:13:223:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:223:13:223:24 | ...::calloc | file://:0:0:0:0 | fn calloc | | main.rs:223:13:223:24 | ...::calloc | file://:0:0:0:0 | fn calloc | -| main.rs:224:13:224:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.172) | | main.rs:224:13:224:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.173) | +| main.rs:224:13:224:16 | libc | file://:0:0:0:0 | Crate(libc@0.2.174) | | main.rs:224:13:224:25 | ...::realloc | file://:0:0:0:0 | fn realloc | | main.rs:224:13:224:25 | ...::realloc | file://:0:0:0:0 | fn realloc | | main.rs:229:13:229:37 | ...::with_capacity | file://:0:0:0:0 | fn with_capacity | From 52c0028f850484530c483461efadb497ff48d8e4 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 14:35:08 +0200 Subject: [PATCH 3/7] Rust: make `Adt` be generated --- rust/ast-generator/src/main.rs | 6 ++-- rust/ql/.generated.list | 18 +++++------ rust/ql/lib/codeql/rust/elements/Enum.qll | 1 + rust/ql/lib/codeql/rust/elements/Struct.qll | 1 + rust/ql/lib/codeql/rust/elements/Union.qll | 1 + .../rust/elements/internal/generated/Enum.qll | 3 +- .../internal/generated/ParentChild.qll | 31 ++++++++++++------- .../rust/elements/internal/generated/Raw.qll | 6 ++-- .../elements/internal/generated/Struct.qll | 3 +- .../elements/internal/generated/Synth.qll | 18 +++++++++-- .../elements/internal/generated/Union.qll | 3 +- rust/ql/lib/rust.dbscheme | 3 ++ rust/schema/annotations.py | 9 +++--- rust/schema/ast.py | 9 ++++-- 14 files changed, 72 insertions(+), 40 deletions(-) diff --git a/rust/ast-generator/src/main.rs b/rust/ast-generator/src/main.rs index 70741c83382c..35437777c21e 100644 --- a/rust/ast-generator/src/main.rs +++ b/rust/ast-generator/src/main.rs @@ -385,8 +385,8 @@ struct ExtractorInfo { } fn enum_to_extractor_info(node: &AstEnumSrc) -> Option { - if node.name == "VariantDef" { - // currently defined but unused + if matches!(node.name.as_str(), "VariantDef" | "Adt") { + // these are not used as types of fields, so we don't need to generate extractors for them return None; } Some(ExtractorEnumInfo { @@ -485,8 +485,6 @@ fn main() -> anyhow::Result<()> { .expect("Failed to parse grammar"); let mut grammar = codegen::grammar::lower(&grammar); - grammar.enums.retain(|x| x.name != "Adt"); - let mut super_types: BTreeMap> = BTreeMap::new(); for node in &grammar.enums { for variant in &node.variants { diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 4aa4e6d7da09..a08afe1fdad8 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -47,7 +47,7 @@ lib/codeql/rust/elements/ContinueExpr.qll 9f27c5d5c819ad0ebc5bd10967ba8d33a9dc95 lib/codeql/rust/elements/Crate.qll 1426960e6f36195e42ea5ea321405c1a72fccd40cd6c0a33673c321c20302d8d 1571a89f89dab43c5291b71386de7aadf52730755ba10f9d696db9ad2f760aff lib/codeql/rust/elements/DynTraitTypeRepr.qll e4d27112d27ae93c621defd2c976fd4e90663ab7f6115e83ae4fe8106cb5e015 eb9fde89698588f3b7116f62388c54e937f99559b22c93d11a5596e754560072 lib/codeql/rust/elements/Element.qll 0b62d139fef54ed2cf2e2334806aa9bfbc036c9c2085d558f15a42cc3fa84c48 24b999b93df79383ef27ede46e38da752868c88a07fe35fcff5d526684ba7294 -lib/codeql/rust/elements/Enum.qll 55d5a4a775f07d9c1d5183af76f9d8de1d700bfe1dea427cc7ff3083f39e13de f00a585596f1d0ab34e6f2b7cdaba6d4a89005820478f810e8685478cf88100e +lib/codeql/rust/elements/Enum.qll 3630f73c1ea158c6977a9d2b2543eb8ebeeb9fef1a7575fdd4b05c98e5938d69 f5f4c93af0741685aa422498fb547e0ee647b632ad5821fb7278d9f2f70e4342 lib/codeql/rust/elements/Expr.qll e5d65e805ccf440d64d331e55df4c4144ab8c8f63f367382494714087659ffe8 2bbc1e5d3a65f413ec33d9822fa451fbdbe32349158db58cc0bfcfafb0e21bda lib/codeql/rust/elements/ExprStmt.qll 00ac4c7d0192b9e8b0f28d5ae59c27729ff5a831ca11938ea3e677a262337a64 7cc02aa5346cd7c50d75ca63cd6501097b0a3979eb2ed838adff114fe17d35a3 lib/codeql/rust/elements/ExternBlock.qll 96c70d0761ec385fe17aa7228e15fd1711949d5abba5877a1c2f4c180d202125 38ad458868a368d437b2dda44307d788a85c887f45ea76c99adbfc9a53f14d81 @@ -146,7 +146,7 @@ lib/codeql/rust/elements/SourceFile.qll 0b6a3e58767c07602b19975009a2ad53ecf1fd72 lib/codeql/rust/elements/Static.qll a6d73152ddecb53a127aa3a4139f97007cd77b46203691c287600aa7200b8beb 547197e794803b3ea0c0e220f050980adec815a16fdef600f98ff795aa77f677 lib/codeql/rust/elements/Stmt.qll 532b12973037301246daf7d8c0177f734202f43d9261c7a4ca6f5080eea8ca64 b838643c4f2b4623d2c816cddad0e68ca3e11f2879ab7beaece46f489ec4b1f3 lib/codeql/rust/elements/StmtList.qll e874859ce03672d0085e47e0ca5e571b92b539b31bf0d5a8802f9727bef0c6b0 e5fe83237f713cdb57c446a6e1c20f645c2f49d9f5ef2c984032df83acb3c0de -lib/codeql/rust/elements/Struct.qll 6ae1ce11044a1f6bf3150ddce947c1be17e462613edf7ea4fe7d861aa3dbe0d1 043ef682d71f31e8808962032c05ab3045e7cbc8663ec7e06dc9255e12e53c12 +lib/codeql/rust/elements/Struct.qll 6ed5475dc66c192290bd11ec4c80ec3093b837456146329b447422c7789574e7 b471e12936bc8095eab45c5473d279b6681fce4cb80afa01d73293061e39b66e lib/codeql/rust/elements/StructExpr.qll af9059c01a97755e94f1a8b60c66d9c7663ed0705b2845b086b8953f16019fab 2d33d86b035a15c1b31c3e07e0e74c4bbe57a71c5a55d60e720827814e73b7ba lib/codeql/rust/elements/StructExprField.qll 3eb9f17ecd1ad38679689eb4ecc169d3a0b5b7a3fc597ae5a957a7aea2f74e4f 8fcd26f266f203004899a60447ba16e7eae4e3a654fbec7f54e26857730ede93 lib/codeql/rust/elements/StructExprFieldList.qll 6efb2ec4889b38556dc679bb89bbd4bd76ed6a60014c41f8e232288fc23b2d52 dc867a0a4710621e04b36bbec7d317d6f360e0d6ac68b79168c8b714babde31d @@ -175,7 +175,7 @@ lib/codeql/rust/elements/TypeRepr.qll ea41b05ef0aaac71da460f9a6a8331cf98166f2c38 lib/codeql/rust/elements/UnderscoreExpr.qll 233661b82b87c8cda16d8f2e17965658c3dc6b69efb23cb8eb9c4f50c68521e0 8edff8e80aac2ecf83a6b58f310cab688cbaeea0a0e68a298b644e565960cc74 lib/codeql/rust/elements/Unextracted.qll 12e60c79ef5b94d72b579b19970622e7b73822ebc13fbcfedfe953527ab1ac36 ec015db2eb12c3c82693ddc71d32d9ab9ef7a958e741e2510681bb707ceca23e lib/codeql/rust/elements/Unimplemented.qll bf624d28163e5c99accda16c0c99f938bec4a3b1b920a463e86fc8529ff5ff02 013bc7777298d250338f835cd494b5a8accea2d6a4f9561851f283ac129a446b -lib/codeql/rust/elements/Union.qll 3e277155fc7ea77f645cb5c5b227efd1474aa745b12a8be228eab694536c49dc a4bf9b54b8262517371000a842e5fdcdaabd324e52afd7919bbf76bc887b18b6 +lib/codeql/rust/elements/Union.qll da30dcfc2bb60a2d2b63dbcb71aca50a380196a79633b85a06fb45d0cbd65c68 27fa235c5a4f7d17e0737addcc436853f1b9c7e96f283c37985c17929fac6788 lib/codeql/rust/elements/Use.qll fdcf70574403c2f219353211b6930f2f9bc79f41c2594e07548de5a8c6cbb24d e41f2b689fcbeb7b84c7ba8d09592f7561626559318642b73574bbac83f74546 lib/codeql/rust/elements/UseBoundGenericArg.qll f16903f8fff676d3700eaad5490804624391141472ecc3166ccb1f70c794c120 5efda98088d096b42f53ceccae78c05f15c6953525b514d849681cb2cf65b147 lib/codeql/rust/elements/UseBoundGenericArgs.qll d9821a82a1d57e609fdc5e79d65e9a88b0088f51d03927e09f41b6931d3484ab 181483a95e22622c7cee07cce87e9476053f824a82e67e2bdecabf5a39f672ad @@ -508,7 +508,7 @@ lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83 lib/codeql/rust/elements/internal/generated/Crate.qll 37f3760d7c0c1c3ca809d07daf7215a8eae6053eda05e88ed7db6e07f4db0781 649a3d7cd7ee99f95f8a4d3d3c41ea2fa848ce7d8415ccbac62977dfc9a49d35 lib/codeql/rust/elements/internal/generated/DynTraitTypeRepr.qll b2e0e728b6708923b862d9d8d6104d13f572da17e393ec1485b8465e4bfdc206 4a87ea9669c55c4905ce4e781b680f674989591b0cb56af1e9fa1058c13300b3 lib/codeql/rust/elements/internal/generated/Element.qll d56d22c060fa929464f837b1e16475a4a2a2e42d68235a014f7369bcb48431db 0e48426ca72179f675ac29aa49bbaadb8b1d27b08ad5cbc72ec5a005c291848e -lib/codeql/rust/elements/internal/generated/Enum.qll 477eaa102c1268f0fa7603ecd88f1b83db1388c17c25e3719d4113ea980256f7 2d60db61ba4a385218f0a01e366e04ba1e7dad386b7e6a027c31f32fb730cca2 +lib/codeql/rust/elements/internal/generated/Enum.qll a9d8a52ba8368889c29855d0c966ed74460c83d34e3410fffe08091a3c76b642 0c7a9a675ed3b5ec22074f47745816c7c009676871279906f39ad9669450c35c lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8 lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b lib/codeql/rust/elements/internal/generated/ExternBlock.qll e7faac92297a53ac6e0420eec36255a54f360eeb962bf663a00da709407832dd 5ff32c54ec7097d43cc3311492090b9b90f411eead3bc849f258858f29405e81 @@ -580,7 +580,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll eaa0cd4402d3665013d47e lib/codeql/rust/elements/internal/generated/ParenExpr.qll 812d2ff65079277f39f15c084657a955a960a7c1c0e96dd60472a58d56b945eb eb8c607f43e1fcbb41f37a10de203a1db806690e10ff4f04d48ed874189cb0eb lib/codeql/rust/elements/internal/generated/ParenPat.qll 24f9dc7fce75827d6fddb856cd48f80168143151b27295c0bab6db5a06567a09 ebadbc6f5498e9ed754b39893ce0763840409a0721036a25b56e1ead7dcc09aa lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 03f5c5b96a37adeb845352d7fcea3e098da9050e534972d14ac0f70d60a2d776 ed3d6e5d02086523087adebce4e89e35461eb95f2a66d1d4100fe23fc691b126 -lib/codeql/rust/elements/internal/generated/ParentChild.qll b58a01c0d2cca085a77ed7a98a0318cfc20450e48c64124f8a875ae45416ac25 92e9b6434629508868a5cf69c1236729409dcab4c4cda63af537d591a840127a +lib/codeql/rust/elements/internal/generated/ParentChild.qll 2bcec7e700042db6e58b85bb1346a03f0fa41252af7aa0c835be38217e9c6fda 348c4408b2ab91b6b498242b9e4675dd5015aeac9f5b2d52760f1c071c1d1924 lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll d901fdc8142a5b8847cc98fc2afcfd16428b8ace4fbffb457e761b5fd3901a77 5dbb0aea5a13f937da666ccb042494af8f11e776ade1459d16b70a4dd193f9fb lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -595,7 +595,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 8d0ea4f6c7f8203340bf lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll f9370ca510d47144f7a22255341dc0f45407fcc8c22d42a74dbc423a68a36635 2301eb8a7b4d59c05413e07f95fe9ac2d0f42d3673d9b7e809bd49a6c1bee506 +lib/codeql/rust/elements/internal/generated/Raw.qll bc03ef3af94aa43287e054f731c283eec1610e319201ab2a78249c2a7ee22413 30278f463569b5f7b5011f61b9cfe111449829cbb32b251e5c5e58cd438b5978 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 5b0663a6d234572fb3e467e276d019415caa95ef006438cc59b7af4e1783161e 0e27c8a8f0e323c0e4d6db01fca821bf07c0864d293cdf96fa891b10820c1e4b @@ -612,7 +612,7 @@ lib/codeql/rust/elements/internal/generated/SourceFile.qll 4bc95c88b49868d1da1a8 lib/codeql/rust/elements/internal/generated/Static.qll 34a4cdb9f4a93414499a30aeeaad1b3388f2341c982af5688815c3b0a0e9c57b 3c8354336eff68d580b804600df9abf49ee5ee10ec076722089087820cefe731 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll 816aebf8f56e179f5f0ba03e80d257ee85459ea757392356a0af6dbd0cd9ef5e 6aa51cdcdc8d93427555fa93f0e84afdfbbd4ffc8b8d378ae4a22b5b6f94f48b -lib/codeql/rust/elements/internal/generated/Struct.qll ce40dd64d61f6ca0a8425019dd8368ca3d79d3a238d7afb9b3f1c86c2c95c1b5 214946f9cdbf134a181d98b02bb630504ad524541febc4c0b8490a9a6fab8750 +lib/codeql/rust/elements/internal/generated/Struct.qll 869ef9510b92f0e80455fd9e9640c33304035937a7ee4457a03191e4ca8a9065 401932fd7984dec3946cb0d49752d1ec86f6f2f819de2f5cdc36f5ce3f035690 lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll 298d33442d1054922d2f97133a436ee559f1f35b7708523284d1f7eee7ebf443 7febe38a79fadf3dcb53fb8f8caf4c2780f5df55a1f8336269c7b674d53c6272 @@ -621,7 +621,7 @@ lib/codeql/rust/elements/internal/generated/StructFieldList.qll 5da528a51a6a5db9 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf lib/codeql/rust/elements/internal/generated/StructPatFieldList.qll 1a95a1bd9f64fb18e9571657cf2d02a8b13c747048a1f0f74baf31b91f0392ad fc274e414ff4ed54386046505920de92755ad0b4d39a7523cdffa4830bd53b37 -lib/codeql/rust/elements/internal/generated/Synth.qll ef45765a8e077bc0168ec226b3b84902acd8d774cd7af637e0b1b1b16ff1deaf 58dd7076517e5d680c6d8b0489530bd8e1d15d629a233f1742cca3f028d5ec81 +lib/codeql/rust/elements/internal/generated/Synth.qll 6835c645faf2eac3dfd2d29dbdd3088ff936afd5910bf7c48ff872d6a1fa6051 9a04caa1e973b8b38708a86b4d85f9b30a0006b7688a286f225c548b81df8935 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 1a3c4f5f30659738641abdd28cb793dab3cfde484196b59656fc0a2767e53511 de2ebb210c7759ef7a6f7ee9f805e1cac879221287281775fc80ba34a5492edf @@ -643,7 +643,7 @@ lib/codeql/rust/elements/internal/generated/TypeRepr.qll 1e7b9d2ddab86e35dad7c31 lib/codeql/rust/elements/internal/generated/UnderscoreExpr.qll b3780c99c5d57159bef4c6bd2fd8ec44ebd1854c892c1ca776c740f71249e58c 2fd451cbf0a779e8042e439882e7d9cadc19d1e596df3bbb086d16f2596407c7 lib/codeql/rust/elements/internal/generated/Unextracted.qll 01563dfd769d6dc3c6b8a40d9a4dc0d99a3b6a0c6725c180d2bf4d7633929a17 a93ce90f8c03f4305e59de9c63f089fc7935298fc9a73d091d76933cf63e790c lib/codeql/rust/elements/internal/generated/Unimplemented.qll a3eb304781991bff1227de1e4422b68bf91e7b344e4f6c9e874b324e82a35e60 6bc4839fda3850a56dc993b79ef9ba921008395c8432b184e14438fba4566f21 -lib/codeql/rust/elements/internal/generated/Union.qll 328d714dba5b19f8bf94c17efee21c9ca9e693a3a568a2afed3dc0d03fcc3f50 9be7039ce837a3217e97f64c8667d78e4d69e19c8fe7c19198389acb83a15957 +lib/codeql/rust/elements/internal/generated/Union.qll d8d21121ebdd274a99e466866a89efe3a6a7bb43fecb770ce35a1d7ac69d07c9 9f917b82bdc4c7fe2eecfb219cb1302ac05020df0cf09bb054f4a7fcfd7788ca lib/codeql/rust/elements/internal/generated/Use.qll cf95b5c4756b25bee74113207786e37464ffbc0fb5f776a04c651300afc53753 1fe26b3904db510184cb688cb0eeb0a8dbac7ac15e27a3b572d839743c738393 lib/codeql/rust/elements/internal/generated/UseBoundGenericArg.qll 69162794e871291545ea04f61259b2d000671a96f7ca129f7dd9ed6e984067c4 31de9ebc0634b38e2347e0608b4ea888892f1f2732a2892464078cd8a07b4ee8 lib/codeql/rust/elements/internal/generated/UseBoundGenericArgs.qll 2cc8ab0068b7bf44ca17a62b32a8dd1d89cd743532c8a96b262b164fd81b0c36 347e7709a0f5ace197beb6827f6cf04a31ff68ff2dff3707914c6b910658d00a diff --git a/rust/ql/lib/codeql/rust/elements/Enum.qll b/rust/ql/lib/codeql/rust/elements/Enum.qll index 9d52b558f538..2ff0cea05522 100644 --- a/rust/ql/lib/codeql/rust/elements/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/Enum.qll @@ -7,6 +7,7 @@ private import internal.EnumImpl import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList +import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Struct.qll b/rust/ql/lib/codeql/rust/elements/Struct.qll index 27b6a37b7913..d05d5fe5fd5d 100644 --- a/rust/ql/lib/codeql/rust/elements/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/Struct.qll @@ -8,6 +8,7 @@ import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList +import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Union.qll b/rust/ql/lib/codeql/rust/elements/Union.qll index 4bf596f4d7a4..12d495880c6e 100644 --- a/rust/ql/lib/codeql/rust/elements/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/Union.qll @@ -7,6 +7,7 @@ private import internal.UnionImpl import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList +import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.VariantDef diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll index b829ead848cc..fafb2de98e72 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll @@ -9,6 +9,7 @@ private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList +import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility @@ -29,7 +30,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Enum` class directly. * Use the subclass `Enum`, where the following predicates are available. */ - class Enum extends Synth::TEnum, AdtImpl::Adt { + class Enum extends Synth::TEnum, AdtImpl::Adt, ItemImpl::Item { override string getAPrimaryQlClass() { result = "Enum" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index a0ccc4d728b2..f7db87c452b1 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -3937,12 +3937,13 @@ private module Impl { private Element getImmediateChildOfEnum(Enum e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int n, int nAttr, int nGenericParamList, int nName, int nVariantList, - int nVisibility, int nWhereClause + int b, int bAdt, int bItem, int n, int nAttr, int nGenericParamList, int nName, + int nVariantList, int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - n = bAdt and + bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and + n = bItem and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and nName = nGenericParamList + 1 and @@ -3954,6 +3955,8 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or + result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) + or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" or @@ -4020,13 +4023,14 @@ private module Impl { private Element getImmediateChildOfStruct(Struct e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bVariantDef, int n, int nAttr, int nFieldList, int nGenericParamList, - int nName, int nVisibility, int nWhereClause + int b, int bAdt, int bItem, int bVariantDef, int n, int nAttr, int nFieldList, + int nGenericParamList, int nName, int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and + bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and bVariantDef = - bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and n = bVariantDef and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nFieldList = nAttr + 1 and @@ -4039,7 +4043,9 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) + result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) + or + result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" @@ -4063,13 +4069,14 @@ private module Impl { private Element getImmediateChildOfUnion(Union e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bVariantDef, int n, int nAttr, int nGenericParamList, int nName, - int nStructFieldList, int nVisibility, int nWhereClause + int b, int bAdt, int bItem, int bVariantDef, int n, int nAttr, int nGenericParamList, + int nName, int nStructFieldList, int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and + bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and bVariantDef = - bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and n = bVariantDef and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and @@ -4082,7 +4089,9 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) + result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) + or + result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 8835f4588c0c..2baeda04c115 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -4499,7 +4499,7 @@ module Raw { * enum E {A, B(i32), C {x: i32}} * ``` */ - class Enum extends @enum, Adt { + class Enum extends @enum, Adt, Item { override string toString() { result = "Enum" } /** @@ -4607,7 +4607,7 @@ module Raw { * } * ``` */ - class Struct extends @struct, Adt, VariantDef { + class Struct extends @struct, Adt, Item, VariantDef { override string toString() { result = "Struct" } /** @@ -4650,7 +4650,7 @@ module Raw { * union U { f1: u32, f2: f32 } * ``` */ - class Union extends @union, Adt, VariantDef { + class Union extends @union, Adt, Item, VariantDef { override string toString() { result = "Union" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll index 8589273ff4cf..7c46059a4047 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll @@ -10,6 +10,7 @@ import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList +import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility @@ -31,7 +32,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Struct` class directly. * Use the subclass `Struct`, where the following predicates are available. */ - class Struct extends Synth::TStruct, AdtImpl::Adt, VariantDefImpl::VariantDef { + class Struct extends Synth::TStruct, AdtImpl::Adt, ItemImpl::Item, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Struct" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 28300de45805..d2196c44add9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -775,9 +775,9 @@ module Synth { * INTERNAL: Do not use. */ class TItem = - TAdt or TConst or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or - TMacroDef or TMacroRules or TModule or TStatic or TTrait or TTraitAlias or TTypeAlias or - TUse; + TAdt or TConst or TEnum or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or + TMacroDef or TMacroRules or TModule or TStatic or TStruct or TTrait or TTraitAlias or + TTypeAlias or TUnion or TUse; /** * INTERNAL: Do not use. @@ -2234,6 +2234,8 @@ module Synth { or result = convertConstFromRaw(e) or + result = convertEnumFromRaw(e) + or result = convertExternBlockFromRaw(e) or result = convertExternCrateFromRaw(e) @@ -2252,12 +2254,16 @@ module Synth { or result = convertStaticFromRaw(e) or + result = convertStructFromRaw(e) + or result = convertTraitFromRaw(e) or result = convertTraitAliasFromRaw(e) or result = convertTypeAliasFromRaw(e) or + result = convertUnionFromRaw(e) + or result = convertUseFromRaw(e) } @@ -3842,6 +3848,8 @@ module Synth { or result = convertConstToRaw(e) or + result = convertEnumToRaw(e) + or result = convertExternBlockToRaw(e) or result = convertExternCrateToRaw(e) @@ -3860,12 +3868,16 @@ module Synth { or result = convertStaticToRaw(e) or + result = convertStructToRaw(e) + or result = convertTraitToRaw(e) or result = convertTraitAliasToRaw(e) or result = convertTypeAliasToRaw(e) or + result = convertUnionToRaw(e) + or result = convertUseToRaw(e) } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll index 88040c4ad137..69851628ae8a 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll @@ -9,6 +9,7 @@ private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList +import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl @@ -30,7 +31,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Union` class directly. * Use the subclass `Union`, where the following predicates are available. */ - class Union extends Synth::TUnion, AdtImpl::Adt, VariantDefImpl::VariantDef { + class Union extends Synth::TUnion, AdtImpl::Adt, ItemImpl::Item, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Union" } /** diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 9d208615c27d..3a929c908b6f 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -1919,6 +1919,7 @@ infer_type_reprs( @item = @adt | @const +| @enum | @extern_block | @extern_crate | @function @@ -1928,9 +1929,11 @@ infer_type_reprs( | @macro_rules | @module | @static +| @struct | @trait | @trait_alias | @type_alias +| @union | @use ; diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index ab5a62d9a98a..c59cd01a4342 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -16,7 +16,8 @@ class LoopingExpr(LabelableExpr): loop_body: optional["BlockExpr"] | child -class Adt(Item): +@annotate(Adt, replace_bases={AstNode: Item}) +class _: """ An ADT (Abstract Data Type) definition, such as `Struct`, `Enum`, or `Union`. """ @@ -1039,7 +1040,7 @@ class _: """ -@annotate(Enum, replace_bases={Item: Adt}) +@annotate(Enum) class _: """ An enum declaration. @@ -1834,7 +1835,7 @@ class _: """ -@annotate(Struct, replace_bases={Item: Adt}) +@annotate(Struct) class _: """ A Struct. For example: @@ -2013,7 +2014,7 @@ class _: """ -@annotate(Union, replace_bases={Item: Adt}) +@annotate(Union) class _: """ A union declaration. diff --git a/rust/schema/ast.py b/rust/schema/ast.py index 17fb872bb8ec..32f085a4f7da 100644 --- a/rust/schema/ast.py +++ b/rust/schema/ast.py @@ -2,6 +2,9 @@ from .prelude import * +class Adt(AstNode, ): + pass + class AsmOperand(AstNode, ): pass @@ -207,7 +210,7 @@ class ContinueExpr(Expr, ): class DynTraitTypeRepr(TypeRepr, ): type_bound_list: optional["TypeBoundList"] | child -class Enum(Item, ): +class Enum(Adt, Item, ): attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child name: optional["Name"] | child @@ -625,7 +628,7 @@ class StmtList(AstNode, ): statements: list["Stmt"] | child tail_expr: optional["Expr"] | child -class Struct(Item, VariantDef, ): +class Struct(Adt, Item, VariantDef, ): attrs: list["Attr"] | child field_list: optional["FieldList"] | child generic_param_list: optional["GenericParamList"] | child @@ -713,7 +716,7 @@ class TypeParam(GenericParam, ): class UnderscoreExpr(Expr, ): attrs: list["Attr"] | child -class Union(Item, VariantDef, ): +class Union(Adt, Item, VariantDef, ): attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child name: optional["Name"] | child From 0d292b785c2027caf7ea2b86e2e3797dc039043a Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 15:45:18 +0200 Subject: [PATCH 4/7] Rust: remove reduntant `Item` superclass from `Adt` subclasses --- misc/codegen/lib/schemadefs.py | 9 ++++-- rust/ql/.generated.list | 18 +++++------ rust/ql/lib/codeql/rust/elements/Enum.qll | 1 - rust/ql/lib/codeql/rust/elements/Struct.qll | 1 - rust/ql/lib/codeql/rust/elements/Union.qll | 1 - .../rust/elements/internal/generated/Enum.qll | 3 +- .../internal/generated/ParentChild.qll | 31 +++++++------------ .../rust/elements/internal/generated/Raw.qll | 6 ++-- .../elements/internal/generated/Struct.qll | 3 +- .../elements/internal/generated/Synth.qll | 18 ++--------- .../elements/internal/generated/Union.qll | 3 +- rust/ql/lib/rust.dbscheme | 3 -- rust/schema/annotations.py | 6 ++-- 13 files changed, 38 insertions(+), 65 deletions(-) diff --git a/misc/codegen/lib/schemadefs.py b/misc/codegen/lib/schemadefs.py index 5841b9ac874d..125951701c9b 100644 --- a/misc/codegen/lib/schemadefs.py +++ b/misc/codegen/lib/schemadefs.py @@ -321,7 +321,7 @@ def modify(self, prop: _schema.Property): def annotate( annotated_cls: type, add_bases: _Iterable[type] | None = None, - replace_bases: _Dict[type, type] | None = None, + replace_bases: _Dict[type, type | None] | None = None, cfg: bool = False, ) -> _Callable[[type], _PropertyModifierList]: """ @@ -329,7 +329,8 @@ def annotate( The name of the class used for annotation must be `_`. - `replace_bases` can be used to replace bases on the annotated class. + `replace_bases` can be used to replace bases on the annotated class. Mapping to + `None` will remove that base class. """ def decorator(cls: type) -> _PropertyModifierList: @@ -341,7 +342,9 @@ def decorator(cls: type) -> _PropertyModifierList: _ClassPragma(p, value=v)(annotated_cls) if replace_bases: annotated_cls.__bases__ = tuple( - replace_bases.get(b, b) for b in annotated_cls.__bases__ + b + for b in (replace_bases.get(b, b) for b in annotated_cls.__bases__) + if b is not None ) if add_bases: annotated_cls.__bases__ += tuple(add_bases) diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index a08afe1fdad8..4aa4e6d7da09 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -47,7 +47,7 @@ lib/codeql/rust/elements/ContinueExpr.qll 9f27c5d5c819ad0ebc5bd10967ba8d33a9dc95 lib/codeql/rust/elements/Crate.qll 1426960e6f36195e42ea5ea321405c1a72fccd40cd6c0a33673c321c20302d8d 1571a89f89dab43c5291b71386de7aadf52730755ba10f9d696db9ad2f760aff lib/codeql/rust/elements/DynTraitTypeRepr.qll e4d27112d27ae93c621defd2c976fd4e90663ab7f6115e83ae4fe8106cb5e015 eb9fde89698588f3b7116f62388c54e937f99559b22c93d11a5596e754560072 lib/codeql/rust/elements/Element.qll 0b62d139fef54ed2cf2e2334806aa9bfbc036c9c2085d558f15a42cc3fa84c48 24b999b93df79383ef27ede46e38da752868c88a07fe35fcff5d526684ba7294 -lib/codeql/rust/elements/Enum.qll 3630f73c1ea158c6977a9d2b2543eb8ebeeb9fef1a7575fdd4b05c98e5938d69 f5f4c93af0741685aa422498fb547e0ee647b632ad5821fb7278d9f2f70e4342 +lib/codeql/rust/elements/Enum.qll 55d5a4a775f07d9c1d5183af76f9d8de1d700bfe1dea427cc7ff3083f39e13de f00a585596f1d0ab34e6f2b7cdaba6d4a89005820478f810e8685478cf88100e lib/codeql/rust/elements/Expr.qll e5d65e805ccf440d64d331e55df4c4144ab8c8f63f367382494714087659ffe8 2bbc1e5d3a65f413ec33d9822fa451fbdbe32349158db58cc0bfcfafb0e21bda lib/codeql/rust/elements/ExprStmt.qll 00ac4c7d0192b9e8b0f28d5ae59c27729ff5a831ca11938ea3e677a262337a64 7cc02aa5346cd7c50d75ca63cd6501097b0a3979eb2ed838adff114fe17d35a3 lib/codeql/rust/elements/ExternBlock.qll 96c70d0761ec385fe17aa7228e15fd1711949d5abba5877a1c2f4c180d202125 38ad458868a368d437b2dda44307d788a85c887f45ea76c99adbfc9a53f14d81 @@ -146,7 +146,7 @@ lib/codeql/rust/elements/SourceFile.qll 0b6a3e58767c07602b19975009a2ad53ecf1fd72 lib/codeql/rust/elements/Static.qll a6d73152ddecb53a127aa3a4139f97007cd77b46203691c287600aa7200b8beb 547197e794803b3ea0c0e220f050980adec815a16fdef600f98ff795aa77f677 lib/codeql/rust/elements/Stmt.qll 532b12973037301246daf7d8c0177f734202f43d9261c7a4ca6f5080eea8ca64 b838643c4f2b4623d2c816cddad0e68ca3e11f2879ab7beaece46f489ec4b1f3 lib/codeql/rust/elements/StmtList.qll e874859ce03672d0085e47e0ca5e571b92b539b31bf0d5a8802f9727bef0c6b0 e5fe83237f713cdb57c446a6e1c20f645c2f49d9f5ef2c984032df83acb3c0de -lib/codeql/rust/elements/Struct.qll 6ed5475dc66c192290bd11ec4c80ec3093b837456146329b447422c7789574e7 b471e12936bc8095eab45c5473d279b6681fce4cb80afa01d73293061e39b66e +lib/codeql/rust/elements/Struct.qll 6ae1ce11044a1f6bf3150ddce947c1be17e462613edf7ea4fe7d861aa3dbe0d1 043ef682d71f31e8808962032c05ab3045e7cbc8663ec7e06dc9255e12e53c12 lib/codeql/rust/elements/StructExpr.qll af9059c01a97755e94f1a8b60c66d9c7663ed0705b2845b086b8953f16019fab 2d33d86b035a15c1b31c3e07e0e74c4bbe57a71c5a55d60e720827814e73b7ba lib/codeql/rust/elements/StructExprField.qll 3eb9f17ecd1ad38679689eb4ecc169d3a0b5b7a3fc597ae5a957a7aea2f74e4f 8fcd26f266f203004899a60447ba16e7eae4e3a654fbec7f54e26857730ede93 lib/codeql/rust/elements/StructExprFieldList.qll 6efb2ec4889b38556dc679bb89bbd4bd76ed6a60014c41f8e232288fc23b2d52 dc867a0a4710621e04b36bbec7d317d6f360e0d6ac68b79168c8b714babde31d @@ -175,7 +175,7 @@ lib/codeql/rust/elements/TypeRepr.qll ea41b05ef0aaac71da460f9a6a8331cf98166f2c38 lib/codeql/rust/elements/UnderscoreExpr.qll 233661b82b87c8cda16d8f2e17965658c3dc6b69efb23cb8eb9c4f50c68521e0 8edff8e80aac2ecf83a6b58f310cab688cbaeea0a0e68a298b644e565960cc74 lib/codeql/rust/elements/Unextracted.qll 12e60c79ef5b94d72b579b19970622e7b73822ebc13fbcfedfe953527ab1ac36 ec015db2eb12c3c82693ddc71d32d9ab9ef7a958e741e2510681bb707ceca23e lib/codeql/rust/elements/Unimplemented.qll bf624d28163e5c99accda16c0c99f938bec4a3b1b920a463e86fc8529ff5ff02 013bc7777298d250338f835cd494b5a8accea2d6a4f9561851f283ac129a446b -lib/codeql/rust/elements/Union.qll da30dcfc2bb60a2d2b63dbcb71aca50a380196a79633b85a06fb45d0cbd65c68 27fa235c5a4f7d17e0737addcc436853f1b9c7e96f283c37985c17929fac6788 +lib/codeql/rust/elements/Union.qll 3e277155fc7ea77f645cb5c5b227efd1474aa745b12a8be228eab694536c49dc a4bf9b54b8262517371000a842e5fdcdaabd324e52afd7919bbf76bc887b18b6 lib/codeql/rust/elements/Use.qll fdcf70574403c2f219353211b6930f2f9bc79f41c2594e07548de5a8c6cbb24d e41f2b689fcbeb7b84c7ba8d09592f7561626559318642b73574bbac83f74546 lib/codeql/rust/elements/UseBoundGenericArg.qll f16903f8fff676d3700eaad5490804624391141472ecc3166ccb1f70c794c120 5efda98088d096b42f53ceccae78c05f15c6953525b514d849681cb2cf65b147 lib/codeql/rust/elements/UseBoundGenericArgs.qll d9821a82a1d57e609fdc5e79d65e9a88b0088f51d03927e09f41b6931d3484ab 181483a95e22622c7cee07cce87e9476053f824a82e67e2bdecabf5a39f672ad @@ -508,7 +508,7 @@ lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83 lib/codeql/rust/elements/internal/generated/Crate.qll 37f3760d7c0c1c3ca809d07daf7215a8eae6053eda05e88ed7db6e07f4db0781 649a3d7cd7ee99f95f8a4d3d3c41ea2fa848ce7d8415ccbac62977dfc9a49d35 lib/codeql/rust/elements/internal/generated/DynTraitTypeRepr.qll b2e0e728b6708923b862d9d8d6104d13f572da17e393ec1485b8465e4bfdc206 4a87ea9669c55c4905ce4e781b680f674989591b0cb56af1e9fa1058c13300b3 lib/codeql/rust/elements/internal/generated/Element.qll d56d22c060fa929464f837b1e16475a4a2a2e42d68235a014f7369bcb48431db 0e48426ca72179f675ac29aa49bbaadb8b1d27b08ad5cbc72ec5a005c291848e -lib/codeql/rust/elements/internal/generated/Enum.qll a9d8a52ba8368889c29855d0c966ed74460c83d34e3410fffe08091a3c76b642 0c7a9a675ed3b5ec22074f47745816c7c009676871279906f39ad9669450c35c +lib/codeql/rust/elements/internal/generated/Enum.qll 477eaa102c1268f0fa7603ecd88f1b83db1388c17c25e3719d4113ea980256f7 2d60db61ba4a385218f0a01e366e04ba1e7dad386b7e6a027c31f32fb730cca2 lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8 lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b lib/codeql/rust/elements/internal/generated/ExternBlock.qll e7faac92297a53ac6e0420eec36255a54f360eeb962bf663a00da709407832dd 5ff32c54ec7097d43cc3311492090b9b90f411eead3bc849f258858f29405e81 @@ -580,7 +580,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll eaa0cd4402d3665013d47e lib/codeql/rust/elements/internal/generated/ParenExpr.qll 812d2ff65079277f39f15c084657a955a960a7c1c0e96dd60472a58d56b945eb eb8c607f43e1fcbb41f37a10de203a1db806690e10ff4f04d48ed874189cb0eb lib/codeql/rust/elements/internal/generated/ParenPat.qll 24f9dc7fce75827d6fddb856cd48f80168143151b27295c0bab6db5a06567a09 ebadbc6f5498e9ed754b39893ce0763840409a0721036a25b56e1ead7dcc09aa lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 03f5c5b96a37adeb845352d7fcea3e098da9050e534972d14ac0f70d60a2d776 ed3d6e5d02086523087adebce4e89e35461eb95f2a66d1d4100fe23fc691b126 -lib/codeql/rust/elements/internal/generated/ParentChild.qll 2bcec7e700042db6e58b85bb1346a03f0fa41252af7aa0c835be38217e9c6fda 348c4408b2ab91b6b498242b9e4675dd5015aeac9f5b2d52760f1c071c1d1924 +lib/codeql/rust/elements/internal/generated/ParentChild.qll b58a01c0d2cca085a77ed7a98a0318cfc20450e48c64124f8a875ae45416ac25 92e9b6434629508868a5cf69c1236729409dcab4c4cda63af537d591a840127a lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll d901fdc8142a5b8847cc98fc2afcfd16428b8ace4fbffb457e761b5fd3901a77 5dbb0aea5a13f937da666ccb042494af8f11e776ade1459d16b70a4dd193f9fb lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -595,7 +595,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 8d0ea4f6c7f8203340bf lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll bc03ef3af94aa43287e054f731c283eec1610e319201ab2a78249c2a7ee22413 30278f463569b5f7b5011f61b9cfe111449829cbb32b251e5c5e58cd438b5978 +lib/codeql/rust/elements/internal/generated/Raw.qll f9370ca510d47144f7a22255341dc0f45407fcc8c22d42a74dbc423a68a36635 2301eb8a7b4d59c05413e07f95fe9ac2d0f42d3673d9b7e809bd49a6c1bee506 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 5b0663a6d234572fb3e467e276d019415caa95ef006438cc59b7af4e1783161e 0e27c8a8f0e323c0e4d6db01fca821bf07c0864d293cdf96fa891b10820c1e4b @@ -612,7 +612,7 @@ lib/codeql/rust/elements/internal/generated/SourceFile.qll 4bc95c88b49868d1da1a8 lib/codeql/rust/elements/internal/generated/Static.qll 34a4cdb9f4a93414499a30aeeaad1b3388f2341c982af5688815c3b0a0e9c57b 3c8354336eff68d580b804600df9abf49ee5ee10ec076722089087820cefe731 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll 816aebf8f56e179f5f0ba03e80d257ee85459ea757392356a0af6dbd0cd9ef5e 6aa51cdcdc8d93427555fa93f0e84afdfbbd4ffc8b8d378ae4a22b5b6f94f48b -lib/codeql/rust/elements/internal/generated/Struct.qll 869ef9510b92f0e80455fd9e9640c33304035937a7ee4457a03191e4ca8a9065 401932fd7984dec3946cb0d49752d1ec86f6f2f819de2f5cdc36f5ce3f035690 +lib/codeql/rust/elements/internal/generated/Struct.qll ce40dd64d61f6ca0a8425019dd8368ca3d79d3a238d7afb9b3f1c86c2c95c1b5 214946f9cdbf134a181d98b02bb630504ad524541febc4c0b8490a9a6fab8750 lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll 298d33442d1054922d2f97133a436ee559f1f35b7708523284d1f7eee7ebf443 7febe38a79fadf3dcb53fb8f8caf4c2780f5df55a1f8336269c7b674d53c6272 @@ -621,7 +621,7 @@ lib/codeql/rust/elements/internal/generated/StructFieldList.qll 5da528a51a6a5db9 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf lib/codeql/rust/elements/internal/generated/StructPatFieldList.qll 1a95a1bd9f64fb18e9571657cf2d02a8b13c747048a1f0f74baf31b91f0392ad fc274e414ff4ed54386046505920de92755ad0b4d39a7523cdffa4830bd53b37 -lib/codeql/rust/elements/internal/generated/Synth.qll 6835c645faf2eac3dfd2d29dbdd3088ff936afd5910bf7c48ff872d6a1fa6051 9a04caa1e973b8b38708a86b4d85f9b30a0006b7688a286f225c548b81df8935 +lib/codeql/rust/elements/internal/generated/Synth.qll ef45765a8e077bc0168ec226b3b84902acd8d774cd7af637e0b1b1b16ff1deaf 58dd7076517e5d680c6d8b0489530bd8e1d15d629a233f1742cca3f028d5ec81 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 1a3c4f5f30659738641abdd28cb793dab3cfde484196b59656fc0a2767e53511 de2ebb210c7759ef7a6f7ee9f805e1cac879221287281775fc80ba34a5492edf @@ -643,7 +643,7 @@ lib/codeql/rust/elements/internal/generated/TypeRepr.qll 1e7b9d2ddab86e35dad7c31 lib/codeql/rust/elements/internal/generated/UnderscoreExpr.qll b3780c99c5d57159bef4c6bd2fd8ec44ebd1854c892c1ca776c740f71249e58c 2fd451cbf0a779e8042e439882e7d9cadc19d1e596df3bbb086d16f2596407c7 lib/codeql/rust/elements/internal/generated/Unextracted.qll 01563dfd769d6dc3c6b8a40d9a4dc0d99a3b6a0c6725c180d2bf4d7633929a17 a93ce90f8c03f4305e59de9c63f089fc7935298fc9a73d091d76933cf63e790c lib/codeql/rust/elements/internal/generated/Unimplemented.qll a3eb304781991bff1227de1e4422b68bf91e7b344e4f6c9e874b324e82a35e60 6bc4839fda3850a56dc993b79ef9ba921008395c8432b184e14438fba4566f21 -lib/codeql/rust/elements/internal/generated/Union.qll d8d21121ebdd274a99e466866a89efe3a6a7bb43fecb770ce35a1d7ac69d07c9 9f917b82bdc4c7fe2eecfb219cb1302ac05020df0cf09bb054f4a7fcfd7788ca +lib/codeql/rust/elements/internal/generated/Union.qll 328d714dba5b19f8bf94c17efee21c9ca9e693a3a568a2afed3dc0d03fcc3f50 9be7039ce837a3217e97f64c8667d78e4d69e19c8fe7c19198389acb83a15957 lib/codeql/rust/elements/internal/generated/Use.qll cf95b5c4756b25bee74113207786e37464ffbc0fb5f776a04c651300afc53753 1fe26b3904db510184cb688cb0eeb0a8dbac7ac15e27a3b572d839743c738393 lib/codeql/rust/elements/internal/generated/UseBoundGenericArg.qll 69162794e871291545ea04f61259b2d000671a96f7ca129f7dd9ed6e984067c4 31de9ebc0634b38e2347e0608b4ea888892f1f2732a2892464078cd8a07b4ee8 lib/codeql/rust/elements/internal/generated/UseBoundGenericArgs.qll 2cc8ab0068b7bf44ca17a62b32a8dd1d89cd743532c8a96b262b164fd81b0c36 347e7709a0f5ace197beb6827f6cf04a31ff68ff2dff3707914c6b910658d00a diff --git a/rust/ql/lib/codeql/rust/elements/Enum.qll b/rust/ql/lib/codeql/rust/elements/Enum.qll index 2ff0cea05522..9d52b558f538 100644 --- a/rust/ql/lib/codeql/rust/elements/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/Enum.qll @@ -7,7 +7,6 @@ private import internal.EnumImpl import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Struct.qll b/rust/ql/lib/codeql/rust/elements/Struct.qll index d05d5fe5fd5d..27b6a37b7913 100644 --- a/rust/ql/lib/codeql/rust/elements/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/Struct.qll @@ -8,7 +8,6 @@ import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility diff --git a/rust/ql/lib/codeql/rust/elements/Union.qll b/rust/ql/lib/codeql/rust/elements/Union.qll index 12d495880c6e..4bf596f4d7a4 100644 --- a/rust/ql/lib/codeql/rust/elements/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/Union.qll @@ -7,7 +7,6 @@ private import internal.UnionImpl import codeql.rust.elements.Adt import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.Item import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.VariantDef diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll index fafb2de98e72..b829ead848cc 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Enum.qll @@ -9,7 +9,6 @@ private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility @@ -30,7 +29,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Enum` class directly. * Use the subclass `Enum`, where the following predicates are available. */ - class Enum extends Synth::TEnum, AdtImpl::Adt, ItemImpl::Item { + class Enum extends Synth::TEnum, AdtImpl::Adt { override string getAPrimaryQlClass() { result = "Enum" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index f7db87c452b1..a0ccc4d728b2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -3937,13 +3937,12 @@ private module Impl { private Element getImmediateChildOfEnum(Enum e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bItem, int n, int nAttr, int nGenericParamList, int nName, - int nVariantList, int nVisibility, int nWhereClause + int b, int bAdt, int n, int nAttr, int nGenericParamList, int nName, int nVariantList, + int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and - n = bItem and + n = bAdt and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and nName = nGenericParamList + 1 and @@ -3955,8 +3954,6 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) - or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" or @@ -4023,14 +4020,13 @@ private module Impl { private Element getImmediateChildOfStruct(Struct e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bItem, int bVariantDef, int n, int nAttr, int nFieldList, - int nGenericParamList, int nName, int nVisibility, int nWhereClause + int b, int bAdt, int bVariantDef, int n, int nAttr, int nFieldList, int nGenericParamList, + int nName, int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and bVariantDef = - bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and n = bVariantDef and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nFieldList = nAttr + 1 and @@ -4043,9 +4039,7 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) - or - result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) + result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" @@ -4069,14 +4063,13 @@ private module Impl { private Element getImmediateChildOfUnion(Union e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bItem, int bVariantDef, int n, int nAttr, int nGenericParamList, - int nName, int nStructFieldList, int nVisibility, int nWhereClause + int b, int bAdt, int bVariantDef, int n, int nAttr, int nGenericParamList, int nName, + int nStructFieldList, int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - bItem = bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfItem(e, i, _)) | i) and bVariantDef = - bItem + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and + bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and n = bVariantDef and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and @@ -4089,9 +4082,7 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfItem(e, index - bAdt, partialPredicateCall) - or - result = getImmediateChildOfVariantDef(e, index - bItem, partialPredicateCall) + result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 2baeda04c115..8835f4588c0c 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -4499,7 +4499,7 @@ module Raw { * enum E {A, B(i32), C {x: i32}} * ``` */ - class Enum extends @enum, Adt, Item { + class Enum extends @enum, Adt { override string toString() { result = "Enum" } /** @@ -4607,7 +4607,7 @@ module Raw { * } * ``` */ - class Struct extends @struct, Adt, Item, VariantDef { + class Struct extends @struct, Adt, VariantDef { override string toString() { result = "Struct" } /** @@ -4650,7 +4650,7 @@ module Raw { * union U { f1: u32, f2: f32 } * ``` */ - class Union extends @union, Adt, Item, VariantDef { + class Union extends @union, Adt, VariantDef { override string toString() { result = "Union" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll index 7c46059a4047..8589273ff4cf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll @@ -10,7 +10,6 @@ import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility @@ -32,7 +31,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Struct` class directly. * Use the subclass `Struct`, where the following predicates are available. */ - class Struct extends Synth::TStruct, AdtImpl::Adt, ItemImpl::Item, VariantDefImpl::VariantDef { + class Struct extends Synth::TStruct, AdtImpl::Adt, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Struct" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index d2196c44add9..28300de45805 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -775,9 +775,9 @@ module Synth { * INTERNAL: Do not use. */ class TItem = - TAdt or TConst or TEnum or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or - TMacroDef or TMacroRules or TModule or TStatic or TStruct or TTrait or TTraitAlias or - TTypeAlias or TUnion or TUse; + TAdt or TConst or TExternBlock or TExternCrate or TFunction or TImpl or TMacroCall or + TMacroDef or TMacroRules or TModule or TStatic or TTrait or TTraitAlias or TTypeAlias or + TUse; /** * INTERNAL: Do not use. @@ -2234,8 +2234,6 @@ module Synth { or result = convertConstFromRaw(e) or - result = convertEnumFromRaw(e) - or result = convertExternBlockFromRaw(e) or result = convertExternCrateFromRaw(e) @@ -2254,16 +2252,12 @@ module Synth { or result = convertStaticFromRaw(e) or - result = convertStructFromRaw(e) - or result = convertTraitFromRaw(e) or result = convertTraitAliasFromRaw(e) or result = convertTypeAliasFromRaw(e) or - result = convertUnionFromRaw(e) - or result = convertUseFromRaw(e) } @@ -3848,8 +3842,6 @@ module Synth { or result = convertConstToRaw(e) or - result = convertEnumToRaw(e) - or result = convertExternBlockToRaw(e) or result = convertExternCrateToRaw(e) @@ -3868,16 +3860,12 @@ module Synth { or result = convertStaticToRaw(e) or - result = convertStructToRaw(e) - or result = convertTraitToRaw(e) or result = convertTraitAliasToRaw(e) or result = convertTypeAliasToRaw(e) or - result = convertUnionToRaw(e) - or result = convertUseToRaw(e) } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll index 69851628ae8a..88040c4ad137 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll @@ -9,7 +9,6 @@ private import codeql.rust.elements.internal.generated.Raw import codeql.rust.elements.internal.AdtImpl::Impl as AdtImpl import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList -import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl @@ -31,7 +30,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Union` class directly. * Use the subclass `Union`, where the following predicates are available. */ - class Union extends Synth::TUnion, AdtImpl::Adt, ItemImpl::Item, VariantDefImpl::VariantDef { + class Union extends Synth::TUnion, AdtImpl::Adt, VariantDefImpl::VariantDef { override string getAPrimaryQlClass() { result = "Union" } /** diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 3a929c908b6f..9d208615c27d 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -1919,7 +1919,6 @@ infer_type_reprs( @item = @adt | @const -| @enum | @extern_block | @extern_crate | @function @@ -1929,11 +1928,9 @@ infer_type_reprs( | @macro_rules | @module | @static -| @struct | @trait | @trait_alias | @type_alias -| @union | @use ; diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index c59cd01a4342..d18b23395c01 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -1040,7 +1040,7 @@ class _: """ -@annotate(Enum) +@annotate(Enum, replace_bases={Item: None}) # still an Item via Adt class _: """ An enum declaration. @@ -1835,7 +1835,7 @@ class _: """ -@annotate(Struct) +@annotate(Struct, replace_bases={Item: None}) # still an Item via Adt class _: """ A Struct. For example: @@ -2014,7 +2014,7 @@ class _: """ -@annotate(Union) +@annotate(Union, replace_bases={Item: None}) # still an Item via Adt class _: """ A union declaration. From 02b6e856a39d4b3045857b86297bfc2ff1561c1f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 15:59:18 +0200 Subject: [PATCH 5/7] Rust: remove `VariantDef` --- rust/ast-generator/src/main.rs | 6 +- rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 67 +------------------ rust/ql/.generated.list | 23 +++---- rust/ql/.gitattributes | 3 - rust/ql/lib/codeql/rust/elements.qll | 1 - rust/ql/lib/codeql/rust/elements/Struct.qll | 1 - rust/ql/lib/codeql/rust/elements/Union.qll | 1 - rust/ql/lib/codeql/rust/elements/Variant.qll | 1 - .../lib/codeql/rust/elements/VariantDef.qll | 9 --- .../rust/elements/internal/VariantDefImpl.qll | 16 ----- .../internal/generated/ParentChild.qll | 45 +++---------- .../rust/elements/internal/generated/Raw.qll | 11 +-- .../elements/internal/generated/Struct.qll | 3 +- .../elements/internal/generated/Synth.qll | 37 +--------- .../elements/internal/generated/Union.qll | 3 +- .../elements/internal/generated/Variant.qll | 3 +- .../internal/generated/VariantDef.qll | 21 ------ rust/ql/lib/rust.dbscheme | 7 -- rust/schema/annotations.py | 2 +- rust/schema/ast.py | 9 +-- 21 files changed, 39 insertions(+), 232 deletions(-) delete mode 100644 rust/ql/lib/codeql/rust/elements/VariantDef.qll delete mode 100644 rust/ql/lib/codeql/rust/elements/internal/VariantDefImpl.qll delete mode 100644 rust/ql/lib/codeql/rust/elements/internal/generated/VariantDef.qll diff --git a/rust/ast-generator/src/main.rs b/rust/ast-generator/src/main.rs index 35437777c21e..8c0ce955c005 100644 --- a/rust/ast-generator/src/main.rs +++ b/rust/ast-generator/src/main.rs @@ -385,8 +385,8 @@ struct ExtractorInfo { } fn enum_to_extractor_info(node: &AstEnumSrc) -> Option { - if matches!(node.name.as_str(), "VariantDef" | "Adt") { - // these are not used as types of fields, so we don't need to generate extractors for them + if node.name == "Adt" { + // no fields have `Adt` type, so we don't need extraction for it return None; } Some(ExtractorEnumInfo { @@ -484,6 +484,8 @@ fn main() -> anyhow::Result<()> { .parse() .expect("Failed to parse grammar"); let mut grammar = codegen::grammar::lower(&grammar); + // remove the VariantDef enum, there is no use for it at the moment + grammar.enums.retain(|e| e.name != "VariantDef"); let mut super_types: BTreeMap> = BTreeMap::new(); for node in &grammar.enums { diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 356bff6824f3..7daea41e3139 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b 78da6fde6bc6f66baf63b298b3d565d6a057b54e891f739a3510aff4563a9f1b +top.rs 4cd878b17ebc18c28cbaac2eb77a7401d60c0870247877c4c1dd155c31342482 4cd878b17ebc18c28cbaac2eb77a7401d60c0870247877c4c1dd155c31342482 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index 88fb5167b2ac..f2a78eb40ed6 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -3227,42 +3227,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct VariantDef { - _unused: () -} - -impl trap::TrapClass for VariantDef { - fn class_name() -> &'static str { "VariantDef" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme VariantDef is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme VariantDef is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme VariantDef is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct VariantList { pub id: trap::TrapId, @@ -8646,9 +8610,9 @@ impl trap::TrapClass for Variant { fn class_name() -> &'static str { "Variant" } } -impl From> for trap::Label { +impl From> for trap::Label { fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Variant is a subclass of VariantDef + // SAFETY: this is safe because in the dbscheme Variant is a subclass of Addressable unsafe { Self::from_untyped(value.as_untyped()) } @@ -8682,15 +8646,6 @@ impl From> for trap::Label { } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Variant is a subclass of Addressable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct WildcardPat { pub id: trap::TrapId, @@ -11551,15 +11506,6 @@ impl From> for trap::Label { } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Struct is a subclass of VariantDef - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct Union { pub id: trap::TrapId, @@ -11666,15 +11612,6 @@ impl From> for trap::Label { } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Union is a subclass of VariantDef - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct WhileExpr { pub id: trap::TrapId, diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 4aa4e6d7da09..896aeb4e3161 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -146,7 +146,7 @@ lib/codeql/rust/elements/SourceFile.qll 0b6a3e58767c07602b19975009a2ad53ecf1fd72 lib/codeql/rust/elements/Static.qll a6d73152ddecb53a127aa3a4139f97007cd77b46203691c287600aa7200b8beb 547197e794803b3ea0c0e220f050980adec815a16fdef600f98ff795aa77f677 lib/codeql/rust/elements/Stmt.qll 532b12973037301246daf7d8c0177f734202f43d9261c7a4ca6f5080eea8ca64 b838643c4f2b4623d2c816cddad0e68ca3e11f2879ab7beaece46f489ec4b1f3 lib/codeql/rust/elements/StmtList.qll e874859ce03672d0085e47e0ca5e571b92b539b31bf0d5a8802f9727bef0c6b0 e5fe83237f713cdb57c446a6e1c20f645c2f49d9f5ef2c984032df83acb3c0de -lib/codeql/rust/elements/Struct.qll 6ae1ce11044a1f6bf3150ddce947c1be17e462613edf7ea4fe7d861aa3dbe0d1 043ef682d71f31e8808962032c05ab3045e7cbc8663ec7e06dc9255e12e53c12 +lib/codeql/rust/elements/Struct.qll 297d3ea732fc7fbb8b8fb5479c1873ce84705146853ff752c84a6f70af12b923 3df0e5fd50a910a0b5611c3a860a1d7c318f6925c3a0727006d91840caf04812 lib/codeql/rust/elements/StructExpr.qll af9059c01a97755e94f1a8b60c66d9c7663ed0705b2845b086b8953f16019fab 2d33d86b035a15c1b31c3e07e0e74c4bbe57a71c5a55d60e720827814e73b7ba lib/codeql/rust/elements/StructExprField.qll 3eb9f17ecd1ad38679689eb4ecc169d3a0b5b7a3fc597ae5a957a7aea2f74e4f 8fcd26f266f203004899a60447ba16e7eae4e3a654fbec7f54e26857730ede93 lib/codeql/rust/elements/StructExprFieldList.qll 6efb2ec4889b38556dc679bb89bbd4bd76ed6a60014c41f8e232288fc23b2d52 dc867a0a4710621e04b36bbec7d317d6f360e0d6ac68b79168c8b714babde31d @@ -175,14 +175,13 @@ lib/codeql/rust/elements/TypeRepr.qll ea41b05ef0aaac71da460f9a6a8331cf98166f2c38 lib/codeql/rust/elements/UnderscoreExpr.qll 233661b82b87c8cda16d8f2e17965658c3dc6b69efb23cb8eb9c4f50c68521e0 8edff8e80aac2ecf83a6b58f310cab688cbaeea0a0e68a298b644e565960cc74 lib/codeql/rust/elements/Unextracted.qll 12e60c79ef5b94d72b579b19970622e7b73822ebc13fbcfedfe953527ab1ac36 ec015db2eb12c3c82693ddc71d32d9ab9ef7a958e741e2510681bb707ceca23e lib/codeql/rust/elements/Unimplemented.qll bf624d28163e5c99accda16c0c99f938bec4a3b1b920a463e86fc8529ff5ff02 013bc7777298d250338f835cd494b5a8accea2d6a4f9561851f283ac129a446b -lib/codeql/rust/elements/Union.qll 3e277155fc7ea77f645cb5c5b227efd1474aa745b12a8be228eab694536c49dc a4bf9b54b8262517371000a842e5fdcdaabd324e52afd7919bbf76bc887b18b6 +lib/codeql/rust/elements/Union.qll 13f7f62e98b117d18e79db5f6e6535447bc069ebb08f7cdb390b012678b7e085 bd8c37bc0ff09926753bc250e1848ed25923f224829d0136afc27b749eaddd1f lib/codeql/rust/elements/Use.qll fdcf70574403c2f219353211b6930f2f9bc79f41c2594e07548de5a8c6cbb24d e41f2b689fcbeb7b84c7ba8d09592f7561626559318642b73574bbac83f74546 lib/codeql/rust/elements/UseBoundGenericArg.qll f16903f8fff676d3700eaad5490804624391141472ecc3166ccb1f70c794c120 5efda98088d096b42f53ceccae78c05f15c6953525b514d849681cb2cf65b147 lib/codeql/rust/elements/UseBoundGenericArgs.qll d9821a82a1d57e609fdc5e79d65e9a88b0088f51d03927e09f41b6931d3484ab 181483a95e22622c7cee07cce87e9476053f824a82e67e2bdecabf5a39f672ad lib/codeql/rust/elements/UseTree.qll e67c148f63668319c37914a46ff600692de477242a0129fa1bb9839754c0f830 de9b39d3d078d51ec9130db6579bff13e6297e60556a7214a5c51cbf89d92791 lib/codeql/rust/elements/UseTreeList.qll 92ebfee4392a485b38fb3265fdede7c8f2ed1dbe2ab860aa61b1497c33874d25 a4e677455d20838e422e430eebd73d0a488e34e8c960f375fef7b99e79d4c911 -lib/codeql/rust/elements/Variant.qll 9377fa841779e8283df08432bf868faf161c36cc03f332c52ae219422cb9f959 2440771a5a1ef28927fe6fdc81b0e95c91aae18911739c89753fbadce7ff6cc9 -lib/codeql/rust/elements/VariantDef.qll fb14bf049aba1fc0b62d156e69b7965b6526d12c9150793f1d38b0f8fb8a0a8f 71453a80a3c60288242c5d86ab81ef4d027a3bc870ceffa62160864d32a7d7ad +lib/codeql/rust/elements/Variant.qll 7895461fa728f6c3a7293799c5e6b965b413b679566dcbd40bbe2609db8b6cde b0413547365a301bd9fbb6b266757f956394abad0a77f0e424446e23ec7d83e9 lib/codeql/rust/elements/VariantList.qll 39803fbb873d48202c2a511c00c8eafede06e519894e0fd050c2a85bf5f4aa73 1735f89b2b8f6d5960a276b87ea10e4bb8c848c24a5d5fad7f3add7a4d94b7da lib/codeql/rust/elements/Visibility.qll aa69e8a3fd3b01f6fea0ae2d841a2adc51f4e46dcfc9f8f03c34fbe96f7e24e7 0d475e97e07b73c8da2b53555085b8309d8dc69c113bcb396fc901361dbfe6b8 lib/codeql/rust/elements/WhereClause.qll 4e28e11ceec835a093e469854a4b615e698309cdcbc39ed83810e2e4e7c5953f 4736baf689b87dd6669cb0ef9e27eb2c0f2776ce7f29d7693670bbcea06eb4e4 @@ -444,7 +443,6 @@ lib/codeql/rust/elements/internal/UseTreeConstructor.qll 3e6e834100fcc7249f8a20f lib/codeql/rust/elements/internal/UseTreeListConstructor.qll 973577da5d7b58eb245f108bd1ae2fecc5645f2795421dedf7687b067a233003 f41e5e3ffcb2a387e5c37f56c0b271e8dc20428b6ff4c63e1ee42fcfa4e67d0a lib/codeql/rust/elements/internal/UseTreeListImpl.qll a155fbfeb9792d511e1f3331d6756ccff6cca18c7ca4cac0faa7184cbb2e0dd4 0eeb1343b2284c02f9a0f0237267c77857a3a3a0f57df8277437313fde38d1b7 lib/codeql/rust/elements/internal/VariantConstructor.qll 0297d4a9a9b32448d6d6063d308c8d0e7a067d028b9ec97de10a1d659ee2cfdd 6a4bee28b340e97d06b262120fd39ab21717233a5bcc142ba542cb1b456eb952 -lib/codeql/rust/elements/internal/VariantDefImpl.qll 5530c04b8906d2947ec9c79fc17a05a2557b01a521dd4ca8a60518b78d13867b 3971558e1c907d8d2ef174b10f911e61b898916055a8173788e6f0b98869b144 lib/codeql/rust/elements/internal/VariantListConstructor.qll c841fb345eb46ea3978a0ed7a689f8955efc9178044b140b74d98a6bcd0c926a c9e52d112abdba2b60013fa01a944c8770766bf7368f9878e6b13daaa4eed446 lib/codeql/rust/elements/internal/VariantListImpl.qll 4ceeda617696eb547c707589ba26103cf4c5c3d889955531be24cbf224e79dff 4258196c126fd2fad0e18068cb3d570a67034a8b26e2f13f8223d7f1a246d1a4 lib/codeql/rust/elements/internal/VisibilityConstructor.qll 1fd30663d87945f08d15cfaca54f586a658f26b7a98ea45ac73a35d36d4f65d0 6ddaf11742cc8fbbe03af2aa578394041ae077911e62d2fa6c885ae0543ba53a @@ -580,7 +578,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll eaa0cd4402d3665013d47e lib/codeql/rust/elements/internal/generated/ParenExpr.qll 812d2ff65079277f39f15c084657a955a960a7c1c0e96dd60472a58d56b945eb eb8c607f43e1fcbb41f37a10de203a1db806690e10ff4f04d48ed874189cb0eb lib/codeql/rust/elements/internal/generated/ParenPat.qll 24f9dc7fce75827d6fddb856cd48f80168143151b27295c0bab6db5a06567a09 ebadbc6f5498e9ed754b39893ce0763840409a0721036a25b56e1ead7dcc09aa lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 03f5c5b96a37adeb845352d7fcea3e098da9050e534972d14ac0f70d60a2d776 ed3d6e5d02086523087adebce4e89e35461eb95f2a66d1d4100fe23fc691b126 -lib/codeql/rust/elements/internal/generated/ParentChild.qll b58a01c0d2cca085a77ed7a98a0318cfc20450e48c64124f8a875ae45416ac25 92e9b6434629508868a5cf69c1236729409dcab4c4cda63af537d591a840127a +lib/codeql/rust/elements/internal/generated/ParentChild.qll ce0c542d50e1b9a25132d4085dc2495dacaf152b5b960772c08977bcad297502 7015c8371a39b312635fced11440da95ef7a4e50c1b7bc990cd64e2ea4fcf5ea lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll d901fdc8142a5b8847cc98fc2afcfd16428b8ace4fbffb457e761b5fd3901a77 5dbb0aea5a13f937da666ccb042494af8f11e776ade1459d16b70a4dd193f9fb lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -595,7 +593,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 8d0ea4f6c7f8203340bf lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll f9370ca510d47144f7a22255341dc0f45407fcc8c22d42a74dbc423a68a36635 2301eb8a7b4d59c05413e07f95fe9ac2d0f42d3673d9b7e809bd49a6c1bee506 +lib/codeql/rust/elements/internal/generated/Raw.qll e9071854089a126078be1f429bd518820eb5c80d8912ece4f77a34a865270747 3ba195ff7bce744e1290c14ff7330a9e096cd9f2850c9383f6baed8750765a76 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 5b0663a6d234572fb3e467e276d019415caa95ef006438cc59b7af4e1783161e 0e27c8a8f0e323c0e4d6db01fca821bf07c0864d293cdf96fa891b10820c1e4b @@ -612,7 +610,7 @@ lib/codeql/rust/elements/internal/generated/SourceFile.qll 4bc95c88b49868d1da1a8 lib/codeql/rust/elements/internal/generated/Static.qll 34a4cdb9f4a93414499a30aeeaad1b3388f2341c982af5688815c3b0a0e9c57b 3c8354336eff68d580b804600df9abf49ee5ee10ec076722089087820cefe731 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll 816aebf8f56e179f5f0ba03e80d257ee85459ea757392356a0af6dbd0cd9ef5e 6aa51cdcdc8d93427555fa93f0e84afdfbbd4ffc8b8d378ae4a22b5b6f94f48b -lib/codeql/rust/elements/internal/generated/Struct.qll ce40dd64d61f6ca0a8425019dd8368ca3d79d3a238d7afb9b3f1c86c2c95c1b5 214946f9cdbf134a181d98b02bb630504ad524541febc4c0b8490a9a6fab8750 +lib/codeql/rust/elements/internal/generated/Struct.qll 999da1b46e40d6e03fd2338fea02429462877c329c5d1338618cbd886a81567e daa7ff7bd32c554462e0a1502d8319cb5e734e056d0564e06596e416e2b88e9d lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll 298d33442d1054922d2f97133a436ee559f1f35b7708523284d1f7eee7ebf443 7febe38a79fadf3dcb53fb8f8caf4c2780f5df55a1f8336269c7b674d53c6272 @@ -621,7 +619,7 @@ lib/codeql/rust/elements/internal/generated/StructFieldList.qll 5da528a51a6a5db9 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf lib/codeql/rust/elements/internal/generated/StructPatFieldList.qll 1a95a1bd9f64fb18e9571657cf2d02a8b13c747048a1f0f74baf31b91f0392ad fc274e414ff4ed54386046505920de92755ad0b4d39a7523cdffa4830bd53b37 -lib/codeql/rust/elements/internal/generated/Synth.qll ef45765a8e077bc0168ec226b3b84902acd8d774cd7af637e0b1b1b16ff1deaf 58dd7076517e5d680c6d8b0489530bd8e1d15d629a233f1742cca3f028d5ec81 +lib/codeql/rust/elements/internal/generated/Synth.qll ebacd7cf6d7fb784cc77b75032608a622627e6f5e635aa70707df167ce3dc510 0e8ed9d5185afde22d263f3745e5029f23a1041690a80d0df916470823abdf43 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 bcc7f617b775ac0c7f04b1cc333ed7cc0bd91f1fabc8baa03c824d1df03f6076 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 1a3c4f5f30659738641abdd28cb793dab3cfde484196b59656fc0a2767e53511 de2ebb210c7759ef7a6f7ee9f805e1cac879221287281775fc80ba34a5492edf @@ -643,14 +641,13 @@ lib/codeql/rust/elements/internal/generated/TypeRepr.qll 1e7b9d2ddab86e35dad7c31 lib/codeql/rust/elements/internal/generated/UnderscoreExpr.qll b3780c99c5d57159bef4c6bd2fd8ec44ebd1854c892c1ca776c740f71249e58c 2fd451cbf0a779e8042e439882e7d9cadc19d1e596df3bbb086d16f2596407c7 lib/codeql/rust/elements/internal/generated/Unextracted.qll 01563dfd769d6dc3c6b8a40d9a4dc0d99a3b6a0c6725c180d2bf4d7633929a17 a93ce90f8c03f4305e59de9c63f089fc7935298fc9a73d091d76933cf63e790c lib/codeql/rust/elements/internal/generated/Unimplemented.qll a3eb304781991bff1227de1e4422b68bf91e7b344e4f6c9e874b324e82a35e60 6bc4839fda3850a56dc993b79ef9ba921008395c8432b184e14438fba4566f21 -lib/codeql/rust/elements/internal/generated/Union.qll 328d714dba5b19f8bf94c17efee21c9ca9e693a3a568a2afed3dc0d03fcc3f50 9be7039ce837a3217e97f64c8667d78e4d69e19c8fe7c19198389acb83a15957 +lib/codeql/rust/elements/internal/generated/Union.qll 456504e6a32991ba17ca65f97636f4dfb86c758c7f8509aaca1b0d0432231dfe c96068edfec3e0755a7726426a10996455ee9f0f2d678af258719f1943a3063e lib/codeql/rust/elements/internal/generated/Use.qll cf95b5c4756b25bee74113207786e37464ffbc0fb5f776a04c651300afc53753 1fe26b3904db510184cb688cb0eeb0a8dbac7ac15e27a3b572d839743c738393 lib/codeql/rust/elements/internal/generated/UseBoundGenericArg.qll 69162794e871291545ea04f61259b2d000671a96f7ca129f7dd9ed6e984067c4 31de9ebc0634b38e2347e0608b4ea888892f1f2732a2892464078cd8a07b4ee8 lib/codeql/rust/elements/internal/generated/UseBoundGenericArgs.qll 2cc8ab0068b7bf44ca17a62b32a8dd1d89cd743532c8a96b262b164fd81b0c36 347e7709a0f5ace197beb6827f6cf04a31ff68ff2dff3707914c6b910658d00a lib/codeql/rust/elements/internal/generated/UseTree.qll 3d7cbcc8ae76068b8f660c7d5b81b05595026043015cd6b4d42a60ed4c165811 b9f0bcf82feb31f31406e787670fee93e1aa0966bcc0e4cc285c342e88793e4e lib/codeql/rust/elements/internal/generated/UseTreeList.qll 38efaa569b76ca79be047703279388e8f64583a126b98078fbbb6586e0c6eb56 1623a50fd2d3b1e4b85323ad73dd655172f7cbc658d3506aaa6b409e9ebe576e -lib/codeql/rust/elements/internal/generated/Variant.qll 56ef12f3be672a467b443f8e121ba075551c88fe42dd1428e6fa7fc5affb6ec2 fd66722fd401a47305e0792458528a6af2437c97355a6a624727cf6632721a89 -lib/codeql/rust/elements/internal/generated/VariantDef.qll 3a579b21a13bdd6be8cddaa43a6aa0028a27c4e513caa003a6304e160fc53846 1ca1c41ed27660b17fbfb44b67aa8db087ea655f01bac29b57bb19fa259d07a2 +lib/codeql/rust/elements/internal/generated/Variant.qll fa6909715133049b3dba4622e6262fa30c4a9478b6219ec4fd12e07c58750709 71fc2ddac97fc4c4e6b92a13ee217cccc81dffc7c12295b6bc97c56ad25a92cc lib/codeql/rust/elements/internal/generated/VariantList.qll 3f70bfde982e5c5e8ee45da6ebe149286214f8d40377d5bc5e25df6ae8f3e2d1 22e5f428bf64fd3fd21c537bfa69a46089aad7c363d72c6566474fbe1d75859e lib/codeql/rust/elements/internal/generated/Visibility.qll af1069733c0120fae8610b3ebbcdcebe4b4c9ce4c3e3d9be3f82a93541873625 266106bdff4d7041d017871d755c011e7dd396c5999803d9e46725b6a03a2458 lib/codeql/rust/elements/internal/generated/WhereClause.qll aec72d358689d99741c769b6e8e72b92c1458138c097ec2380e917aa68119ff0 81bb9d303bc0c8d2513dc7a2b8802ec15345b364e6c1e8b300f7860aac219c36 @@ -659,7 +656,7 @@ lib/codeql/rust/elements/internal/generated/WhileExpr.qll 0353aab87c49569e1fbf58 lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll 34c5c8e6e25cce86f0617d552f788eb30ad8bb24fbc43723af962ce9cdc7d177 34c5c8e6e25cce86f0617d552f788eb30ad8bb24fbc43723af962ce9cdc7d177 +lib/codeql/rust/elements.qll 6ebcf16ef214075bc43562c246c11f8b90c089ff1b5041ab1b39ab9f4a40e9b3 6ebcf16ef214075bc43562c246c11f8b90c089ff1b5041ab1b39ab9f4a40e9b3 test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index e847ecd7644e..4339aa3dae80 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -184,7 +184,6 @@ /lib/codeql/rust/elements/UseTree.qll linguist-generated /lib/codeql/rust/elements/UseTreeList.qll linguist-generated /lib/codeql/rust/elements/Variant.qll linguist-generated -/lib/codeql/rust/elements/VariantDef.qll linguist-generated /lib/codeql/rust/elements/VariantList.qll linguist-generated /lib/codeql/rust/elements/Visibility.qll linguist-generated /lib/codeql/rust/elements/WhereClause.qll linguist-generated @@ -446,7 +445,6 @@ /lib/codeql/rust/elements/internal/UseTreeListConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/UseTreeListImpl.qll linguist-generated /lib/codeql/rust/elements/internal/VariantConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/VariantDefImpl.qll linguist-generated /lib/codeql/rust/elements/internal/VariantListConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/VariantListImpl.qll linguist-generated /lib/codeql/rust/elements/internal/VisibilityConstructor.qll linguist-generated @@ -652,7 +650,6 @@ /lib/codeql/rust/elements/internal/generated/UseTree.qll linguist-generated /lib/codeql/rust/elements/internal/generated/UseTreeList.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Variant.qll linguist-generated -/lib/codeql/rust/elements/internal/generated/VariantDef.qll linguist-generated /lib/codeql/rust/elements/internal/generated/VariantList.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Visibility.qll linguist-generated /lib/codeql/rust/elements/internal/generated/WhereClause.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index 0ae5e4a95140..cd44985675f3 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -187,7 +187,6 @@ import codeql.rust.elements.UseBoundGenericArgs import codeql.rust.elements.UseTree import codeql.rust.elements.UseTreeList import codeql.rust.elements.Variant -import codeql.rust.elements.VariantDef import codeql.rust.elements.VariantList import codeql.rust.elements.Visibility import codeql.rust.elements.WhereClause diff --git a/rust/ql/lib/codeql/rust/elements/Struct.qll b/rust/ql/lib/codeql/rust/elements/Struct.qll index 27b6a37b7913..7627f866f058 100644 --- a/rust/ql/lib/codeql/rust/elements/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/Struct.qll @@ -9,7 +9,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList import codeql.rust.elements.Name -import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility import codeql.rust.elements.WhereClause diff --git a/rust/ql/lib/codeql/rust/elements/Union.qll b/rust/ql/lib/codeql/rust/elements/Union.qll index 4bf596f4d7a4..988a1cf97997 100644 --- a/rust/ql/lib/codeql/rust/elements/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/Union.qll @@ -9,7 +9,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList -import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility import codeql.rust.elements.WhereClause diff --git a/rust/ql/lib/codeql/rust/elements/Variant.qll b/rust/ql/lib/codeql/rust/elements/Variant.qll index 5afa140923b5..dfe5199f1592 100644 --- a/rust/ql/lib/codeql/rust/elements/Variant.qll +++ b/rust/ql/lib/codeql/rust/elements/Variant.qll @@ -9,7 +9,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.Expr import codeql.rust.elements.FieldList import codeql.rust.elements.Name -import codeql.rust.elements.VariantDef import codeql.rust.elements.Visibility /** diff --git a/rust/ql/lib/codeql/rust/elements/VariantDef.qll b/rust/ql/lib/codeql/rust/elements/VariantDef.qll deleted file mode 100644 index bafb396c29da..000000000000 --- a/rust/ql/lib/codeql/rust/elements/VariantDef.qll +++ /dev/null @@ -1,9 +0,0 @@ -// generated by codegen, do not edit -/** - * This module provides the public class `VariantDef`. - */ - -private import internal.VariantDefImpl -import codeql.rust.elements.AstNode - -final class VariantDef = Impl::VariantDef; diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariantDefImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariantDefImpl.qll deleted file mode 100644 index 21ab1f20d4e8..000000000000 --- a/rust/ql/lib/codeql/rust/elements/internal/VariantDefImpl.qll +++ /dev/null @@ -1,16 +0,0 @@ -// generated by codegen, remove this comment if you wish to edit this file -/** - * This module provides a hand-modifiable wrapper around the generated class `VariantDef`. - * - * INTERNAL: Do not use. - */ - -private import codeql.rust.elements.internal.generated.VariantDef - -/** - * INTERNAL: This module contains the customizable definition of `VariantDef` and should not - * be referenced directly. - */ -module Impl { - class VariantDef extends Generated::VariantDef { } -} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index a0ccc4d728b2..8272535ff4f2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -1289,19 +1289,6 @@ private module Impl { ) } - private Element getImmediateChildOfVariantDef(VariantDef e, int index, string partialPredicateCall) { - exists(int b, int bAstNode, int n | - b = 0 and - bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and - n = bAstNode and - ( - none() - or - result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) - ) - ) - } - private Element getImmediateChildOfVariantList( VariantList e, int index, string partialPredicateCall ) { @@ -3074,14 +3061,12 @@ private module Impl { private Element getImmediateChildOfVariant(Variant e, int index, string partialPredicateCall) { exists( - int b, int bVariantDef, int bAddressable, int n, int nAttr, int nDiscriminant, int nFieldList, - int nName, int nVisibility + int b, int bAddressable, int n, int nAttr, int nDiscriminant, int nFieldList, int nName, + int nVisibility | b = 0 and - bVariantDef = - b + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and bAddressable = - bVariantDef + 1 + max(int i | i = -1 or exists(getImmediateChildOfAddressable(e, i, _)) | i) and + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAddressable(e, i, _)) | i) and n = bAddressable and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nDiscriminant = nAttr + 1 and @@ -3091,9 +3076,7 @@ private module Impl { ( none() or - result = getImmediateChildOfVariantDef(e, index - b, partialPredicateCall) - or - result = getImmediateChildOfAddressable(e, index - bVariantDef, partialPredicateCall) + result = getImmediateChildOfAddressable(e, index - b, partialPredicateCall) or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" @@ -4020,14 +4003,12 @@ private module Impl { private Element getImmediateChildOfStruct(Struct e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bVariantDef, int n, int nAttr, int nFieldList, int nGenericParamList, - int nName, int nVisibility, int nWhereClause + int b, int bAdt, int n, int nAttr, int nFieldList, int nGenericParamList, int nName, + int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - bVariantDef = - bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and - n = bVariantDef and + n = bAdt and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nFieldList = nAttr + 1 and nGenericParamList = nFieldList + 1 and @@ -4039,8 +4020,6 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) - or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" or @@ -4063,14 +4042,12 @@ private module Impl { private Element getImmediateChildOfUnion(Union e, int index, string partialPredicateCall) { exists( - int b, int bAdt, int bVariantDef, int n, int nAttr, int nGenericParamList, int nName, - int nStructFieldList, int nVisibility, int nWhereClause + int b, int bAdt, int n, int nAttr, int nGenericParamList, int nName, int nStructFieldList, + int nVisibility, int nWhereClause | b = 0 and bAdt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAdt(e, i, _)) | i) and - bVariantDef = - bAdt + 1 + max(int i | i = -1 or exists(getImmediateChildOfVariantDef(e, i, _)) | i) and - n = bVariantDef and + n = bAdt and nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and nGenericParamList = nAttr + 1 and nName = nGenericParamList + 1 and @@ -4082,8 +4059,6 @@ private module Impl { or result = getImmediateChildOfAdt(e, index - b, partialPredicateCall) or - result = getImmediateChildOfVariantDef(e, index - bAdt, partialPredicateCall) - or result = e.getAttr(index - n) and partialPredicateCall = "Attr(" + (index - n).toString() + ")" or diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 8835f4588c0c..50319f5a8f74 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -1370,11 +1370,6 @@ module Raw { UseTree getUseTree(int index) { use_tree_list_use_trees(this, index, result) } } - /** - * INTERNAL: Do not use. - */ - class VariantDef extends @variant_def, AstNode { } - /** * INTERNAL: Do not use. * A list of variants in an enum declaration. @@ -3523,7 +3518,7 @@ module Raw { * // ^ ^^^^^^ ^^^^^^^^^^^^ * ``` */ - class Variant extends @variant, VariantDef, Addressable { + class Variant extends @variant, Addressable { override string toString() { result = "Variant" } /** @@ -4607,7 +4602,7 @@ module Raw { * } * ``` */ - class Struct extends @struct, Adt, VariantDef { + class Struct extends @struct, Adt { override string toString() { result = "Struct" } /** @@ -4650,7 +4645,7 @@ module Raw { * union U { f1: u32, f2: f32 } * ``` */ - class Union extends @union, Adt, VariantDef { + class Union extends @union, Adt { override string toString() { result = "Union" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll index 8589273ff4cf..8910d2691695 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Struct.qll @@ -11,7 +11,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.FieldList import codeql.rust.elements.GenericParamList import codeql.rust.elements.Name -import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility import codeql.rust.elements.WhereClause @@ -31,7 +30,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Struct` class directly. * Use the subclass `Struct`, where the following predicates are available. */ - class Struct extends Synth::TStruct, AdtImpl::Adt, VariantDefImpl::VariantDef { + class Struct extends Synth::TStruct, AdtImpl::Adt { override string getAPrimaryQlClass() { result = "Struct" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 28300de45805..003d4fa9feb5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -727,8 +727,8 @@ module Synth { TReturnTypeSyntax or TSourceFile or TStmt or TStmtList or TStructExprField or TStructExprFieldList or TStructField or TStructPatField or TStructPatFieldList or TToken or TTokenTree or TTupleField or TTypeBound or TTypeBoundList or TTypeRepr or - TUseBoundGenericArg or TUseBoundGenericArgs or TUseTree or TUseTreeList or TVariantDef or - TVariantList or TVisibility or TWhereClause or TWherePred; + TUseBoundGenericArg or TUseBoundGenericArgs or TUseTree or TUseTreeList or TVariantList or + TVisibility or TWhereClause or TWherePred; /** * INTERNAL: Do not use. @@ -850,11 +850,6 @@ module Synth { */ class TUseBoundGenericArg = TLifetime or TNameRef; - /** - * INTERNAL: Do not use. - */ - class TVariantDef = TStruct or TUnion or TVariant; - /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TAbi`, if possible. @@ -2056,8 +2051,6 @@ module Synth { or result = convertUseTreeListFromRaw(e) or - result = convertVariantDefFromRaw(e) - or result = convertVariantListFromRaw(e) or result = convertVisibilityFromRaw(e) @@ -2453,18 +2446,6 @@ module Synth { result = convertNameRefFromRaw(e) } - /** - * INTERNAL: Do not use. - * Converts a raw DB element to a synthesized `TVariantDef`, if possible. - */ - TVariantDef convertVariantDefFromRaw(Raw::Element e) { - result = convertStructFromRaw(e) - or - result = convertUnionFromRaw(e) - or - result = convertVariantFromRaw(e) - } - /** * INTERNAL: Do not use. * Converts a synthesized `TAbi` to a raw DB element, if possible. @@ -3664,8 +3645,6 @@ module Synth { or result = convertUseTreeListToRaw(e) or - result = convertVariantDefToRaw(e) - or result = convertVariantListToRaw(e) or result = convertVisibilityToRaw(e) @@ -4060,16 +4039,4 @@ module Synth { or result = convertNameRefToRaw(e) } - - /** - * INTERNAL: Do not use. - * Converts a synthesized `TVariantDef` to a raw DB element, if possible. - */ - Raw::Element convertVariantDefToRaw(TVariantDef e) { - result = convertStructToRaw(e) - or - result = convertUnionToRaw(e) - or - result = convertVariantToRaw(e) - } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll index 88040c4ad137..e42eed69263b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Union.qll @@ -11,7 +11,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.GenericParamList import codeql.rust.elements.Name import codeql.rust.elements.StructFieldList -import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility import codeql.rust.elements.WhereClause @@ -30,7 +29,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Union` class directly. * Use the subclass `Union`, where the following predicates are available. */ - class Union extends Synth::TUnion, AdtImpl::Adt, VariantDefImpl::VariantDef { + class Union extends Synth::TUnion, AdtImpl::Adt { override string getAPrimaryQlClass() { result = "Union" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Variant.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Variant.qll index 93d4fc6a4160..7da69072953c 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Variant.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Variant.qll @@ -11,7 +11,6 @@ import codeql.rust.elements.Attr import codeql.rust.elements.Expr import codeql.rust.elements.FieldList import codeql.rust.elements.Name -import codeql.rust.elements.internal.VariantDefImpl::Impl as VariantDefImpl import codeql.rust.elements.Visibility /** @@ -30,7 +29,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Variant` class directly. * Use the subclass `Variant`, where the following predicates are available. */ - class Variant extends Synth::TVariant, VariantDefImpl::VariantDef, AddressableImpl::Addressable { + class Variant extends Synth::TVariant, AddressableImpl::Addressable { override string getAPrimaryQlClass() { result = "Variant" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/VariantDef.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/VariantDef.qll deleted file mode 100644 index 3114f03caded..000000000000 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/VariantDef.qll +++ /dev/null @@ -1,21 +0,0 @@ -// generated by codegen, do not edit -/** - * This module provides the generated definition of `VariantDef`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.elements.internal.generated.Synth -private import codeql.rust.elements.internal.generated.Raw -import codeql.rust.elements.internal.AstNodeImpl::Impl as AstNodeImpl - -/** - * INTERNAL: This module contains the fully generated definition of `VariantDef` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::VariantDef` class directly. - * Use the subclass `VariantDef`, where the following predicates are available. - */ - class VariantDef extends Synth::TVariantDef, AstNodeImpl::AstNode { } -} diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 9d208615c27d..e019447231cd 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -215,7 +215,6 @@ named_crates( | @use_bound_generic_args | @use_tree | @use_tree_list -| @variant_def | @variant_list | @visibility | @where_clause @@ -1161,12 +1160,6 @@ use_tree_list_use_trees( int use_tree: @use_tree ref ); -@variant_def = - @struct -| @union -| @variant -; - variant_lists( unique int id: @variant_list ); diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index d18b23395c01..5e953e0b5156 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -2062,7 +2062,7 @@ class _: """ -@annotate(Variant, add_bases=(Addressable,)) +@annotate(Variant, replace_bases={AstNode: Addressable}) class _: """ A variant in an enum declaration. diff --git a/rust/schema/ast.py b/rust/schema/ast.py index 32f085a4f7da..082d0647a153 100644 --- a/rust/schema/ast.py +++ b/rust/schema/ast.py @@ -41,9 +41,6 @@ class TypeRepr(AstNode, ): class UseBoundGenericArg(AstNode, ): pass -class VariantDef(AstNode, ): - pass - class Item(Stmt, ): pass @@ -628,7 +625,7 @@ class StmtList(AstNode, ): statements: list["Stmt"] | child tail_expr: optional["Expr"] | child -class Struct(Adt, Item, VariantDef, ): +class Struct(Adt, Item, ): attrs: list["Attr"] | child field_list: optional["FieldList"] | child generic_param_list: optional["GenericParamList"] | child @@ -716,7 +713,7 @@ class TypeParam(GenericParam, ): class UnderscoreExpr(Expr, ): attrs: list["Attr"] | child -class Union(Adt, Item, VariantDef, ): +class Union(Adt, Item, ): attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child name: optional["Name"] | child @@ -741,7 +738,7 @@ class UseTree(AstNode, ): class UseTreeList(AstNode, ): use_trees: list["UseTree"] | child -class Variant(VariantDef, ): +class Variant(AstNode, ): attrs: list["Attr"] | child discriminant: optional["Expr"] | child field_list: optional["FieldList"] | child From 6064622961721c4401e92133c50e706f466e4521 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 16:08:06 +0200 Subject: [PATCH 6/7] Rust: accept test changes --- rust/ql/test/extractor-tests/generated/Enum/Cargo.lock | 7 +++++++ .../generated/Enum/Enum_getDeriveMacroExpansion.expected | 0 rust/ql/test/extractor-tests/generated/Struct/Cargo.lock | 7 +++++++ .../Struct/Struct_getDeriveMacroExpansion.expected | 0 rust/ql/test/extractor-tests/generated/Union/Cargo.lock | 7 +++++++ .../generated/Union/Union_getDeriveMacroExpansion.expected | 0 .../CONSISTENCY/TypeInferenceConsistency.expected | 2 ++ 7 files changed, 23 insertions(+) create mode 100644 rust/ql/test/extractor-tests/generated/Enum/Cargo.lock create mode 100644 rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.expected create mode 100644 rust/ql/test/extractor-tests/generated/Struct/Cargo.lock create mode 100644 rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.expected create mode 100644 rust/ql/test/extractor-tests/generated/Union/Cargo.lock create mode 100644 rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.expected create mode 100644 rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/TypeInferenceConsistency.expected diff --git a/rust/ql/test/extractor-tests/generated/Enum/Cargo.lock b/rust/ql/test/extractor-tests/generated/Enum/Cargo.lock new file mode 100644 index 000000000000..b9856cfaf77d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Enum/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "test" +version = "0.0.1" diff --git a/rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.expected b/rust/ql/test/extractor-tests/generated/Enum/Enum_getDeriveMacroExpansion.expected new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/rust/ql/test/extractor-tests/generated/Struct/Cargo.lock b/rust/ql/test/extractor-tests/generated/Struct/Cargo.lock new file mode 100644 index 000000000000..b9856cfaf77d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Struct/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "test" +version = "0.0.1" diff --git a/rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.expected b/rust/ql/test/extractor-tests/generated/Struct/Struct_getDeriveMacroExpansion.expected new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/rust/ql/test/extractor-tests/generated/Union/Cargo.lock b/rust/ql/test/extractor-tests/generated/Union/Cargo.lock new file mode 100644 index 000000000000..b9856cfaf77d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Union/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "test" +version = "0.0.1" diff --git a/rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.expected b/rust/ql/test/extractor-tests/generated/Union/Union_getDeriveMacroExpansion.expected new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/TypeInferenceConsistency.expected b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/TypeInferenceConsistency.expected new file mode 100644 index 000000000000..416404c2bd19 --- /dev/null +++ b/rust/ql/test/extractor-tests/macro-expansion/CONSISTENCY/TypeInferenceConsistency.expected @@ -0,0 +1,2 @@ +illFormedTypeMention +| macro_expansion.rs:99:7:99:19 | MyDeriveUnion | From c22526e9d0af91f4e85acc2650380af42119c53d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 20 Jun 2025 16:17:22 +0200 Subject: [PATCH 7/7] Rust: add upgrade/downgrade scripts --- .../old.dbscheme | 3620 +++++++++++++++++ .../rust.dbscheme | 3616 ++++++++++++++++ .../upgrade.properties | 4 + .../old.dbscheme | 3616 ++++++++++++++++ .../rust.dbscheme | 3620 +++++++++++++++++ .../upgrade.properties | 2 + 6 files changed, 14478 insertions(+) create mode 100644 rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/old.dbscheme create mode 100644 rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/rust.dbscheme create mode 100644 rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/upgrade.properties create mode 100644 rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/old.dbscheme create mode 100644 rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/rust.dbscheme create mode 100644 rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/upgrade.properties diff --git a/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/old.dbscheme b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/old.dbscheme new file mode 100644 index 000000000000..e019447231cd --- /dev/null +++ b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/old.dbscheme @@ -0,0 +1,3620 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_block_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @adt +| @const +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @trait +| @trait_alias +| @type_alias +| @use +; + +#keyset[id] +item_attribute_macro_expansions( + int id: @item ref, + int attribute_macro_expansion: @macro_items ref +); + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_block_exprs( + unique int id: @macro_block_expr +); + +#keyset[id] +macro_block_expr_tail_exprs( + int id: @macro_block_expr ref, + int tail_expr: @expr ref +); + +#keyset[id, index] +macro_block_expr_statements( + int id: @macro_block_expr ref, + int index: int ref, + int statement: @stmt ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +@adt = + @enum +| @struct +| @union +; + +#keyset[id, index] +adt_derive_macro_expansions( + int id: @adt ref, + int index: int ref, + int derive_macro_expansion: @macro_items ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +#keyset[id] +const_has_implementation( + int id: @const ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +#keyset[id] +function_has_implementation( + int id: @function ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_macro_call_expansions( + int id: @macro_call ref, + int macro_call_expansion: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/rust.dbscheme b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/rust.dbscheme new file mode 100644 index 000000000000..aa9a0bda17c7 --- /dev/null +++ b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/rust.dbscheme @@ -0,0 +1,3616 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_block_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +#keyset[id] +item_attribute_macro_expansions( + int id: @item ref, + int attribute_macro_expansion: @macro_items ref +); + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_block_exprs( + unique int id: @macro_block_expr +); + +#keyset[id] +macro_block_expr_tail_exprs( + int id: @macro_block_expr ref, + int tail_expr: @expr ref +); + +#keyset[id, index] +macro_block_expr_statements( + int id: @macro_block_expr ref, + int index: int ref, + int statement: @stmt ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +#keyset[id] +const_has_implementation( + int id: @const ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +#keyset[id] +function_has_implementation( + int id: @function ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_macro_call_expansions( + int id: @macro_call ref, + int macro_call_expansion: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/upgrade.properties b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/upgrade.properties new file mode 100644 index 000000000000..8ea80a9f7fe9 --- /dev/null +++ b/rust/downgrades/e019447231cd93c23ecd173ea5f82e7f9ff54ece/upgrade.properties @@ -0,0 +1,4 @@ +description: Remove `adt_derive_macro_expansions` +compatibility: partial + +adt_derive_macro_expansions.rel: delete diff --git a/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/old.dbscheme b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/old.dbscheme new file mode 100644 index 000000000000..aa9a0bda17c7 --- /dev/null +++ b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/old.dbscheme @@ -0,0 +1,3616 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_block_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +#keyset[id] +item_attribute_macro_expansions( + int id: @item ref, + int attribute_macro_expansion: @macro_items ref +); + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_block_exprs( + unique int id: @macro_block_expr +); + +#keyset[id] +macro_block_expr_tail_exprs( + int id: @macro_block_expr ref, + int tail_expr: @expr ref +); + +#keyset[id, index] +macro_block_expr_statements( + int id: @macro_block_expr ref, + int index: int ref, + int statement: @stmt ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +#keyset[id] +const_has_implementation( + int id: @const ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +#keyset[id] +function_has_implementation( + int id: @function ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_macro_call_expansions( + int id: @macro_call ref, + int macro_call_expansion: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/rust.dbscheme b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/rust.dbscheme new file mode 100644 index 000000000000..e019447231cd --- /dev/null +++ b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/rust.dbscheme @@ -0,0 +1,3620 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_block_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @adt +| @const +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @trait +| @trait_alias +| @type_alias +| @use +; + +#keyset[id] +item_attribute_macro_expansions( + int id: @item ref, + int attribute_macro_expansion: @macro_items ref +); + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_block_exprs( + unique int id: @macro_block_expr +); + +#keyset[id] +macro_block_expr_tail_exprs( + int id: @macro_block_expr ref, + int tail_expr: @expr ref +); + +#keyset[id, index] +macro_block_expr_statements( + int id: @macro_block_expr ref, + int index: int ref, + int statement: @stmt ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +@adt = + @enum +| @struct +| @union +; + +#keyset[id, index] +adt_derive_macro_expansions( + int id: @adt ref, + int index: int ref, + int derive_macro_expansion: @macro_items ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +#keyset[id] +const_has_implementation( + int id: @const ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +#keyset[id] +function_has_implementation( + int id: @function ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_macro_call_expansions( + int id: @macro_call ref, + int macro_call_expansion: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/upgrade.properties b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/upgrade.properties new file mode 100644 index 000000000000..a8b770728ac5 --- /dev/null +++ b/rust/ql/lib/upgrades/aa9a0bda17c76b804ad9e108d43da15f6beaf2a7/upgrade.properties @@ -0,0 +1,2 @@ +description: Add `adt_derive_macro_expansions` +compatibility: backwards