diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index b404b2e7541c..91107f6e045f 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 7cdfedcd68cf8e41134daf810c1af78624082b0c3e8be6570339b1a69a5d457e 7cdfedcd68cf8e41134daf810c1af78624082b0c3e8be6570339b1a69a5d457e -top.rs 7150acaeab0b57039ca9f2ed20311229aab5fd48b533f13410ecc34fd8e3bda0 7150acaeab0b57039ca9f2ed20311229aab5fd48b533f13410ecc34fd8e3bda0 +top.rs d15c72bcdaa924633a725a2324446686e0f4caaa6a4ae759a101ef31174131a5 d15c72bcdaa924633a725a2324446686e0f4caaa6a4ae759a101ef31174131a5 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index de6d2106c1d7..7304c89bab2a 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -5,6 +5,21 @@ use crate::trap::{TrapId, TrapEntry}; use codeql_extractor::trap; +#[derive(Debug)] +pub struct GenericArgList { + pub id: TrapId, +} + +impl TrapEntry for GenericArgList { + fn extract_id(&mut self) -> TrapId { + std::mem::replace(&mut self.id, TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("generic_arg_lists", vec![trap::Arg::Label(id)]); + } +} + #[derive(Debug)] pub struct Label { pub id: TrapId, @@ -43,36 +58,51 @@ impl TrapEntry for MatchArm { } #[derive(Debug)] -pub struct RecordFieldPat { +pub struct Path { pub id: TrapId, - pub name: String, - pub pat: trap::Label, } -impl TrapEntry for RecordFieldPat { +impl TrapEntry for Path { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("record_field_pats", vec![trap::Arg::Label(id), self.name.into(), self.pat.into()]); + out.add_tuple("paths", vec![trap::Arg::Label(id)]); } } #[derive(Debug)] -pub struct RecordLitField { +pub struct RecordExprField { pub id: TrapId, pub name: String, pub expr: trap::Label, } -impl TrapEntry for RecordLitField { +impl TrapEntry for RecordExprField { + fn extract_id(&mut self) -> TrapId { + std::mem::replace(&mut self.id, TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("record_expr_fields", vec![trap::Arg::Label(id), self.name.into(), self.expr.into()]); + } +} + +#[derive(Debug)] +pub struct RecordPatField { + pub id: TrapId, + pub name: String, + pub pat: trap::Label, +} + +impl TrapEntry for RecordPatField { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("record_lit_fields", vec![trap::Arg::Label(id), self.name.into(), self.expr.into()]); + out.add_tuple("record_pat_fields", vec![trap::Arg::Label(id), self.name.into(), self.pat.into()]); } } @@ -92,17 +122,18 @@ impl TrapEntry for TypeRef { } #[derive(Debug)] -pub struct Unimplemented { +pub struct AsmExpr { pub id: TrapId, + pub expr: trap::Label, } -impl TrapEntry for Unimplemented { +impl TrapEntry for AsmExpr { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("unimplementeds", vec![trap::Arg::Label(id)]); + out.add_tuple("asm_exprs", vec![trap::Arg::Label(id), self.expr.into()]); } } @@ -139,42 +170,22 @@ impl TrapEntry for BecomeExpr { } #[derive(Debug)] -pub struct BinaryOpExpr { +pub struct BinaryExpr { pub id: TrapId, pub lhs: trap::Label, pub rhs: trap::Label, pub op: Option, } -impl TrapEntry for BinaryOpExpr { +impl TrapEntry for BinaryExpr { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("binary_op_exprs", vec![trap::Arg::Label(id), self.lhs.into(), self.rhs.into()]); + out.add_tuple("binary_exprs", vec![trap::Arg::Label(id), self.lhs.into(), self.rhs.into()]); if let Some(v) = self.op { - out.add_tuple("binary_op_expr_ops", vec![trap::Arg::Label(id), v.into()]); - } - } -} - -#[derive(Debug)] -pub struct BindPat { - pub id: TrapId, - pub binding_id: String, - pub subpat: Option, -} - -impl TrapEntry for BindPat { - fn extract_id(&mut self) -> TrapId { - std::mem::replace(&mut self.id, TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("bind_pats", vec![trap::Arg::Label(id), self.binding_id.into()]); - if let Some(v) = self.subpat { - out.add_tuple("bind_pat_subpats", vec![trap::Arg::Label(id), v.into()]); + out.add_tuple("binary_expr_ops", vec![trap::Arg::Label(id), v.into()]); } } } @@ -262,7 +273,7 @@ impl TrapEntry for CallExpr { pub struct CastExpr { pub id: TrapId, pub expr: trap::Label, - pub type_ref: trap::Label, + pub type_: trap::Label, } impl TrapEntry for CastExpr { @@ -271,7 +282,7 @@ impl TrapEntry for CastExpr { } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("cast_exprs", vec![trap::Arg::Label(id), self.expr.into(), self.type_ref.into()]); + out.add_tuple("cast_exprs", vec![trap::Arg::Label(id), self.expr.into(), self.type_.into()]); } } @@ -415,6 +426,26 @@ impl TrapEntry for Function { } } +#[derive(Debug)] +pub struct IdentPat { + pub id: TrapId, + pub binding_id: String, + pub subpat: Option, +} + +impl TrapEntry for IdentPat { + fn extract_id(&mut self) -> TrapId { + std::mem::replace(&mut self.id, TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("ident_pats", vec![trap::Arg::Label(id), self.binding_id.into()]); + if let Some(v) = self.subpat { + out.add_tuple("ident_pat_subpats", vec![trap::Arg::Label(id), v.into()]); + } + } +} + #[derive(Debug)] pub struct IfExpr { pub id: TrapId, @@ -457,22 +488,6 @@ impl TrapEntry for IndexExpr { } } -#[derive(Debug)] -pub struct InlineAsmExpr { - pub id: TrapId, - pub expr: trap::Label, -} - -impl TrapEntry for InlineAsmExpr { - fn extract_id(&mut self) -> TrapId { - std::mem::replace(&mut self.id, TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("inline_asm_exprs", vec![trap::Arg::Label(id), self.expr.into()]); - } -} - #[derive(Debug)] pub struct ItemStmt { pub id: TrapId, @@ -509,7 +524,7 @@ impl TrapEntry for LetExpr { pub struct LetStmt { pub id: TrapId, pub pat: trap::Label, - pub type_ref: Option, + pub type_: Option, pub initializer: Option, pub else_: Option, } @@ -521,8 +536,8 @@ impl TrapEntry for LetStmt { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("let_stmts", vec![trap::Arg::Label(id), self.pat.into()]); - if let Some(v) = self.type_ref { - out.add_tuple("let_stmt_type_refs", vec![trap::Arg::Label(id), v.into()]); + if let Some(v) = self.type_ { + out.add_tuple("let_stmt_types", vec![trap::Arg::Label(id), v.into()]); } if let Some(v) = self.initializer { out.add_tuple("let_stmt_initializers", vec![trap::Arg::Label(id), v.into()]); @@ -534,33 +549,33 @@ impl TrapEntry for LetStmt { } #[derive(Debug)] -pub struct LitPat { +pub struct LiteralExpr { pub id: TrapId, - pub expr: trap::Label, } -impl TrapEntry for LitPat { +impl TrapEntry for LiteralExpr { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("lit_pats", vec![trap::Arg::Label(id), self.expr.into()]); + out.add_tuple("literal_exprs", vec![trap::Arg::Label(id)]); } } #[derive(Debug)] -pub struct LiteralExpr { +pub struct LiteralPat { pub id: TrapId, + pub expr: trap::Label, } -impl TrapEntry for LiteralExpr { +impl TrapEntry for LiteralPat { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("literal_exprs", vec![trap::Arg::Label(id)]); + out.add_tuple("literal_pats", vec![trap::Arg::Label(id), self.expr.into()]); } } @@ -749,6 +764,23 @@ impl TrapEntry for PathPat { } } +#[derive(Debug)] +pub struct PrefixExpr { + pub id: TrapId, + pub expr: trap::Label, + pub op: String, +} + +impl TrapEntry for PrefixExpr { + fn extract_id(&mut self) -> TrapId { + std::mem::replace(&mut self.id, TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("prefix_exprs", vec![trap::Arg::Label(id), self.expr.into(), self.op.into()]); + } +} + #[derive(Debug)] pub struct RangeExpr { pub id: TrapId, @@ -800,36 +832,36 @@ impl TrapEntry for RangePat { } #[derive(Debug)] -pub struct RecordLitExpr { +pub struct RecordExpr { pub id: TrapId, pub path: Option, - pub fields: Vec, + pub flds: Vec, pub spread: Option, pub has_ellipsis: bool, pub is_assignee_expr: bool, } -impl TrapEntry for RecordLitExpr { +impl TrapEntry for RecordExpr { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("record_lit_exprs", vec![trap::Arg::Label(id)]); + out.add_tuple("record_exprs", vec![trap::Arg::Label(id)]); if let Some(v) = self.path { - out.add_tuple("record_lit_expr_paths", vec![trap::Arg::Label(id), v.into()]); + out.add_tuple("record_expr_paths", vec![trap::Arg::Label(id), v.into()]); } - for (i, v) in self.fields.into_iter().enumerate() { - out.add_tuple("record_lit_expr_fields", vec![trap::Arg::Label(id), i.into(), v.into()]); + for (i, v) in self.flds.into_iter().enumerate() { + out.add_tuple("record_expr_flds", vec![trap::Arg::Label(id), i.into(), v.into()]); } if let Some(v) = self.spread { - out.add_tuple("record_lit_expr_spreads", vec![trap::Arg::Label(id), v.into()]); + out.add_tuple("record_expr_spreads", vec![trap::Arg::Label(id), v.into()]); } if self.has_ellipsis { - out.add_tuple("record_lit_expr_has_ellipsis", vec![trap::Arg::Label(id)]); + out.add_tuple("record_expr_has_ellipsis", vec![trap::Arg::Label(id)]); } if self.is_assignee_expr { - out.add_tuple("record_lit_expr_is_assignee_expr", vec![trap::Arg::Label(id)]); + out.add_tuple("record_expr_is_assignee_expr", vec![trap::Arg::Label(id)]); } } } @@ -838,7 +870,7 @@ impl TrapEntry for RecordLitExpr { pub struct RecordPat { pub id: TrapId, pub path: Option, - pub args: Vec, + pub flds: Vec, pub has_ellipsis: bool, } @@ -852,8 +884,8 @@ impl TrapEntry for RecordPat { if let Some(v) = self.path { out.add_tuple("record_pat_paths", vec![trap::Arg::Label(id), v.into()]); } - for (i, v) in self.args.into_iter().enumerate() { - out.add_tuple("record_pat_args", vec![trap::Arg::Label(id), i.into(), v.into()]); + for (i, v) in self.flds.into_iter().enumerate() { + out.add_tuple("record_pat_flds", vec![trap::Arg::Label(id), i.into(), v.into()]); } if self.has_ellipsis { out.add_tuple("record_pat_has_ellipsis", vec![trap::Arg::Label(id)]); @@ -1025,49 +1057,47 @@ impl TrapEntry for TupleStructPat { } #[derive(Debug)] -pub struct UnaryOpExpr { +pub struct UnderscoreExpr { pub id: TrapId, - pub expr: trap::Label, - pub op: String, } -impl TrapEntry for UnaryOpExpr { +impl TrapEntry for UnderscoreExpr { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("unary_op_exprs", vec![trap::Arg::Label(id), self.expr.into(), self.op.into()]); + out.add_tuple("underscore_exprs", vec![trap::Arg::Label(id)]); } } #[derive(Debug)] -pub struct UnderscoreExpr { +pub struct UnimplementedDeclaration { pub id: TrapId, } -impl TrapEntry for UnderscoreExpr { +impl TrapEntry for UnimplementedDeclaration { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("underscore_exprs", vec![trap::Arg::Label(id)]); + out.add_tuple("unimplemented_declarations", vec![trap::Arg::Label(id)]); } } #[derive(Debug)] -pub struct WildPat { +pub struct WildcardPat { pub id: TrapId, } -impl TrapEntry for WildPat { +impl TrapEntry for WildcardPat { fn extract_id(&mut self) -> TrapId { std::mem::replace(&mut self.id, TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("wild_pats", vec![trap::Arg::Label(id)]); + out.add_tuple("wildcard_pats", vec![trap::Arg::Label(id)]); } } diff --git a/rust/extractor/src/main.rs b/rust/extractor/src/main.rs index caac7d1243aa..8d1bcc98ab6c 100644 --- a/rust/extractor/src/main.rs +++ b/rust/extractor/src/main.rs @@ -65,6 +65,9 @@ fn main() -> anyhow::Result<()> { let crates = ::crate_graph(&db); for crate_id in crates.iter() { let krate = Crate::from(crate_id); + if !cfg.extract_dependencies && !krate.origin(&db).is_local() { + continue; + } let name = krate.display_name(&db); let crate_name = name .as_ref() @@ -78,16 +81,9 @@ fn main() -> anyhow::Result<()> { crate_id.into_raw().into_u32() )), ); - translate::CrateTranslator::new( - &db, - trap, - &krate, - &vfs, - &archiver, - cfg.extract_dependencies, - ) - .emit_crate() - .context("writing trap file")?; + translate::CrateTranslator::new(&db, trap, &krate, &vfs, &archiver) + .emit_crate() + .context("writing trap file")?; } } Ok(()) diff --git a/rust/extractor/src/translate.rs b/rust/extractor/src/translate.rs index b794a1dd5fbd..94232fdd7936 100644 --- a/rust/extractor/src/translate.rs +++ b/rust/extractor/src/translate.rs @@ -32,7 +32,6 @@ pub struct CrateTranslator<'a> { krate: &'a Crate, vfs: &'a Vfs, archiver: &'a Archiver, - extract_dependencies: bool, file_labels: HashMap, } @@ -43,7 +42,6 @@ impl CrateTranslator<'_> { krate: &'a Crate, vfs: &'a Vfs, archiver: &'a Archiver, - extract_dependencies: bool, ) -> CrateTranslator<'a> { CrateTranslator { db, @@ -51,7 +49,6 @@ impl CrateTranslator<'_> { krate, vfs, archiver, - extract_dependencies, file_labels: HashMap::new(), } } @@ -78,15 +75,15 @@ impl CrateTranslator<'_> { ) where T: AstNode, { - source + if let Some(data) = source .file_id .file_id() .map(|f| f.file_id()) .and_then(|file_id| self.emit_file(file_id)) - .map(|data| { - let range = source.value.text_range(); - self.emit_location_for_textrange(label, data, range) - }); + { + let range = source.value.text_range(); + self.emit_location_for_textrange(label, data, range) + } } fn emit_location_for_expr( @@ -116,14 +113,17 @@ impl CrateTranslator<'_> { pat: &ra_ap_hir_def::hir::LiteralOrConst, body: &Body, source_map: &BodySourceMap, + mut emit_location: impl FnMut(&mut CrateTranslator<'_>, trap::Label), ) -> trap::Label { match pat { ra_ap_hir_def::hir::LiteralOrConst::Literal(_literal) => { let expr = self.trap.emit(generated::LiteralExpr { id: TrapId::Star }); - self.trap.emit(generated::LitPat { + let label = self.trap.emit(generated::LiteralPat { id: TrapId::Star, expr, - }) + }); + emit_location(self, label); + label } ra_ap_hir_def::hir::LiteralOrConst::Const(inner) => { self.emit_pat(*inner, body, source_map) @@ -147,14 +147,14 @@ impl CrateTranslator<'_> { where T::Ast: AstNode, { - entity + if let Some((data, source)) = entity .source(self.db) .and_then(|source| source.file_id.file_id().map(|f| (f.file_id(), source))) .and_then(|(file_id, source)| self.emit_file(file_id).map(|data| (data, source))) - .map(|(data, source)| { - let range = source.value.syntax().text_range(); - self.emit_location_for_textrange(label, data, range); - }); + { + let range = source.value.syntax().text_range(); + self.emit_location_for_textrange(label, data, range); + } } fn emit_location_for_textrange( &mut self, @@ -186,12 +186,8 @@ impl CrateTranslator<'_> { ret } - fn emit_unimplemented(&mut self) -> trap::Label { - self.trap - .emit(generated::Unimplemented { id: TrapId::Star }) - } fn emit_path(&mut self, _path: &Path) -> trap::Label { - self.emit_unimplemented() + self.trap.emit(generated::Path { id: TrapId::Star }) } fn emit_record_field_pat( @@ -202,7 +198,7 @@ impl CrateTranslator<'_> { ) -> trap::Label { let RecordFieldPat { name, pat } = field_pat; let pat_label = self.emit_pat(*pat, body, source_map); - let ret = self.trap.emit(generated::RecordFieldPat { + let ret = self.trap.emit(generated::RecordPatField { id: TrapId::Star, name: name.as_str().into(), pat: pat_label, @@ -219,7 +215,7 @@ impl CrateTranslator<'_> { ) -> trap::Label { let RecordLitField { name, expr } = field_expr; let expr_label = self.emit_expr(*expr, body, source_map); - let ret = self.trap.emit(generated::RecordLitField { + let ret = self.trap.emit(generated::RecordExprField { id: TrapId::Star, name: name.as_str().into(), expr: expr_label, @@ -234,7 +230,7 @@ impl CrateTranslator<'_> { self.trap.emit(generated::MissingPat { id: TrapId::Star }) } ra_ap_hir_def::hir::Pat::Wild => { - self.trap.emit(generated::WildPat { id: TrapId::Star }) + self.trap.emit(generated::WildcardPat { id: TrapId::Star }) } ra_ap_hir_def::hir::Pat::Tuple { args, ellipsis } => { let args = args @@ -264,24 +260,31 @@ impl CrateTranslator<'_> { ellipsis, } => { let path = path.as_ref().map(|path| self.emit_path(path)); - let args = args + if let Some(p) = path { + self.emit_location_for_pat(p, pat_id, source_map) + } + let flds = args .into_iter() .map(|arg| self.emit_record_field_pat(arg, body, source_map)) .collect(); self.trap.emit(generated::RecordPat { id: TrapId::Star, path, - args, + flds, has_ellipsis: *ellipsis, }) } ra_ap_hir_def::hir::Pat::Range { start, end } => { - let start = start - .as_ref() - .map(|x| self.emit_literal_or_const_pat(x, body, source_map)); - let end = end - .as_ref() - .map(|x| self.emit_literal_or_const_pat(x, body, source_map)); + let emit_location_for_const = |trans: &mut CrateTranslator<'_>, label| { + trans.emit_location_for_pat(label, pat_id, source_map) + }; + let start = start.as_ref().map(|x| { + self.emit_literal_or_const_pat(x, body, source_map, emit_location_for_const) + }); + + let end = end.as_ref().map(|x| { + self.emit_literal_or_const_pat(x, body, source_map, emit_location_for_const) + }); self.trap.emit(generated::RangePat { id: TrapId::Star, start, @@ -311,6 +314,8 @@ impl CrateTranslator<'_> { } ra_ap_hir_def::hir::Pat::Path(path) => { let path = self.emit_path(path); + self.emit_location_for_pat(path, pat_id, source_map); + self.trap.emit(generated::PathPat { id: TrapId::Star, path, @@ -318,14 +323,14 @@ impl CrateTranslator<'_> { } ra_ap_hir_def::hir::Pat::Lit(expr) => { let expr = self.emit_expr(*expr, body, source_map); - self.trap.emit(generated::LitPat { + self.trap.emit(generated::LiteralPat { id: TrapId::Star, expr, }) } ra_ap_hir_def::hir::Pat::Bind { id, subpat } => { let subpat = subpat.map(|pat| self.emit_pat(pat, body, source_map)); - self.trap.emit(generated::BindPat { + self.trap.emit(generated::IdentPat { id: TrapId::Star, subpat, binding_id: body.bindings[*id].name.as_str().into(), @@ -337,6 +342,10 @@ impl CrateTranslator<'_> { ellipsis, } => { let path = path.as_ref().map(|path| self.emit_path(path)); + if let Some(p) = path { + self.emit_location_for_pat(p, pat_id, source_map) + } + let args = args .into_iter() .map(|arg| self.emit_pat(*arg, body, source_map)) @@ -375,7 +384,7 @@ impl CrateTranslator<'_> { ret } fn emit_type_ref(&mut self, _type_ref: &TypeRef) -> trap::Label { - self.emit_unimplemented() + self.trap.emit(generated::TypeRef { id: TrapId::Star }) } fn emit_match_arm( &mut self, @@ -409,7 +418,7 @@ impl CrateTranslator<'_> { else_branch, } => { let pat_label = self.emit_pat(*pat, body, source_map); - let type_ref = type_ref + let type_ = type_ref .as_ref() .map(|type_ref| self.emit_type_ref(type_ref)); let initializer = @@ -419,7 +428,7 @@ impl CrateTranslator<'_> { let ret = self.trap.emit(generated::LetStmt { id: TrapId::Star, pat: pat_label, - type_ref, + type_, initializer, else_, }); @@ -454,6 +463,8 @@ impl CrateTranslator<'_> { } ra_ap_hir_def::hir::Expr::Path(path) => { let path = self.emit_path(path); + self.emit_location_for_expr(path, expr_id, source_map); + self.trap.emit(generated::PathExpr { id: TrapId::Star, path, @@ -582,7 +593,10 @@ impl CrateTranslator<'_> { .into_iter() .map(|e| self.emit_expr(*e, body, source_map)) .collect(); - let generic_args = generic_args.as_ref().map(|_args| self.emit_unimplemented()); + let generic_args = generic_args.as_ref().map(|_args| { + self.trap + .emit(generated::GenericArgList { id: TrapId::Star }) + }); self.trap.emit(generated::MethodCallExpr { id: TrapId::Star, receiver, @@ -656,15 +670,19 @@ impl CrateTranslator<'_> { is_assignee_expr, } => { let path = path.as_ref().map(|path| self.emit_path(path)); - let fields = fields + if let Some(p) = path { + self.emit_location_for_expr(p, expr_id, source_map) + } + + let flds = fields .into_iter() .map(|field| self.emit_record_lit_field(field, body, source_map)) .collect(); let spread = spread.map(|expr_id| self.emit_expr(expr_id, body, source_map)); - self.trap.emit(generated::RecordLitExpr { + self.trap.emit(generated::RecordExpr { id: TrapId::Star, path, - fields, + flds, spread, has_ellipsis: *ellipsis, is_assignee_expr: *is_assignee_expr, @@ -687,11 +705,11 @@ impl CrateTranslator<'_> { } ra_ap_hir_def::hir::Expr::Cast { expr, type_ref } => { let expr: trap::Label = self.emit_expr(*expr, body, source_map); - let type_ref: trap::Label = self.emit_type_ref(type_ref.as_ref()); + let type_: trap::Label = self.emit_type_ref(type_ref.as_ref()); self.trap.emit(generated::CastExpr { id: TrapId::Star, expr, - type_ref, + type_, }) } ra_ap_hir_def::hir::Expr::Ref { @@ -721,7 +739,7 @@ impl CrateTranslator<'_> { ra_ap_syntax::ast::UnaryOp::Not => "!", ra_ap_syntax::ast::UnaryOp::Neg => "-", }; - self.trap.emit(generated::UnaryOpExpr { + self.trap.emit(generated::PrefixExpr { id: TrapId::Star, expr, op: op.into(), @@ -731,7 +749,7 @@ impl CrateTranslator<'_> { let lhs = self.emit_expr(*lhs, body, source_map); let rhs = self.emit_expr(*rhs, body, source_map); let op = op.map(|op| format!("{op}")); - self.trap.emit(generated::BinaryOpExpr { + self.trap.emit(generated::BinaryExpr { id: TrapId::Star, lhs, rhs, @@ -858,7 +876,7 @@ impl CrateTranslator<'_> { } ra_ap_hir_def::hir::Expr::InlineAsm(asm) => { let expr = self.emit_expr(asm.e, body, source_map); - self.trap.emit(generated::InlineAsmExpr { + self.trap.emit(generated::AsmExpr { id: TrapId::Star, expr, }) @@ -874,75 +892,89 @@ impl CrateTranslator<'_> { id: ModuleDef, labels: &mut Vec, ) { - let _label = match id { - ModuleDef::Module(_) => self.emit_unimplemented(), + let label = match id { + ModuleDef::Module(_module) => self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }), ModuleDef::Function(function) => { let def: ra_ap_hir::DefWithBody = function.into(); let name = function.name(self.db); - let body = if self.extract_dependencies || self.krate.origin(self.db).is_local() { - let (body, source_map) = self.db.body_with_source_map(def.into()); - let txt = body.pretty_print(self.db, def.into(), Edition::Edition2021); - log::trace!("{}", &txt); - self.emit_expr(body.body_expr, &body, &source_map) - } else { - self.trap.emit(generated::MissingExpr { id: TrapId::Star }) - }; + let (body, source_map) = self.db.body_with_source_map(def.into()); + let txt = body.pretty_print(self.db, def.into(), Edition::Edition2021); + log::trace!("{}", &txt); + let body = self.emit_expr(body.body_expr, &body, &source_map); + let label = self.trap.emit(generated::Function { id: trap_key![module_label, name.as_str()], name: name.as_str().into(), body, }); self.emit_location(label, function); - // TODO: move this below to add all to module children. For now this causes a - // DB inconsistency - labels.push(label); label } ModuleDef::Adt(adt) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, adt); label } ModuleDef::Variant(variant) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, variant); label } ModuleDef::Const(const_) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, const_); label } ModuleDef::Static(static_) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, static_); label } ModuleDef::Trait(trait_) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, trait_); label } ModuleDef::TraitAlias(alias) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, alias); label } ModuleDef::TypeAlias(type_alias) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, type_alias); label } - ModuleDef::BuiltinType(_builtin_type) => self.emit_unimplemented(), + ModuleDef::BuiltinType(_builtin_type) => self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }), ModuleDef::Macro(macro_) => { - let label = self.emit_unimplemented(); + let label = self + .trap + .emit(generated::UnimplementedDeclaration { id: TrapId::Star }); self.emit_location(label, macro_); label } }; - //TODO: labels.push(label) for all, not just functions + labels.push(label); } fn emit_module(&mut self, label: trap::Label, module: Module) { diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index cc88ed815049..3c6334648d55 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -1,212 +1,323 @@ -lib/codeql/rust/elements/ArrayExpr.qll aa558ac94bb7c45145e4788ed1a92e2873c5f57f1a0c7b7faf341f40027cf455 874da62a3d6467af7ae11045229135f8f5229cff33f3edae5b01a5b9afe86dd7 +lib/codeql/rust/elements/ArrayExpr.qll 822b7dea414d3948f15ee89a014d9ab5ab857db59d8eba7ade8ceed3b453bba4 fb0fc738da8142e8226d99db5ccc1006458bf50f1a95699cbd3012d0917db196 +lib/codeql/rust/elements/AsmExpr.qll 825f9aad83cb4f40cf25ff2da0bb6bf4c7e2b469443f7a8902a994c89d134e38 24212a120cb55658a621085d4e1a3fa611ca9ba742784c772e2e1d353e73783d +lib/codeql/rust/elements/AsmExprConstructor.qll 2b81ea1b0df1171f990e30f074cf8bbccfe7cfd775a746d48e09c60d5d5c8e04 e427132d2731a703ebe047a5e81559813ed4cd055aaf3a0f1221eeb76247ad6a lib/codeql/rust/elements/AstNode.qll 2069047c779514867c12d845dcdf889db6f27fa6a9e484966a3c28a77973b7d4 e214616c81418b0018c0d36896ac2ec7273634e3213bc8257d8b172f396c00ee -lib/codeql/rust/elements/AsyncBlockExpr.qll ce6484a28403bc36e261ae6931b02a15db6fc54cc0c1bfc441e33d7284f6c74a e5b3c00f74543a6ceeaef053aaa1f00006026b8242efbeb7e1e9633e68cc4844 +lib/codeql/rust/elements/AsyncBlockExpr.qll 7cc9709af8c5f844fd6bf6d4cf49e245d19a0ab6d73ef69e84888a4a9b8e47ce 2f9ede385321df47d2e4ac1297d07be987ff53a576a8dded9a615ad83fba6de3 lib/codeql/rust/elements/AsyncBlockExprConstructor.qll 2d7d22caca1984e850d723f9ddd581530734bf4c31c545ea598bc27144a32f1b bf2ff9edff95db8400017b7583d6881581c431755c70e0068a495787993010f9 -lib/codeql/rust/elements/AwaitExpr.qll 310cf2cf155bc472caed76f596d7f789e9fa19c24d73dc0235d601ff9f32de40 d4b53d79a12d4378eebe2211b37b0f819177620b86a3eabfbec4096adfd200c4 +lib/codeql/rust/elements/AwaitExpr.qll da0f5928cfee39223c48b74b1921d18c39cc4f8ce7c2189342fb6e8e79c76985 e72e2cf142058fa93143acf9dc4c420572a234b4d4f11155567a7184e9152257 lib/codeql/rust/elements/AwaitExprConstructor.qll af0dfdf36b300d412a7b8668f68e6594fe3338216cdf1aa420c9a58608aa86f5 cfa115902ccf070e34ee451bc2f89295c97e8418501359a8cdc646d16c4cc7cd -lib/codeql/rust/elements/BecomeExpr.qll 91e08545258ff3bed8b63cb0e719f71f04cf21af758688cdb39d4be56d104db7 ba381c94e998c2fa275ab84f1e785cfb6af5ab40ad690e6b429eb72897837ac4 +lib/codeql/rust/elements/BecomeExpr.qll cf7d219b639e8e93f6a44bb14be14740b17bdb789f7299863560b2b5d4bfc7f7 26511c65fbdbb9352b6628a813e3f00be8495f2a34abdfae5a5ece8dd59cb04f lib/codeql/rust/elements/BecomeExprConstructor.qll 0c206e657417066415850672a804a69e5fccc605c309bb8755737ae01e332f18 e70bd0c411ffc23c37b22a459455c95ff75a72fa2d179f751bff99866eeef2bc -lib/codeql/rust/elements/BinaryOpExpr.qll d85404c249175283d7ac7daada3951f47b19ef56b08749906c8bd3895959db9f 9e1d35061bab3517c716e3d0fe42654568e16b6577d6d26861b87576839a33be -lib/codeql/rust/elements/BinaryOpExprConstructor.qll efa89c084def020961641772f4829fc54bf718817831d4752b9bf403ce0e61dd d7937326ba08410fc3ba37e44b76530804f492177ef5e62dd416094e1e2f9bd6 -lib/codeql/rust/elements/BindPat.qll f0209f781d8a14ab7fbb4b4d6a654469aecb0ff1a8ff4810f18a90f3b171e1c3 9734b7907855e46eeded6c3f59912a16212f7e8639fba35c740bb04462240287 -lib/codeql/rust/elements/BindPatConstructor.qll 2bbcc296bcdcd945313d83294b90d327c51c9f1e96f92d37dd10bf0c32dfaf6a 612b4fc651f32129155727e866796edee8fff939614c6fd0b7baa1392930a38c -lib/codeql/rust/elements/BlockExpr.qll cd7a978d3ad15156467ee213d65ef0dcc806af43888d1de4635e875b2d76f5fb b0286039d03f2f554ab5c31b902386357e19127d35f70211b1373d591053ed8f +lib/codeql/rust/elements/BinaryExpr.qll 2c59bac9aecb4a0a3495b9e2a3294ff9d6aef3204acfcb05d278c10427269e81 e0b99b8be24214d0eed80ce81d38e7770afd1a9d515622d5f1d51a0df1e553ac +lib/codeql/rust/elements/BinaryExprConstructor.qll 1cae8104dc9860a7e445594465fbffeb7cb73534887d9766eaabe2bda8e62957 3d347cff129b9bbe8b66cee0e55596c02b8c11fe7c78b5a47e11e5c7ac57bbf4 +lib/codeql/rust/elements/BlockExpr.qll b699906fba2dee34699e110b8759419079a5ce3dc1fab207001c9c9b612dac5e 429016df600e3905bd235d0e707c50ecdbf12b3ceddedcbf48944ea76e60f915 lib/codeql/rust/elements/BlockExprBase.qll 1b24ea5fd43dce0e240e1d7740a062228c19e8c704f6ce26503ddbd65c6f5282 d2e05a51d3840caf4de4cca6cdab9551f396df317c8ad1da661205aa822646cc lib/codeql/rust/elements/BlockExprConstructor.qll 7fc9214582f0e6e8b4db06f7c6ac3712dc260abc12ff65f3e93bec5f210b0098 13bc676b67ed14b326e4bdaaa43b497ce486dc2c3145a76a25fe960c82a6ba54 -lib/codeql/rust/elements/BoxExpr.qll 02e6f063c8e2aa01b12eb3223783e8d88330f4faadd71fef253b5dd39af8b556 bda6357d99430b524de82be0da444cc180dde9ba1f3e08c1bd4c53143789fcf0 +lib/codeql/rust/elements/BoxExpr.qll f4727005f1b07d0d2f2230379778929351ad9fda986754b48980e8b166cd68a9 adae835238f824a48ad700310c3fce70bc9a890538cf361b4ed5b3d213fcc67a lib/codeql/rust/elements/BoxExprConstructor.qll e30e71b88978b5d0f156152acaf7eaebe26232b7a5a562cf22f1bb9659ae5deb 3ca41494c5101ef73877737420fbc468483ac7ef215d11b431dac2dd6a08ecc5 -lib/codeql/rust/elements/BoxPat.qll 1df08d5443c63e21d40d25023da58da50bd6cf6e156b9f5dbd6d41a3193faee9 9837752be4d4a1c3f16d6438bd361c596b6b983d9ae4e486083651e8f4e090ff +lib/codeql/rust/elements/BoxPat.qll 15d63d499678417c6dd5118944fae3abc416f550acd18810651b85999bdc0d55 5360a2bef9e42e7274bfa68349a3b19020e000919358865c272338721956e384 lib/codeql/rust/elements/BoxPatConstructor.qll 20f79f18beb8b7eeec63b1e30302d9f2e514354a7b1ae077f240db3cda4ecc4c f41ca3fdafc70c6b972598a3af3434bf60687bc2f0252dd11ddd09ec874fe63c -lib/codeql/rust/elements/BreakExpr.qll b760b1f9ba612aa29c917a25d75143e90bbdb607d12ea4a49067ab44595292c1 ee0bf075f2b237c1513cdd03dd35666d4c9158dbf1216a30c5aec05db9e6d317 +lib/codeql/rust/elements/BreakExpr.qll 526da383194cfc0600ba623182ef8e984b44da76609d335b209067b9381e2e18 6d7b6e970b69f093be5015e847512830937e79a2460a6c49d286cd5c8ebd350d lib/codeql/rust/elements/BreakExprConstructor.qll 48b71a034b7b6b0ecda47c72379696c6d4ebb9eadcd6403f9c001945855c5365 fbbccb6d1718393ad6ff3a2bd473dd51691c871db9181cb1e041b318f91d27a7 -lib/codeql/rust/elements/CallExpr.qll 7b76acfa945d7cc04bab4012fc8476f8e4f9970b7051ea02fe5b12ec57927897 57ebf163cd6db203f5dd05d629f68bc4e39666ebc4d1252ba1e09b88ffbe60ef +lib/codeql/rust/elements/CallExpr.qll 68f43b25fc38d3df4909e9b1a44ace18a143db480d1d4c30c98a724ecddd8d94 199356b943f73828efa9b116ceb3549daa7743678122451bb306c4e26abaf184 lib/codeql/rust/elements/CallExprConstructor.qll 9a7e9e780ff6604ddf0b9e5f27bfa43b720bb341673c7740148561c666ccd066 945804ba7c1dbfb9f221810be9d2fc3dbee3ce89dd9d08b3f3e719d31701ed98 -lib/codeql/rust/elements/CastExpr.qll cdd74a040d6b1aa44f6e2bdb2991e642f013848f32a17588291317a7abf38961 06f3228ac826fc452d75505345707b912426f05db78380a72f0ba586fa00c282 +lib/codeql/rust/elements/CastExpr.qll cafc39afc4103781b475906a0e178175b32374a04915b59d84b753d3c1e71544 1cd95a62b3e3983827a7622326110071a839595d1e6a76723f8072ac6cf32f02 lib/codeql/rust/elements/CastExprConstructor.qll cab6e9a9872006cc811620bda522fafde23fc4edb5151af06a5a0938747dbdfb 6d972faff70166c4b07392a0bc90c6d72c9466b58b55e7651ef6c3d06cf72873 -lib/codeql/rust/elements/ClosureExpr.qll 2a8b0a94e37b8406acee038ae0737604174b3062f3c12ecea27a3104ded3b2bb 904eed60004ad20c0d03965f91e1d2227cccf3b13ce29341c79d545aabe492f0 +lib/codeql/rust/elements/ClosureExpr.qll cde112e1e1fcd5677cffa3469e376ff2b69ff6f55d907152b4afba4d92d06c55 f9180e4e0905ba233f64717719ee653ee5dfd2dad9f87a81b63b513ce5e73bc3 lib/codeql/rust/elements/ClosureExprConstructor.qll 238dceb78082a5566276640d4aa31484041700852c0751130d139a69ac8bde46 7aae22930def4d438d742255731cc59b78a95b73a0b1d6334ae9965e083e03bc -lib/codeql/rust/elements/ConstBlockPat.qll af7f5f1a8de38266a12e92dee4a5ef5279baccf542cf2c52d982ed075d3bec27 1208223d97230a90d9377164b61454dcc6ca0f46a408e4a5ab2a82340bc92eb3 +lib/codeql/rust/elements/ConstBlockPat.qll 397ad2bd112a34f39c486acf6c82c73881ce3f70d91634649ea040b92f96c8c1 96bf33b3732b8aa60e83c10f48eae538e695b1b8a6a5942e8e79a924e09e60f9 lib/codeql/rust/elements/ConstBlockPatConstructor.qll 04aa8b4f218ce87157f0d6b10c9c04660c34c90af1f121b1432402de2e5114cd 34e2fecbe91ea9ac1626bc27121a7d5abe99855e3f49bdca12a1969b42ac0ba5 -lib/codeql/rust/elements/ConstExpr.qll df129a4a1f65c07076e15097571ffd12b91a63d3ded97bb3173b50a7f1279bb4 dd3b7a5230baf5d1a062d49324eeb6ee5a76f156944ec149da8bf46c982107b8 +lib/codeql/rust/elements/ConstExpr.qll 70a7c9db14efaf290a77401eb04c439b24ed77c21496cee53b89d92d350daeaf e3f98ac4dde94a4dc8d6df51ba4ecd4acc492d9de569ac3eee9dd3bc258bd03d lib/codeql/rust/elements/ConstExprConstructor.qll b4c96adc2878047c36d7ceaba2346ef66a2269b5260a56c3d7ff6e3a332bad75 ce15bbfd1448e47d3039e912363efa607cc2c29d44b8248ac91c307af7b57016 -lib/codeql/rust/elements/ContinueExpr.qll 46635ab257d8cc8ab3ba4b6786df7a2ff4d2e6360578bebde8bec1d6ae90b8c7 a0c60fb018ced67e1d6eed1c493b2c6d729636f1325b556ed5bcbcff072cd8d7 +lib/codeql/rust/elements/ContinueExpr.qll 6d123e17b40c8512e8abb63657ea6ab4cf3fa2485f503b6d750ec00dd5bb170e 5778fd7bd6ad44b6276b36a85f438c303b11bc6e995ed1cc92b9d51536725710 lib/codeql/rust/elements/ContinueExprConstructor.qll adc5c5b4fda5dc5102cdace41c32a6c94fe07a2e2555ced6ee62a2d2551b90a2 9dc5045b0d91a3a28cc1c0d59c6fd40620257a6c18ea8480792183c4d802fd8a -lib/codeql/rust/elements/Declaration.qll d4ec5c83728f1837243caf2f27d06fd05ecdd2ca440112accff99bfd37b45e5f c1cd9b297be8b69207e75d24b29949b9f71c78406ee0ffd38d0b0810288d6140 -lib/codeql/rust/elements/ElementListExpr.qll ec535846c4f449a3e58bb3b8dc583960ef3b42a10836ad13a6c3091f625ab463 3797f92086ecab90406b7493953d78af27b0b5c68199e2f37abc15f3d1cf88ed +lib/codeql/rust/elements/Declaration.qll a902e494e43c13dafb0527a259c7244fca32cf38464d6892143d3a6856683df2 764d0db5928d4243f6c98bbc2cb9268dfad3f489a3e5382d533ddfee153b8685 +lib/codeql/rust/elements/ElementListExpr.qll 64356a9bf66f0f316da659fe8046828445804dcf5ae6b19e52232aaea8744885 0822b1430e5c811e74e092cd19001dca783e8d26df140c5366cce61692eaeb2c lib/codeql/rust/elements/ElementListExprConstructor.qll 12b06597e0700cd0eac70e42cbdc1a2d410e0ffcd05c21a213812a488b5b236b 7adb2e442f1bc362c44824aaba0ab4a7fb4a4bc550a3c96f963dc03bed582d39 -lib/codeql/rust/elements/Expr.qll a0c2cb3ff9628e5dd1a7900d2413390faa433dcef114bdc85279a3a2bf2fc4d8 a0e8e5693ead91b62da5531e070e11a2105ee49046cb69e63b8747eeafc27651 -lib/codeql/rust/elements/ExprStmt.qll afe41d6d05ed9d94b3c8529dad743bdf3e2a0e68bed84a80da4dd6df0257451d c1f0c7c1a3c62baffb7d3bb69cc4bc828e6fbbbabe8f87342ec67d8744fcbe7e +lib/codeql/rust/elements/Expr.qll e1932febe46ca4f1b2d0caa1f1e8b14e84904fc1b1b663a54511d8ab34d40a59 d820fbd85b938121f33da27827979dd6fd83a8331315581af5922ace13807a47 +lib/codeql/rust/elements/ExprStmt.qll b88016cb0b3b53fd8c6feb98e4a17b72a65824efb9aac798c67a6e1be0cbec77 e5bdef5ba3c94495900494b1f3c61c167748945372e3de061b8a4e3f7edce430 lib/codeql/rust/elements/ExprStmtConstructor.qll 28e37020abdfce5a8666b0c9a3147c339c7a90d9de527f97fc7d36df2bb921ba 5333db932a2edb791ec3c8f2c215f4c74e825a362f45ee901949d81e328bc7fd -lib/codeql/rust/elements/FieldExpr.qll 1e3d84c3eeeeefa1837b5359f7289c0f03122848b6f95fdb362cfd947304e107 28a6f8201b435b87705afcb8088d017fa699f60be3aefe03dd56f978ac7954d7 +lib/codeql/rust/elements/FieldExpr.qll 54b2dac331f4de45c4520e318373805d41f63d45ca695ae618c8f42d30f38d5d 2f87397d3cfb07763e287b0bca83d625368ee2c6f29f8fff2de509d5696ed27b lib/codeql/rust/elements/FieldExprConstructor.qll 75bd0526fae157460750f3ea1e087c857cc703fca03d34f1f478b57ee8051590 1e5555910c643235e34b73f9844e894e51f357c3f7aba8165c47caa147336c53 lib/codeql/rust/elements/FunctionConstructor.qll a9269b37182c0bf432f9b2b015691da5dbd64819b9bd25445af229d873014a91 69107a7503af14a51e091e6918094a4e9fc316a72de2e1514f001872ce0f2c0c -lib/codeql/rust/elements/IfExpr.qll d5461ea0370765b9dd0c5aae298e53c9b3d84bacc783991fb9dceee44c87e8fb 90c5f959144c767bc8f10b322489264b076c33f19af0d19e97a08d083f76913b +lib/codeql/rust/elements/GenericArgList.qll 3db540d2cc2ee748aae2d4ed7917644e78e0016649e8a8e0d96aab78f2893564 b6b826e9a5ab14448e1ae35d5a22029050c08a18f9ef68d4731c6641c7e0f6cb +lib/codeql/rust/elements/GenericArgListConstructor.qll 68e8739557bb470c04ae12f6b39d34c6fa4966bfdad1768b9e4f1a596447cd72 e0fc7e51fea925b7f21e771eca7e1bb2d506d6992c80ecd7902c9656610e545c +lib/codeql/rust/elements/IdentPat.qll 239fde12e3dcc46ca94be91c039f26e0a74b5c2e550118a03d451b30a0bfc03f 926ba7ef1dbfa8423a85771872131b1d2e7a55730e281ddb2b360cbac9781e59 +lib/codeql/rust/elements/IdentPatConstructor.qll 3144353f70712a224b5e7af6c5a2cd3452d4c2e164c38092ecb5f6c668401a92 26732573959eec1690afbc1d99ddc76d1fe4936244e0108e7d7c84f69136539f +lib/codeql/rust/elements/IfExpr.qll 87d29f7f6eec05e03d3e929e32b526787f41d5320141bfe96028973e15ef225d 42789266b2c54b222c1d980f85e3150c80397668e61c9952df6905f1bf0fc4b0 lib/codeql/rust/elements/IfExprConstructor.qll 961ac42fe811db7c56c9d85e98724a87571e8543265c0424a7b61f26ef41b369 43d9412a22908a7e5c38f1f5e8f88162367407b71037f469dfb7d8dfdc3a063f -lib/codeql/rust/elements/IndexExpr.qll 0729277577ffe82d6dbc8fd275a70de59a3926aafea730e622ecbbca7b84e313 c9bc5616664e072fbaef2b89d4047f5f7e28d002cca2fa17333f29db80adb284 +lib/codeql/rust/elements/IndexExpr.qll 924fe6732ffefca376d099255e2eb6682cabd6cb4267dc997fcf85aa5478a3a6 09e65b09cfdb928d134d3aad17acc07602a0bcbca098d775028bcb7624f16b11 lib/codeql/rust/elements/IndexExprConstructor.qll 37e70c773123d775b6281514a2727e133e02fa87e774076f857a676697a1f2ba da2ed2819a13ab7c526b74c1c375ab2fce63ed17f61d5b29e4212343d6b77d06 -lib/codeql/rust/elements/InlineAsmExpr.qll 5883542b068a11c22917bd46e44eda2f5e4a9de67f5346acfaa2334f73ee63ad 9a8823c91daff1337aa60cbd6bf3b6e96ad1e8603dfe79dcf404636de2693a5f -lib/codeql/rust/elements/InlineAsmExprConstructor.qll 5a3eb5162805366dcc2aea00714c1a0880c31b614b73b69f1638ff4f088cdb11 89c54b68b0246fe5d86f119c1892149746d7fe22d6ef8b625c9ab64398d19d26 -lib/codeql/rust/elements/ItemStmt.qll 70fc3f9df9794dc78199dfd81b8136701d4ca0c9b3c6e88ecec42f75fbc41f32 df122241e3868b1c376e2d2501328ad47020a0837826f165c7e54640bc018156 +lib/codeql/rust/elements/ItemStmt.qll 7482437f4acc6a213a65cd1615be2f909cc4bfa354894df665c8f5e17622d325 aab0311fe7a189bf8221f51c3f46fccd785887d53e664b230abd94f5a89dfd44 lib/codeql/rust/elements/ItemStmtConstructor.qll cd27051f73ab2897b1f7a725313f97d36507fc9f5e0dd7b2ad8bd1caaf8c42ad 67596c97386fbe6cb9e5e6abc45b674158f411d927297345cb25359587380bcd -lib/codeql/rust/elements/Label.qll f48209b24876d581e95120bc548c44033b6552a7875eea73ce44aa57b675eeb3 d17163f3adc9f94a462269f565153aa2822533d03487e521d9c5d5e72afaa1ac +lib/codeql/rust/elements/Label.qll bcd453a21ecba694ea3e42316f0c2b6a213d885bf2cb5ad80fb14d64a1d4952f dbde62a6567c79b137c78210bf04609b2c259ada9a8bf8c1e35e44438c61b983 lib/codeql/rust/elements/LabelConstructor.qll 0625a149cb34b9f603b76efd76e679bb63808d47f9fa529959784347d8e7d447 2115bc7de878af444777f96247bc0a775161f3766e38c3c4d363c2f59b2144da -lib/codeql/rust/elements/LetExpr.qll 986598132db0cbc861adc641e633a54b7651ff5f3bc52b5e2f4e84733b774fb5 e61ed80a6732fb344498c8eedf3b787546eaa38f203265e9a3195e93d3534a19 +lib/codeql/rust/elements/LetExpr.qll 49a9ba97471d04d52bee73f9b5651bec09fae40c5779db59d84b69a3e04c0a4f 682c504fb507855c96833677225c4ddafc20dee75f8203e0dc110aeac89fa2f7 lib/codeql/rust/elements/LetExprConstructor.qll 8904b25d70fd0e6f3db74d2e09bb3e3fee407282ee45030fdaeac31b6111db70 36dcc877f6c1810228d593d914cffa7b04ecf0afe13c4c122aca72f33d03f566 -lib/codeql/rust/elements/LetStmt.qll f9e28ca0123e2a6e1f6115821282440397cf2647577b4bfc4d00cbb4312d8eea c65442707090461035160ce830c4c0a85d1fe626f03026c13ebc4be06ec96905 +lib/codeql/rust/elements/LetStmt.qll 542dacce4a4991f0250b45a6c3b28829117e6e5692320494819244a155d05e8d b3e50baeb3534a4352d6bf898ace88e250d84aa05ba0c0debdae5c18c446f3c7 lib/codeql/rust/elements/LetStmtConstructor.qll 5882f0e4379d07e8281a955c9eed7dd907b610750887de3dd6451cd1c8d104d4 68b0890d8a493dcca74190904b00f05b0e58aacfe5a2aa63e5ead1ba366d3c38 -lib/codeql/rust/elements/LitPat.qll 539b414883b0b86ff446fa81254f2c71f467e5ea0bda21dc3bd66cf3abf95b13 d54eeb618cfb8f0c4a48ce5ab1922fca2622f4a0c703760aa344028172f37642 -lib/codeql/rust/elements/LitPatConstructor.qll 1a1c5f711b04bfc9b8b9a197564cc8acfeeaff1a9c8b30d57657747d84138fce 19cfa7386fd1f4ad8ba1ffe8b14bc547b9884dc98e731b6935afd11ceac6b5fe -lib/codeql/rust/elements/LiteralExpr.qll c5abad970feff4cb2719cc4774aedcfbc494a68fe15e13c36eeb2516d26a88cb fdb399d9a6162be54c3cbdd83654b9736faee9b15aa111f1bbd6f333d332c87a +lib/codeql/rust/elements/LiteralExpr.qll 031edbbd52d2107a3a7149a4dde306f5fcce9a32b7f4c5f7398b013c06ef37fe 7c18930dc7514f5fbe0a4248242430ee06f403b4e301c4e594355fc5b2fc8941 lib/codeql/rust/elements/LiteralExprConstructor.qll 1a6aa25d6700ab9c85bd7b721e4818064a3a092386589ecdc2018b8b8c2464dc 6d6b50e2dabfa671110454d64f0903336563ee4be1dc6751071a801ac2fcb8e8 -lib/codeql/rust/elements/LoopExpr.qll 6596e1d8ef1e9479785871321021930244dfb7736111801aeacd08446f4d2238 5895e4a5d4187fcd852528f0cea99fa378d60d279c7896b221eca8e65109fb96 +lib/codeql/rust/elements/LiteralPat.qll 1971f70ba0b872de28e1a168ac63d35afc123c5a710efe83b78e88cf949ff20a 1d00573dcffe4d4cfd444baafed38ec693035057d6b825e76e47d436fd08d02a +lib/codeql/rust/elements/LiteralPatConstructor.qll abe137b2b8ec9dd9450fc77d2d826fe891bbb0af23b0c26ff5e2d1751988f747 e1642805588737ed98eebec1d16cb0fb9fd081db203ec725db85b02c4837bdcb +lib/codeql/rust/elements/LoopExpr.qll a32330e9f6c5420e7fbd4a61f53dde892c1acadabef074b7e9aa3beae39617eb 97061b3dd86af3ef271587aa337d10f2a7094cb69d7e339baf13e5a7817e1389 lib/codeql/rust/elements/LoopExprConstructor.qll 635348fe22fb47c7e59bed02a8ed6420be5a9ce92a7d9bf4475465ee170c917b 2bcfe70247c55659b3a3e09562da52fc645cc3166748f268c5a38b35fca24233 -lib/codeql/rust/elements/MatchArm.qll f91def96700dd8521c11aef100f494d2d44777186e771b306ec9579b01c882af 021b298096cd88d3de81c2c012102e5b5ce5159d6dbca2bbd32b266593df335d +lib/codeql/rust/elements/MatchArm.qll cde6e94b3e65fe0fe35c2e5e801d9a8297a6770d4e7a26f75f433321a6e2c781 c17031a4570f712a092d629f5c347e4b9e246145e2fcc09e56baf041158aad62 lib/codeql/rust/elements/MatchArmConstructor.qll 49d134823a445a1ee995ebf5637fd0d736b9ab7f2b141026712f231ec4ed3389 f16e8adc8375e6a7334589d5732dcbe10f5ada9de7a12c549c55be3f028ec628 -lib/codeql/rust/elements/MatchExpr.qll 87eea89af08e7b9e4dc958aae0d35035fa8cee5fa7108f59cd0d3050dc70eb29 ceb061ce32c20c9aa12e6376474ea1ce1b8bb9c9b0e58b67abeb4bb666a18676 +lib/codeql/rust/elements/MatchExpr.qll 6938b5b9aca51f15cc0c0c6374a5845c9c298cb49d17c8111abb03001fdf5508 1e43ba73fae5fbe01645cbc762ab229f2148a53da3de1c8d083c1292d9019fff lib/codeql/rust/elements/MatchExprConstructor.qll 74df937d7d8bfbfb02bdbf095595eb3f2129ed4c0854bae6d73b5b38d4fc902d 5c388c02f02462d843945111b72de12bce33c7c332d55993d903aeb250213407 -lib/codeql/rust/elements/MethodCallExpr.qll 2dd115a2e5ac298d9a81cab2718b7abdbe52825938ea88115913c82a0f2f7751 9733c353b9e6703ef812eb8b6395db49d6d656460c575dbd75d67fa96784a33c +lib/codeql/rust/elements/MethodCallExpr.qll e92c5214160d6b5bebba76c78f5ec0380a629230991513326585c99dab7be1f3 ed05c7f40fb6d1c97fa0a3a631db1913b8e6abb5c2b3513d0e81a82a2e5f7f95 lib/codeql/rust/elements/MethodCallExprConstructor.qll c9e1137ba6b76eabd941ecaa27a5b43b6fc3ff445ad46d3f625ad086de0e0af6 47bc4c30182b891c7009ba536edad7393dc068b72d9dfc16b26174b15d49748e -lib/codeql/rust/elements/MissingExpr.qll 2158f064d027975e3faba6a858b8e469c324544ae0923319b149fd5ec6548448 500ef109ceb36f5da72040fc733c7e98f94920f51d53d90fff3d86f85da0aad3 +lib/codeql/rust/elements/MissingExpr.qll 618f80b813afda19783c689c67c79b2106483b559f49dc21ed713281d6b1ac87 9de89e36754a98b8caf9010690ceb8a9d32999d192e325a1a24892311f874268 lib/codeql/rust/elements/MissingExprConstructor.qll c51f4f6e897ef2107a27bd91ecf31ce875611b29a5a12238d5312b9489a35b8d b9ea3fdae459aba6c7ed9eb48edbc5bdbdb4cb41220fff81ed4cd256648612e0 -lib/codeql/rust/elements/MissingPat.qll eacee2eaede4adb8452a41c14c95c310d0731c2c60fdb818b3e94e34f418aed4 9f81567e8e9c02be0994764a082a2135a6bec952456c2413295f2b0a16e5eb5d +lib/codeql/rust/elements/MissingPat.qll a2d6ee4f7bbb69b9c05026b71c0283a6b229a7eaf492894296294fbe533e40d9 c9823a3a06ff2ff25ad3f7ca573f122637571f7d351bfd1f7f339c7629404852 lib/codeql/rust/elements/MissingPatConstructor.qll 7bff2fb7fe96388dd703cca5f0bb1d04cea5d1f0729bb54c6604b58e338c7d6b eec9fea46593b3850da111658848cb54cfa9992286eeee313a55def184cf7ec5 -lib/codeql/rust/elements/Module.qll d8995b361cc672f86a314bd53bd3e4d1ddb26b6afde62eb7c380923810785af0 3c10180c812d89a8116ac6e32cbd4d7ac2f549c8a76d327ed75c764b09251d52 +lib/codeql/rust/elements/Module.qll a104ed007091e5361db9e6be640fba6a22b02913c16fe50cb5d348399504f7b0 7633ef24e7c9e1daca9a82d89870462482536cded234e0e1bb7da9eabc43c00d lib/codeql/rust/elements/ModuleConstructor.qll 109ed8c1b5c61cc1d3e8613aa8bb8c168dc1943c93b5b622fa79665751b78318 601526c7f56578883d261d14653fdad08329f80fea71de14a5ac5ce671a8d436 -lib/codeql/rust/elements/OffsetOfExpr.qll 1076421d48a639191b52ca36701e760ea20a6ed1c8ff8f0cf1607f557b9f9a58 9cadc919b51ef5b223ce2c827005acf879309c9cdb971e8479477f0646e7c70b +lib/codeql/rust/elements/OffsetOfExpr.qll e7490d4db7cb4dd1c711ce57934970da8c9cc61af913a62b6963667313dcb0c5 c9043c5e68483b3d4da03ab191dc56e0150ff23af361a227fe91062e10ad66b2 lib/codeql/rust/elements/OffsetOfExprConstructor.qll 8034eb1d3510dffe9e38cdfcb57a0235ee01bb50e1fbaa6e5601e0e232c1977d 6e3b7c20a17fe4c45d503ba32264aea8f6dfdc69ccd95905a5bfb1e8b0cc91d0 -lib/codeql/rust/elements/OrPat.qll 9b5cf68d55c57c262a5d630852ff2e842f0caa3aca2a0b4491d601340917db63 c965eb43675b135f3ce11c1e8762af0b764c6d4c262f002f8b9a512ae59e8a03 +lib/codeql/rust/elements/OrPat.qll d5fab9f9d837d0d330ccf447cca4b079a6f48bf6b4886f0e68937444152bec97 ba6a9ddec6c49a4941e30b0a1bf68873aaf5a726368cc3ace9e7c2812b3ead48 lib/codeql/rust/elements/OrPatConstructor.qll 9a24cc095adc55ae8ea66f68c695f42de0181a43e23d70e210c63351b47e2586 1f773ae88276289672d93708f4ae9f8c95199e7370a0c610a52c92b5e018e632 -lib/codeql/rust/elements/Pat.qll 197aa86d5f317669e38230a20460b271c1d82e830b84150dac65afb67059fa2a ed3e8c74e42ffd5df14dd88711d79660982170a42f9a605704a274298dbbfc41 -lib/codeql/rust/elements/PathExpr.qll 15d12b039c117e78fde972b098e22ce247e5a6df4f52685173241d76f6c18368 8e8222767d49c022b6a69ae8902e86a5be9ac3803301c6c9b409f265546da520 +lib/codeql/rust/elements/Pat.qll 79ac8430cc9047cf89fcf80cdb527166bd72e979d03e051fa2d60fa2f64f2294 914362a06ad0cac1e1777874bf4425fcc805021197f635ddd87b96d9e5c221d9 +lib/codeql/rust/elements/Path.qll 3863a424a10b840f05584e17cb642859b18093b205eb9125f9aa0a0c2de6bab3 0db28b1b40218961ff8db478842b54ed7eee7660229113aca93c180aa45bb243 +lib/codeql/rust/elements/PathConstructor.qll 97243db75d6337cf68a22ea68569fdddf4c3bc1b8875bb4bb66faeeba8846a53 03c8c665e2f3b103148fd38eb7a4d0459c8189b2f6160dc08ee1d6d2807e01b6 +lib/codeql/rust/elements/PathExpr.qll 088ca8090fc5fde84a3b39549099d1e1150a547ce9294d5d83984c9449fe964d 4e1e692bb6ab8cb887fc3fa0bb251e82f0b68e90e4e2ea68f5704b8b85db33fe lib/codeql/rust/elements/PathExprConstructor.qll 9db3d3ad160d897b65b8b8a62f3243f7ff80d8e2d27875b3cd2c2b046fb0f9b6 26c2ba19a04fba61af8aa0cd72602f7b02bf0e1b693ac9cd14c7ff6066412f75 -lib/codeql/rust/elements/PathPat.qll a49036bca0f3f023917fec3547876759987a34747e16b9a15ebb99c82ca9234c b4f77e6e29300f02cb845ab79d4a64edb654a398fe3d6c1a2306423e1c0a237b +lib/codeql/rust/elements/PathPat.qll 748a43d1c25c4fd20eaf78f381e4680207557bb696a28d74a9eaa1887bc966c1 186c947b0bbed3111c9bdc564c3ce39432c1a3bbdbb15ebb503629625ffe1dea lib/codeql/rust/elements/PathPatConstructor.qll 476a38723c63bbfa2565946725c90f1224ac2c5283fde79bf14dcefce6f500ca e9e9b000cac44851772bd9ca519edc89e8518e89a0930df21af14a69f5b0e864 -lib/codeql/rust/elements/RangeExpr.qll 05a56b149adf83006243335be90c23eca71e981aea33c2d81dc8ad5cdef757bd 602bc5ec0ab5e7eaf9f1debbb80d2861d53b6de5d10011b50fa71208a6491cd2 +lib/codeql/rust/elements/PrefixExpr.qll b00c0033177df5668f951689e3b12b039fd53c8618492b0e79a759712f3d3c81 1757e788a5a33b6ac4622752c1e8d7c2a48e9893116355b350b04836fc7d1e8d +lib/codeql/rust/elements/PrefixExprConstructor.qll 511dbd31bbbd6b31cfba4a8f76e05a9fe3d1c996d9c6ac77991059f26214775f f6d1b1a96e148debb6cf03908c07cf2f42e2891ef0c54f1705a477a4ffeaf34c +lib/codeql/rust/elements/RangeExpr.qll 42bf1320c3060b6d225e7ece9bef54f3d823704a6aedea6d8af594a0fa676134 03a84ac76225e2a6172f6240af21478ad3f978b03a1b9e3fceba39fd0bcacba1 lib/codeql/rust/elements/RangeExprConstructor.qll a04153bf88dd71c3f516418bdb7377ded9db21c07f7ee6dd245ed8b44719d8f3 2d578f8dbc49da98694676d6a59bb9d58c6d2a200ffc893ffa90dca77878e38a -lib/codeql/rust/elements/RangePat.qll 02f3e4647932553481c4d8b1e2d2da3551662a17d75f26f2fb7e9d77ef1d579d e2546bc74035d03c92aa7beab2abca73a587049c95710eb9b59f916363df1552 +lib/codeql/rust/elements/RangePat.qll 7df30b22d972c48151c9a0428245b9d33cbe3ed61a8767ef3cf1a82dcb949a85 33fe10d12a8d9abd4128fb6af4a61badf3204c538a1bb583f20a30df4ee42b42 lib/codeql/rust/elements/RangePatConstructor.qll c391431118ed6ce16f7b7126c5d43e61f07b98fab7b8bc48e9dfe22f7e21ed19 bbafe1c9595b0b004f7b27999a14df27d0710d5b058e7ab14dddd2fae058fc31 -lib/codeql/rust/elements/RecordFieldPat.qll e3f69b2c59d50807393928ef9be0b51af016f209cbae68cfde0fdf02b287f353 b24e256f850d1f0bbacea74c4879fee8bcedf47f65db091d7858302355751fa3 -lib/codeql/rust/elements/RecordFieldPatConstructor.qll 36859753aa70086c540a1700495fe6c414521553877bfdd56800f586eb577743 1b31233a5e6da0bf88aaf40c52fa08cfbca5b44088cd3f91957ce8c96f4aeaea -lib/codeql/rust/elements/RecordLitExpr.qll f5c0377f0a1805d824052acbcaad393ba10b0f994a5ea6b6f60b5eec2c417c21 e61bb3750d19dad5c4e59dd0bb3a65430879f58909b735f7c28f378cd2217221 -lib/codeql/rust/elements/RecordLitExprConstructor.qll 7b676a8e0fd9ba5a932988e613fe3dda8b6b0430feed8791ef5585fd9cd81767 f7811928dd8269138d75f0a6dd1c60f70d18806227bd2caaa5cd4cc1341e9286 -lib/codeql/rust/elements/RecordLitField.qll 27bbc256f61f4428578155da47b1a1b3eef43fb5d4d98f168c66fa85337bde24 880aa885f2ba3d1866c6023360a206dc5095385adb908e953ce792beae90b2ca -lib/codeql/rust/elements/RecordLitFieldConstructor.qll 0f83c9dc00937d90ee0d64d157458145078f5f3c87c9c0484600fdcc830ab207 e2852d5bc4f0174d94b90a2ee34fae1e6c4b24d5d8ccb58a51c520b12adf8512 -lib/codeql/rust/elements/RecordPat.qll 50f4a2401dc579f3900188043d412ccdd6c57c1da6636c105221cfe243307d32 7812f0e10ce1a8e70c8c45d0c87e52539f6b29469157463456d06c566e86c2dd +lib/codeql/rust/elements/RecordExpr.qll 20d6b98d1d16bf20cfdccb75b77f012b1450349a756eefe16da56916188dbdf6 61a724e9cc82bd1617f2824d4b778b464284172ac5bc21c8f7d9730c5aeb82cf +lib/codeql/rust/elements/RecordExprConstructor.qll e27ab2bcb3af858fa8112a28603da8ba2357347339ca31b6bfc3ae35694a7db9 b947ab8999924cf578d2fa26902285008d4994d3b740ca956fb3e32b4bdede52 +lib/codeql/rust/elements/RecordExprField.qll 4eed8b07e512ee858c6407d6602dab6e45a4bedd62a526a1be979e3bf57aec45 af181dd655abead2dfc4c9123ab2bd3755a73394ec1312a4c145bef8c22aba14 +lib/codeql/rust/elements/RecordExprFieldConstructor.qll 17bf9cf80046b2c49678e221177e2f6b520ebb124d39308ddb1f2f0b93a3d818 67c91c4e7b8923888901c785b40cb90561e81a870d74e0760a2eeabc5e5a7d4e +lib/codeql/rust/elements/RecordPat.qll fb02784f6f7b1e1cfa5e2f493dd3e9b084fba5755d237f80296bfab734b4744a 619b6fb3b14d154b3bb17d2937b01d0c4b2c56544bccb8400dfc3c2b848cee18 lib/codeql/rust/elements/RecordPatConstructor.qll 93c794efa5050b86c458470224de7f3206c1a004b46ef374780f080a8e9a4ce0 157800f342de96095e118dbcfa20f8e65cc79ccae712e8e37bff1ba92a227fda -lib/codeql/rust/elements/RefExpr.qll ed47e1a834f2af93197ceda685a368465f7eea59704c2b7df3ef59326e53c0e1 5676825b036eb4cb560238d86c8d1fac48a4e59d91110da0dc75eacd542bcc8e +lib/codeql/rust/elements/RecordPatField.qll 0ef9ff7a71d938a39d2cc220ba395426198c0de790f8f9da23090e95b65bd0a8 69e58fad68784ed49909b32948aec754828841067c7ec08338df1ec6ec0b5d68 +lib/codeql/rust/elements/RecordPatFieldConstructor.qll c105362a0d1acdd69bbb3b0c1f0ae2e20f677020d15d02aa9e7416803ddb3a21 5cdd18cb9c26197eca67e162ac080b7f17dbb46061419bad07c6f6d12508f642 +lib/codeql/rust/elements/RefExpr.qll 4c3176d24c52d61dc220d0ebf0c277126975a7e4189094c5f36e0d386bbd95e3 dd143ae809b9c3cd1ca20e8ccf2ed2fa79f0b75d3ce3d92de5e88dad68bf7fed lib/codeql/rust/elements/RefExprConstructor.qll 4a2b9dd4ec2638a5ccfca268ba377980aab3179b27177e34e44e0e9dc6653b36 752f6f298369b8c0f59d49ca9e729c20aceb3559df68be416c7bbf65f578489d -lib/codeql/rust/elements/RefPat.qll 00b2c32e09a02b336d516b7812aa7ffe6202bd1dcdf4ec2060a74ee7a4b1c5c3 90a4b3da60aec10b5d56f6364d0a022c1d7db5fe8cbb65a78f55651d23f9abe7 +lib/codeql/rust/elements/RefPat.qll 44db6d9cb0b4c796027116f00f43bb3a542df2535622a7ae884c0529044d2996 1778f2bb7f6df9b99ea5f3a20633b75738fa4034afaf12d39f33b85ecfb79ab6 lib/codeql/rust/elements/RefPatConstructor.qll 98497e0ef76bec0390a23aede2fc6f80050ad2d00bb60f1d473362111a53d4dd e4fde4e3e88c33daee90ab6d90ef2e38b36faedcfe1b6d6304f4eed92980b5b1 -lib/codeql/rust/elements/RepeatExpr.qll 24ae3d83a83fc40bcdc6ba5c397a31da388c9137308cecce7da6fc8ac622031a c8114ad0ca7197aa791ae76d1d42b53ebd6f6b98378a779c59727d4e4ec5dbf6 +lib/codeql/rust/elements/RepeatExpr.qll 376199e9efc3b20efd8c26a020c5e7b7f19bf9490ab9698673ae842cb4ff6721 7dcbfbf8029811657e07850a1fadfe70025881e70f474fc49378b215e65d6d43 lib/codeql/rust/elements/RepeatExprConstructor.qll 7e141ed538f1dd5debd83de045eadc74ef032acc8a64ee2e8ac760da60ede525 d20206b72b14d03f8a41571948210619ad7d7dc438ba04ae45d929776a11915d -lib/codeql/rust/elements/ReturnExpr.qll b36dc07c367af16c5df6276b10e36d85dbaa500092c555679463f8db817bf6a4 4f95cc9d88bbb8403e35b270897a1ee9ddb4c8bef393b06d7a014d914ca5fdec +lib/codeql/rust/elements/ReturnExpr.qll eaec617f85ae874a9e49a55b819bd47e672ba030f3f785ead54829a8479db195 1bb27640c8b29e099e39eb70fb095bf1dfdb7ff278f884dd71e3488a11e63dd6 lib/codeql/rust/elements/ReturnExprConstructor.qll 825501a55f7b5556ded49fc3c43d45b7d8325e3a1790a2af738a46df33b569a7 ef06e95f1919952e537027861660a4d7c79b832fdbe802bfa5bdc29ba0192f31 -lib/codeql/rust/elements/SlicePat.qll 3e88657bd488dcb1ce2fa6f4bf72a9f76c7bfbf64b695070efa0ad89a6af407b ad60e3d0eee368c21c46acb439b599d8867c82193c7279777fea10f3205bd272 +lib/codeql/rust/elements/SlicePat.qll 06b0fce357a5a03c4b0ae3f420f816ff9fe08e4db5ef49151f8c46702d50509e 25b00eb84a39e93b27c14c04b552fae2784674aa28927788cd57c6d52763a054 lib/codeql/rust/elements/SlicePatConstructor.qll b2885e663932f68ffecf87b4532f533e9177beddd715765474f454a9804afc8b ade153522a4773eb769f4f4d96fa07add34089f131b41a74534b28fbfd2bbb60 -lib/codeql/rust/elements/Stmt.qll bbe8414d75bdcfda90f47b853a04fc618f4d0b6d6cd3b662bb15d3a9e5cc7bda 714c6f8eba9882363bf1594f48c75d1a885f6e93adadbdecbbd8169ce08f7b98 -lib/codeql/rust/elements/TupleExpr.qll efcdda11afbbeeb237a9b7f84a5a59ca3a98b541bc660b58a41f1b1cdea56efb f416c57e7190e91bb36d4235ae017cdfa8e68f69b38c55c6e7a71eaff35e5bd3 +lib/codeql/rust/elements/Stmt.qll 89857f73ebd72919f2781f0ccd08c6c12fd545e6290366d739d189f41de75fbb 8d3616e460028b8ce51e4688eedfd1f8cea6ab4a1b0312a110eada4f224d12ec +lib/codeql/rust/elements/TupleExpr.qll 6536c9c062c971d943629dd38d5e7e284526eb31e6cd0306fd290232e8d1d86c 6dac287bb0f85d0c5463ba6038b91d22a980626492085350025bff9774a87673 lib/codeql/rust/elements/TupleExprConstructor.qll e7cfe2da7457339e99263030e74715e5ca44828d74ea3f462b90a7e72c1e9302 b45006d9cc7664a5a659e7c74f415142e2397dc33fb1875ac3a6cf5ca39e709e -lib/codeql/rust/elements/TuplePat.qll 17bad5b6a0be8e9b61addbd9a17bb387709147e8d2fb8a93ca9255a8a11bb822 7e84df64d0baf1b5329d47f4977fa5e8471fc323b2eeca8e942df93a48e04cbf +lib/codeql/rust/elements/TuplePat.qll d9161426edabc199d206a3a1c2994bbda9430d7418968b8fd0a8aabc9b29c4fb a25ccb4c1b77fcf9d00c02c0673f9ccce03d4d3512f8a2b8307ac21c8c41ffc7 lib/codeql/rust/elements/TuplePatConstructor.qll 505c4f440b47da576acd7e3fc69d6b49e8287f981a21e79919ded374200f2578 b295526303bcae982ddd8c6b544288c0b8b8d62984d6986319e7f17baeb7a19b -lib/codeql/rust/elements/TupleStructPat.qll 50b7d89498dbe6737d97325037156c7689fd8d7e776d66fef9551f173fa3f2d6 f42edcf42be877424ecf2f11c90166a90f485249b24d73ed302294299d6a9bcd +lib/codeql/rust/elements/TupleStructPat.qll ed443440791cf0868183c5e5304a855058ce78c1b3735507b5c35f269604022b f02c9481ea471b198eec0909d01bd3db03830bd98f10bcc3a2ca4f37b1466b79 lib/codeql/rust/elements/TupleStructPatConstructor.qll 15a15362572ac2dc98ed3257f195f20bb8dfe34a1fe203cf2a1a193ce16c406f 9e590b50cf865f6bc573b6fc17acea073f0d9389be241b01e820d9f3f8f14acb -lib/codeql/rust/elements/TypeRef.qll 223844544eab3e07b6edda805c6344fa8b486aeea7bbe62e4b98e235ce2008d8 7517748b0e7a57c925168f5ce7a31ecc1b59f7521a2095578f599b8d9045a4e5 +lib/codeql/rust/elements/TypeRef.qll 13824c88938542cc554bc9ead335136a4eb115ec07ced03e140c9a88f49afdb6 4d265a4fa37a9df406d4bbbad03a69bcb3b5edd3152482fdb90676466283194e lib/codeql/rust/elements/TypeRefConstructor.qll f8b2e5ef15517890a8b2d56643f471ae64cc74c420187049e33b182417e72e4f 683611e732b842756e301a77625b385bca0c4969971020c9e11220a1aa665a29 -lib/codeql/rust/elements/UnaryOpExpr.qll 32e637510c03653cc28cb9a25a2873e9bf346aeb63ad2d7a571bfcbda45c59ce 044b22dd35491f9eafc6488fff5bc929aed12e2f36ac55883925c876978bf7cf -lib/codeql/rust/elements/UnaryOpExprConstructor.qll 43db7afbd3535b7edc801d99d772233a734f4ed31eeee2ca74e7ab26cae33e87 7345f8d4cb958ee2fa83d3634285f12829bdd1cbac2697236d6fae062313ab6d -lib/codeql/rust/elements/UnderscoreExpr.qll cd49049149e268524412a17394daaef696ddca63f1f452b369172b9643e94d82 228568c12efc7c055f2ff7cc08c2d0ae150f6356f77ccea98b7f8be3d6bb4806 +lib/codeql/rust/elements/UnderscoreExpr.qll bf4c0bf76fa15b041f7ecbd492a499088bef2024b49dbdfa57232e84e72c3067 462380bac5f772c1986146d32b70deabc9f03581675f6e79f7b7f747acfb0bd5 lib/codeql/rust/elements/UnderscoreExprConstructor.qll ea9f93fa6529ec4e5bf5c4a98959b2e013e83fce4a74ebfc476b10bce2b331b2 bc36b62fd4fec6fb388d82e2af2aafe0099138d54b7672be81e84fc511fdcc8f -lib/codeql/rust/elements/Unimplemented.qll 60387a9def0ea3cb9534311ace088106800af0acb89883c5bc9b26d8d8d61718 9d869f83e73915bbeb5af27ea30b69f20c344cd7d7f253cb7dab74de20baa0a6 -lib/codeql/rust/elements/UnimplementedConstructor.qll ee024d4944aebe619ee3ea0ce4f84da0f4fca706baed250c8a65464a8d77979a f95966e3a63cbf2b466241f55bb47c23125645fad206ebd758236465afa4f97d -lib/codeql/rust/elements/UnsafeBlockExpr.qll d708ee1e3e238fc0bc51b045d8364a1f0fd174570c1e6416242f79655d1c1e38 8f67954791bbe9e127ddd4ada533ba97f5cfac9894a979410366b6747fdd4519 +lib/codeql/rust/elements/Unimplemented.qll 8736c0b7ab0a5b558b47cffe579c0e56016de10017235502bbe18a6d81510a8e cdb6135c0065938892fb32020a7041eed103d97c3335cdc1bf837046f80bd8d3 +lib/codeql/rust/elements/UnimplementedDeclaration.qll ec261842f0257b4f512a92911408110e9e48f975a2bf0a56524a57a5c8e694b8 6682484339cb3b9b08f15949b37ee380ab6a15e96517be21cface664a9c1d9d5 +lib/codeql/rust/elements/UnimplementedDeclarationConstructor.qll 44f4590db81e7504de0ede43eb2a33a54baa0738732e03a90721187a1cd303f3 11f27d8a9836b78d9ffac79efa3441fbfcb1dfdc1eb028d2016a1769b8a82ad5 +lib/codeql/rust/elements/UnsafeBlockExpr.qll ea7fc05c8f25b99205c098590329465ff9db9293b7d72cc41054b6c4e28ecb00 d617e6873b62ca2871ed87ca2435904da51cbdba42d46a2d160440b11f14dbbb lib/codeql/rust/elements/UnsafeBlockExprConstructor.qll a089d89cb8f9542b3ee94c8eb7ca9ce0ced08c954802b26826f6aff12f8705dd d3919a40e13d97c48b19df647851f120b667300864d3a2178b1b01236c2dcbd4 -lib/codeql/rust/elements/WildPat.qll 9791bcd2b36516da82a81c10655fe6b4ef0f788d548cc99cb88578dd9c1278f0 03c192da4f92db637001854f904f5f0ea7406b74c02c1ce26cd375d9cfb26108 -lib/codeql/rust/elements/WildPatConstructor.qll 538cde83119510e0b3fc9728127cbf980d17f7f4a9371b4572de26329ab08341 66b96aee3862d5c314a2fbcc6930258f755189c4359394b432e8edb13a9d0eaf -lib/codeql/rust/elements/YeetExpr.qll 04a1f4f7b2bb697e30ab284720ed30c0c8e1377cacf787383518da1e882f3bd6 277a751f38830e92deb0abcde9cbd124bffc84b7d5a1bacb4f1844c6ebceb2ba +lib/codeql/rust/elements/WildcardPat.qll 1c67ed3bf441d04a57f5d82a78856008fff694e534eacb8a96c41fa7b43b12a4 e98d72b2d9aa50cfb805dfc917d8ac454af60fde11e8139f001ebf67e6987e9a +lib/codeql/rust/elements/WildcardPatConstructor.qll f974e89eedde9d8a2a59562d0f5c87f6b00c61a428b7df734804fc87a6cf5090 36f5e961c88b0be4db1a907607dbcc8e0ff2f8e49c9eda0ead88a4da8af5b177 +lib/codeql/rust/elements/YeetExpr.qll 95a15d0ae79b9cad126700c07d5cb7e4e9699e2e5d11a926ce452588501731bb 848736c361d420945fbf670d6c126d258d095f7f8509ac1cbc949f5ba280f851 lib/codeql/rust/elements/YeetExprConstructor.qll f1871c6e0c966c52806e370dbe2956585bbfa1dcf0bd7ebfdb2bd39b7cfd0d7b a2333e80a325a921a66c34151401da12c250951952ccb0c81e5102dc62299503 -lib/codeql/rust/elements/YieldExpr.qll b0f238ba2e4b83b449b44224d766b6cf6b15523a413467f608f4a711d34edc01 355fcafe43915d69a07725ec3707e66abfefc6157bd7dc1c1fd846a965c6580d +lib/codeql/rust/elements/YieldExpr.qll 72682ae19d37abd6ec26569ae8f575979ebba1e0d373898211a9af4fad4979a1 ef0193011ee5f94cebbac5c007d652568f560685a213bf8be96cd0c0983a3880 lib/codeql/rust/elements/YieldExprConstructor.qll ff46ba17cc24abfcb0e310c7458d0539b704e7a771ad00853bd3a1844e4e6f82 1c13662ef01c88f1cf057d099eb46524036133e51a0e36ddf947f727ac6046bb -lib/codeql/rust/elements.qll 54bf00efa3d1846ed2ec874cbdcf5bf5789bf5df240cb90ea6c68d4b469abdd2 54bf00efa3d1846ed2ec874cbdcf5bf5789bf5df240cb90ea6c68d4b469abdd2 -lib/codeql/rust/generated/ArrayExpr.qll b9778720acf4080c065897ba1471be185c0c35f3ea01c15594c0a3ee4029b231 cbc8c9dbcb805063c4b893e21ed0bf00312490a0c92ee126d49dbfff6978fa99 +lib/codeql/rust/elements.qll 1d92fc19e7660d9874f0dc26a85a7021aaffa05a4c84dd847a82606e7235b944 1d92fc19e7660d9874f0dc26a85a7021aaffa05a4c84dd847a82606e7235b944 +lib/codeql/rust/generated/ArrayExpr.qll 3fd7465da22e1eb810ae28ffab7b14e9ccceaab0082aa665f14b73d4221128b8 6e9edb5846656aad90283406a496aaae485d38854075a4443817b5098b72b427 +lib/codeql/rust/generated/AsmExpr.qll 66f1a4bfb4d32d99b4dab1918a1aac75e0903c499d65a18105e3c837c1aa314d cd5c8ed300b5f5d19e404cd2e5f9dcbcee1081c5538f1840359eb491eb6ecaa2 lib/codeql/rust/generated/AstNode.qll 0598fac7859906f4103124270dfb2fbdb838387b1c45000bf50a4b62c797ec41 f47c84878c7c9676109e358073bddab92a1dbeb4d977d236ecc1eae44d81c894 -lib/codeql/rust/generated/AsyncBlockExpr.qll 1e9d3bcd5d5703bf61748f2746d3f9a4e2a12080268b29a2685b762d13c30555 1e9d3bcd5d5703bf61748f2746d3f9a4e2a12080268b29a2685b762d13c30555 -lib/codeql/rust/generated/AwaitExpr.qll 4b5fccfee29fe28dc85df19b4e6677bf565dacba92a0984bb7ca444650852970 0c0be7ea53e41c7708aa84b93d037fa9df2f72e5a676d78e217ca006f21b548f -lib/codeql/rust/generated/BecomeExpr.qll a4cde707b7372dd4c48f9b4a450b6ea710085f323878fc17c58f92cf7d50fef9 44f0fa714080eaf6dfe9fecc422b1aa161375b73eb5536ef8bb40b793d8f48ab -lib/codeql/rust/generated/BinaryOpExpr.qll fe0a286df10f5eaaaba60c74dfc5ef2c17736f24aadb718271e8a17eae736ba1 1f13e04bd6089b956db807e5e0ab974382ef7b5a7271f290a7ae5f75a857a30c -lib/codeql/rust/generated/BindPat.qll 15d3a33c5f56f7659a331f72735f00930fddd6066659e54c5c19d5e7eb8ef078 bc0a916622b2c426b71760caf15b8e005eed276e06e04d04cc5f19f4c31c34f6 -lib/codeql/rust/generated/BlockExpr.qll baf05a376d4c65505d3aa52eb893e1d8d02a8ef8b16bb40d4a59ee10c7d97b5f 789eccc236d0b4d3adf3dcde699a5f3097d333514455776f74b9184aa14fddb0 +lib/codeql/rust/generated/AsyncBlockExpr.qll 4038dd9d888f98e8848de4ab858804bbb6dd835a32e925a9530f350820edaf04 4038dd9d888f98e8848de4ab858804bbb6dd835a32e925a9530f350820edaf04 +lib/codeql/rust/generated/AwaitExpr.qll 5a6d94ba4083e00dd971f41be7f32693812cdd7f8efb9dc7ef0fc18296ed560c 7af5433b8e945932a453eededcdc931a62d85d1505c0b4e417291c694ac6cc5b +lib/codeql/rust/generated/BecomeExpr.qll 62daf23501554f0b786adbee8e1d430323c6dac79afb8fdbc28d19dc10bdb3bc b17eac6c775fc38bca90a65caffe1294678aeab92d456fb9b9f555e1ac59a0b7 +lib/codeql/rust/generated/BinaryExpr.qll 688465914b9601decb2181c0f09e93f6763eff35477444c68e38d80d8208ed36 3c0a276e59c55c6d7837c442ea9101c9c4b1a8e0e6695b3966309b5f9019ce0a +lib/codeql/rust/generated/BlockExpr.qll a04d98a1b846a78d5df7c9340348bdc0d4e27f1aebf81ecc389f90010aeb9f39 caa43e2ab10a401af6813218318a970efd60eba23bfaca3210954be277cddaa1 lib/codeql/rust/generated/BlockExprBase.qll f651ce968170b6e05e555924f8004d55b85ff0ae59bce4fea0804691cef0cf66 6ece8056e83d047fc27cdf1110fac166c0d1ba0e26a8d4a7a7cffc05bd6b3b42 -lib/codeql/rust/generated/BoxExpr.qll 880f550a9a6c861efc6310a72830a50bbfdb11982e99f11b5d3f4c6d1fbe826d 380f021014738c86e5745b3320e65a8147ceb30511aa51526a7fab4278a1ecdc -lib/codeql/rust/generated/BoxPat.qll b69ba2bc341a1bf4c613279e45fb97a530619d4148d5ccc4f05436a316db29eb bf52730243bd1836d5890c745232aba50544c2046d00e80e7d22eebcd104f821 -lib/codeql/rust/generated/BreakExpr.qll d68990513e0b2c0021cccebcdc7dc9ecc1d5b5c7dd0df7014686d6ed8a909940 36875ae186581f10485c1c846c9f6d2bffea3b18375b7f05c2927ba23f08b6ef -lib/codeql/rust/generated/CallExpr.qll 3e29dc45480e3be1989c364bad0ff94deb322cff20e87a3378fc1a7e11237d61 3873462b8811c3e3ef92700045ed05f55869d320ac74eb72111776d3353095f2 -lib/codeql/rust/generated/CastExpr.qll 6ed07afb453706874d7ae7c4bb09ed35ffdd11e7aeb4cbef4d84dad11a203d0f 741d1c0ff092dc9273b0d588aea6b30f7e2c1c5b9d08f2c4722fe26c2cab33ab -lib/codeql/rust/generated/ClosureExpr.qll f0c7ce7aecc9da9663cbda3e285be73b23464f8baa6b966fb5aebb0bd0f0aca6 685d74b6a94052fc45aff83b7c525a83f9dfcc02c1bf7e7f7a0aed51ce2de945 -lib/codeql/rust/generated/ConstBlockPat.qll d0818fe4cee066f1e6d3439c82122942ae62941e69da686b7d5c399e820c395c 2fae5a2f0457bb7106d52ac7457afb597d7ac9658b8dcff8e76294f5fe34019a -lib/codeql/rust/generated/ConstExpr.qll dd851fb049429fe965569beb75957a6a596137b333a6cd7cd588d1c4d40412c4 824825bc46a393827d5df5ae30f622ef2a053ea1f5e338c3b957625a8542cfa5 -lib/codeql/rust/generated/ContinueExpr.qll 436847767d2f68f95d011df0eb8a175924c029ac747daf620a203596479b20b3 e362f28dde0bf3e6ff3b234e81a44bc5026b4c9ed38b8b7872954cca9565eece -lib/codeql/rust/generated/Declaration.qll bbf5ba3792797a829b0032c41fa99d22c26e4277d655099912cdbafb80f0c8cd c4666a71099b21ad5cd83ef6f991ba18f9bef03b3ffbcedfa10aec081d6501d5 +lib/codeql/rust/generated/BoxExpr.qll 939fc9a934c5787e3f3bf9aef8694abe65caeeaeca57079047f6177301e39841 a9563f56abe4fc816f9768735624038e60ff5a075e67c17970a054ffd4d23a12 +lib/codeql/rust/generated/BoxPat.qll 8d9fc5a784473c7bd8c76c5f4a3a5eb6912bfe8691205f311cd1008b27ff5b74 e06a16614897df217948840e084474499b05edc6249ba0115d7cde516f98e165 +lib/codeql/rust/generated/BreakExpr.qll d1cc6452044b4f0351380adc9e46dc52279746d0cfa37baefce8e89494b385f1 c129e16ad176f40bbda2fb1e6af800a5bd240f3e0dca6e2fbc23b75e105ca8b9 +lib/codeql/rust/generated/CallExpr.qll 44cc428b1950e0d560a4e2c18136a956dbc3f85c575317cbf10a0cb5b2dded97 1a5d8dfd704b289774d7190ee331858b39563dcbb2c52940b02df4c5c2208637 +lib/codeql/rust/generated/CastExpr.qll c1e44783781539fa064717d360c5340668281eedf325543aaeebc3db67ba1243 db94f17538b220e60ee30bd2313f0dc5642fb6143e6c8609bfcce075efef0520 +lib/codeql/rust/generated/ClosureExpr.qll 43d9ff09c156f1ce000c77bcf5ecc02c8fb569c0ca7f042a1aae9d311e18b13e 07e1461269e1f07144468ef7b64b927f29053fa6de71afef334732c33a797f33 +lib/codeql/rust/generated/ConstBlockPat.qll 05141706ad963e1d9c41b004c73c9569fd0ba2f353da8c19629a153bfb17b769 786fa7db63ea7a8106162fd05e01b52c8338d22b9502d3638880bc6f6d678344 +lib/codeql/rust/generated/ConstExpr.qll 7bd3d75822259d2ac61bf3bab6a233948617fa09a7a3d48991b643f0c842925d 06785e5b723006a8c51cafda5b8ce3901e0ddd3aeafc0d3c80e61b9389830e85 +lib/codeql/rust/generated/ContinueExpr.qll 452fc59b28ae46d00c6b42dc4b51bd5e65bc92859e769626a6f5b29ff2ec795d 4d7042814fb8f214bf982ad9771ca1a19bbb2a966ec20771478d50927cf1993f +lib/codeql/rust/generated/Declaration.qll fd2401b9683a587cf1361039468c9e74666dce6c98443da63b1defea8e4e14de f1e72b51d4a411c5a74e0a78a34727dff8d20035e7d87bb1ef8657a18c9b262f lib/codeql/rust/generated/Element.qll 21567fa7348dccdf69dd34e73cb6de7cc9c7e0f3f7bb419a1abd787f7dc851a1 21567fa7348dccdf69dd34e73cb6de7cc9c7e0f3f7bb419a1abd787f7dc851a1 -lib/codeql/rust/generated/ElementListExpr.qll 3f7e9c1f7249f7283406d2e59b00af750b6dea93b284d7f25af66fe4b3345fea d340242d6072e274fbafd6ff2a5455bf53b3b77ed91539e91563d67cf2ed48f0 -lib/codeql/rust/generated/Expr.qll 32cdd43d17e8b2fb7c73ec723eba89704d1e853e29d304db5eea3979fcdd2e0b 0b8382b0659afa1bd1d13d0cd492d7fbdc0fd7a5162fa658ca2973bc15ee6534 -lib/codeql/rust/generated/ExprStmt.qll f35543fe1481f768eb8abe3fd0d36e2dedf00f0d1adbc31562e6280ef291d0b6 0663097b4b539c5f35dab9b26ab55baee879c7ef543810581347a8951aee46d9 -lib/codeql/rust/generated/FieldExpr.qll 25dd7f15ee3fe1b0de4371cab9df83d3713c1612501e5496c9a15df8d093a755 3c75b0136d1849f6de1bbd14bda4285c52d51c8a6427984c7e5302c05d706e99 -lib/codeql/rust/generated/Function.qll 84a00eb88479efdfe70fe51c3b5cb27ae64a54b48dcca1f2e02f68691b7d907a cde5b965ab27e811f0d24eb4f12bca90c3e8aec3a4c1d9b8bd0023745dfab105 -lib/codeql/rust/generated/IfExpr.qll 7d8e5bd93bb8eda6d5d6551431b0389a2ec5893bd8c13276205d6677856c8341 935bf1be8f790a52e71a6a28456f2f1a5c5cbe6e64bf20fa8602980560899835 -lib/codeql/rust/generated/IndexExpr.qll d44004268aa2e7d79e29133eb593d748beef1d4612318ef469220b3c2252a057 86892c04c59936d33f0cfd5272a04a6ef726f477c2e8f4ef27dae7240af9c804 -lib/codeql/rust/generated/InlineAsmExpr.qll 246c4f255d963f20c8e71fdbd16b4555cb6243820da1d399543205010368ccaa 1ebe22203305195259963bfb90f9928a4255cae993067f6a6fcfbc62069e1b1a -lib/codeql/rust/generated/ItemStmt.qll b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa -lib/codeql/rust/generated/Label.qll 7de504ea71f2847e305ab5ea3b30403cb0aafbaa0eb4cff3956a2931da6c024b 61e3c6a74b573aadcccefe0d4abe5d8e2542b1e5116c95f4e595b36efa3a86dc -lib/codeql/rust/generated/LetExpr.qll 896efc732db1ddc8be7281408dfeaf6f04f29d25ee1240738246e0cb31dfc2aa 14d5add4367164f4aa994cd2ae006e8b5918265dade20b41f363daf9537c6d7b -lib/codeql/rust/generated/LetStmt.qll 1f8fda11b71689fb1a1b9b25a2ce046c56f36f26cddb354805bd395a03e4db3d 80ad6ea6afb1891a02db434cfefdb95b0fb7d766af6246ff27129dc15cb48ace -lib/codeql/rust/generated/LitPat.qll 92c3c0f32ab9d5b08e246231e5465fe18536dee99351f73e158048bb007baf8a 6736a7824e5bdb0cc16de1231bdb5169d2f48251d5917bf2c31a36422b0bf2fd -lib/codeql/rust/generated/LiteralExpr.qll 9202e11f56a2c5e99fb98ed784c7ca043c1f5d80680b48ba4ea340dd689ebe55 9202e11f56a2c5e99fb98ed784c7ca043c1f5d80680b48ba4ea340dd689ebe55 +lib/codeql/rust/generated/ElementListExpr.qll fd3a6fb638a38382a356b807acbbcb0bffb70fe75b827e7b46195b060a4b53d0 24da1239e70a7d95531784260af6867c62dca271246ae2c740d03231c329371d +lib/codeql/rust/generated/Expr.qll 91b1744d6b07e8549b94d19832dac9e18b70f54990b328b1872b8c73be202417 ed71e6d24ab3f0dc687bfb8a665552c05f848ce52d8e338899c1cb48783a778a +lib/codeql/rust/generated/ExprStmt.qll 40fd3659761005fe0de2a09e58d35b3b28203f8f354ef5f687e6064862eb73d2 c4bcefa928d8a82f6b9d26a6e4f42912114bd24a90ee5dcc24e7ec1a4c11dbcb +lib/codeql/rust/generated/FieldExpr.qll 5050cabcc1109f0c404a64a80cf8e595088b1dfd9c24364281176400436922ef c7562bc91fd7c3f7305100d146ebc84378e73aa76fd1b36c06e69070105c0401 +lib/codeql/rust/generated/Function.qll 133693679cd69f0c011d6aa779b067924e8d58ea15bc3f6b749cc3aa5d5e962d 5a18e3be5c7c681cebec762b2c2d3b1cb08c5fcc11ef422bf65c9b15fc82c893 +lib/codeql/rust/generated/GenericArgList.qll abc549b0a763d2f5a162794676ab8f9a2fef8a02c77dbd14467dbafccf261c29 abc549b0a763d2f5a162794676ab8f9a2fef8a02c77dbd14467dbafccf261c29 +lib/codeql/rust/generated/IdentPat.qll 1acf5c9a4f20930f33339904be534c3b64dc16b06ad6c6189c3561f3f0acd244 c5f03e20dd26a21a492766dbeda8896ceb00369cff91df566b99238c3d627a26 +lib/codeql/rust/generated/IfExpr.qll 3b68ac5d7741f566081dd8ad028f762c849d02e4f1532267a7660e24335bf08f bcc6b52c950afbe4654ccdbc10d578ca9e134597cc2653daa1832fcb2bef2ab6 +lib/codeql/rust/generated/IndexExpr.qll a8263fb60cb625712b3ca875076994d9a28796482a9fc8fd524610d3107f20d2 a837f66ef6d70dd9ca04ef39d4fff5077e03ffaaf6efaf93e9f6b38eae37b454 +lib/codeql/rust/generated/ItemStmt.qll 7ac07a294031523ae83b1600a2327bab26c7ebda5c41f040485f9b978a50e159 7ac07a294031523ae83b1600a2327bab26c7ebda5c41f040485f9b978a50e159 +lib/codeql/rust/generated/Label.qll 25121c47ad829d209bbd6b4388a8878b9ded1f25e5b9c0f992e88427b3eaecae 216e68ad49218a21466597afe2a6aec20982715642aca726235cb4075cbc1cb5 +lib/codeql/rust/generated/LetExpr.qll 377099647451717af698677ca7119436982354d4e038a2097bffe8f34ac5686e 6bd51c497bcf2a684c1e6a2515e67228b0146b47a65e8d922cab54faf48b0d73 +lib/codeql/rust/generated/LetStmt.qll fe3513e2ea6191deaee4a237adb97bf968ebf30503f95595da097efa18e871ea 67f80fb6c44d775d1bc97a0305a0bfaec57f652015d1e15a11785f57cb16bb24 +lib/codeql/rust/generated/LiteralExpr.qll 70684629cd017f32c220993f57ee4ebea0b9f6267fb61200e97a14a026a8b0e1 70684629cd017f32c220993f57ee4ebea0b9f6267fb61200e97a14a026a8b0e1 +lib/codeql/rust/generated/LiteralPat.qll 6cb250e374f6c3d2c86aaea6ad7baeaa40ee438b42ac6987d823edb91b757d4c f8cf9ef6bb6cd39d65c6eb905f11f79c65daf3d493e1240c0781be29c3fe9202 lib/codeql/rust/generated/Locatable.qll 2d2b9a7cf26d6134b1e4a2047dfe99f09deb9231a05047d37b697c11ea91d0d2 dae7e0c66024d7f03a58d71ffef93cf23aeb629d7a21d36901c443fb29ff4d3d -lib/codeql/rust/generated/LoopExpr.qll e9304e282a97984e147b92ec7061c98fde238a8691e945e4cb775ccf34c27b0c 65b859e44e83bddb710d4ce9e5ab1346b98eaaa46509671776b75c9e8f1c1667 -lib/codeql/rust/generated/MatchArm.qll 5ad0dc254b6d58ccd856e4235b68ca0226a898c33f1f6b6fe7b48266a01ca627 f519af39f45e820eb3a70cefb0e4dfb541c3cf17952c00c6dd7e59f854a629bd -lib/codeql/rust/generated/MatchExpr.qll f8b422699337324c91ec9c55024630efe114ca617f4f088a18d180df132d5754 13169bde872f533f55aa196d7150761857c593a4657ab34051346dde14e736c7 -lib/codeql/rust/generated/MethodCallExpr.qll 499fa4c78bafbb8f3a6af645c26f1645c9a634976d409493d26d82dddd4b42a3 2dd18cb4868e96e38383c4ae3f8777637422e90b2363bb533f0e9e1c2692dc6e -lib/codeql/rust/generated/MissingExpr.qll 90b164567620c88b8e258fa229633365400abeafa4f4b0fcd1c856efc2f9b206 90b164567620c88b8e258fa229633365400abeafa4f4b0fcd1c856efc2f9b206 -lib/codeql/rust/generated/MissingPat.qll 0d8034cee20bacf07ebb9337c797f53a25686a149f163f801916cd6ec5484710 0d8034cee20bacf07ebb9337c797f53a25686a149f163f801916cd6ec5484710 -lib/codeql/rust/generated/Module.qll 2a931a4f2cdb2fee00ed83af045ea63d36b7dbd708e58c30445b5610feaae333 cd62add5c31a509f965aa294f44a1607ec7c62e3a9e3fe9ee063b3c814f4eb62 -lib/codeql/rust/generated/OffsetOfExpr.qll 58dfd632efcb48de7fe6ffbcb2192fcf95bfabdb407a751133f63a0e32ae7489 21ebb1b3d66849fc21c04083cfa751eb56c55809cd52664020bd61ccfbe5ea68 -lib/codeql/rust/generated/OrPat.qll f8fe5c7b83a08dabcc530484a696274930040ea13501ae20f1426faeec67bcf0 f3adb3148890531b698570a48740335983a5e81977ba4ac651778f940f184398 -lib/codeql/rust/generated/ParentChild.qll e1658ad4b3406b882726ed623e3668b99d1353c92c22f2939e2b7fc2b4053711 739da3c782d40cbd83c2b1d752376a0363802b64b950bea61e79cfb63bdd4f6d -lib/codeql/rust/generated/Pat.qll fe1c72856442dbab5655eff93f86c2cbce8d69d9fa1f99a0f9203061ea1112a4 d85d86e8b6c48df733589d186f610b1cd9086629180701e017774bddc62402c7 -lib/codeql/rust/generated/PathExpr.qll 3664ed2ad08097e4446b0fdad148118c754f8203541ae588d967ba9d79b6bf21 0d987d2358fe9b42e57585e7ae906de80e9f4ccf7c20e1d9bb7624ffbad96941 -lib/codeql/rust/generated/PathPat.qll acc4dda795bae97626a8d0041538f3ba1f0b591c743fed381cf198a8b04653cb c3deee1b3bb9bd37ae3ed4761d8ee2f498384fe5e1f5e31c0f9b99dfd864a0d5 +lib/codeql/rust/generated/LoopExpr.qll ddc646e715dced161b60638ac36a7671b45ddd6245a6876d647916d41495faf1 864be7033c093a8513be05691f772f19f99b606abe510f810af5f004596c0c7c +lib/codeql/rust/generated/MatchArm.qll e4e129ac42537138a3f5d288113ee805b49a5c914cf44564e59be389e07d6eda 5e5ae462925501265237f06a68549d5a26e01864386d16d0e28a12305127cb71 +lib/codeql/rust/generated/MatchExpr.qll 74966bd8286aa8cd4238c5f6964b5668d3f95fd47a56fcece47fbd0abe3a8376 9afcc11f0af8e5daee2746226b2c39bec0f9cbc74d0cb1bf567a8ea122409331 +lib/codeql/rust/generated/MethodCallExpr.qll 187d28d3869f5b44cca8420948266e8370ca1e3e389dc3317dc24364c8d53088 7a4744cce29b53ca04b6b2eaf4fd146b9a64e3f53151e5c6cd1085fc35d50823 +lib/codeql/rust/generated/MissingExpr.qll 34cb27c927a62cc06b0fe26a085e2658abd5019e549c3e01b8273d99e9a9616f 34bf4cfbf3659b600b4aac121f7c2d6da0b00b61c3002f8fb1d554c11968c748 +lib/codeql/rust/generated/MissingPat.qll 40fa87d446056c7263ef5843fb13fe60b644e169a65697be4ca0b5361a8267ee 40fa87d446056c7263ef5843fb13fe60b644e169a65697be4ca0b5361a8267ee +lib/codeql/rust/generated/Module.qll c6007444c796654fb48fbe4a4596580f08feec2aac13932043062a170dd73f0b 0560c738dbee3937baf0f2ab661c8e4dacd69eb886635241b1ff90f2c0f4bd67 +lib/codeql/rust/generated/OffsetOfExpr.qll 03afe5637df806f4649fb2c67fdc4f048a2faab47f00e8320f85025d4a2fa933 4e5c0c98b0397f1388ac0c27ea415f594ebd591e980dd70590ed043856beb156 +lib/codeql/rust/generated/OrPat.qll 52e637c652f8caf64d2388a1829159d187d3799384cc3318e07785f518ff0c4b 598a11d067519bb7bb279d8f8a3ea85a48ae99c2974182636c157ba111b9605e +lib/codeql/rust/generated/ParentChild.qll 98033de64e7d2db6f3574e0220aad773d04170aed7bf2b97ed4d97278f5837c5 5d9cd7f051f89df726af0fad1ccf8e2a456def82418397155a33858c58962364 +lib/codeql/rust/generated/Pat.qll b035e7866ea500232421ef9f79e7e60b90b9c27dbe47d25758548e94750d2965 adf701ad35559ea7d0284d6718ad507518778dc78100f48063e6a6bf3705c91f +lib/codeql/rust/generated/Path.qll ffd26e9e5e3878f374bc1163d6ccb47072cc1d3abd937d0206bf1a7c62c843ff ffd26e9e5e3878f374bc1163d6ccb47072cc1d3abd937d0206bf1a7c62c843ff +lib/codeql/rust/generated/PathExpr.qll c27d872e3351d92f8f105c6a4ae2f8f447209a4a139e00576986e641340d9e7d bb5bd1fed0d5caeac3c14d57ca8ee5d3ece8938aab753d488ff475bda8393229 +lib/codeql/rust/generated/PathPat.qll 8aaa7fd5f3439ce567f4d6f729e3ba1e98ab24255070b7d4ba7bbde6506d97f5 10bd82ea0e846c96afa34cc6e467101a490a1191b4edc29a7154a6d93a467f1c +lib/codeql/rust/generated/PrefixExpr.qll a3f6cc62e5a12acd253ea59cb6957fb7157aa709b888eed3cd974eb88e1346f3 830a5c729ed770df6247dff8adacce5dcf7f3a06649177ec9542e032cd4993ce lib/codeql/rust/generated/PureSynthConstructors.qll 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573 -lib/codeql/rust/generated/RangeExpr.qll f499d8c1f260d6262a55c1f3640aaee832ed8c9aac922cb2e05fefbca4509053 a01563640bc23fbce9d33da756bc209fd16155dc76a7fed4ba325979723f48a5 -lib/codeql/rust/generated/RangePat.qll 6ec95f6cb9c4bd93b38990bb1e3b89b526624305ac6ee7b94e6fb0a2f3db28fc 0e193f3816a7587d5103dba421bc2bf22b869522353d4e3f43d49a792eac6cf4 -lib/codeql/rust/generated/Raw.qll fcc1c9f3b06f7c1ae5ad6f7e7ab508c5fbbe9f13a5888db7e1a1e878d53b0f7e 45b6ee33b3ebe83d7f297eb0a9700da42648dc6228caed1e6649e940ea304907 -lib/codeql/rust/generated/RecordFieldPat.qll 26bed2285d849b9b7ac52d86131eacb40df912db350e423e81fb98c393c08a69 05ed735aecee90901a1bdfae05d9f85d7f6581616eca3a9262fdef6673222f9b -lib/codeql/rust/generated/RecordLitExpr.qll 1d3264446ff57e8b169f1ad6da150b2d457d6b60eda0ff63e2353eb8ef9e9113 f523dd5ce7f4bac0aafab7b27c6cfe766c72a9ee0c92d7a263347e67edf096df -lib/codeql/rust/generated/RecordLitField.qll bc704b56a986f3a399dc9c3dc2b61cca0d40cd389c694b9fe13374780835ffcc ab6b05a87f240a97cc2a8c15bb84a1338ad33ce367619125a8514e8815fd050e -lib/codeql/rust/generated/RecordPat.qll 5fd26e95dd23b07a847bd28c95a4206df62f7cc22c8d7b3bafa10e902e917d15 e264a96c2af4e2f64a394a119329b8b376d4b23ec6a3fc6d123c5631845bc4ef -lib/codeql/rust/generated/RefExpr.qll bb37b8bff64b0cf1f18de297487455692311b2006c45161f25969e131359c60f bfbc2b67b2b2ec66f3539e4972a947946b29e0ba527042593060eaf6b21e28ad -lib/codeql/rust/generated/RefPat.qll 3525331e8ba25a8612324e860423a39ddb29e8eb50a9f2bf62e49bf182d64b6d 804efbd32869f92e5515d34852fed6416288f99b0aab95b5be5cb5bdd1eea806 -lib/codeql/rust/generated/RepeatExpr.qll 43aff00e966e4550179d756489e4cbc30618d66c93c13530c45b031b9513b915 b91691445e6f7de67d61c787f41b36a383cf36da1a216c18767ac1d2ce5db34c -lib/codeql/rust/generated/ReturnExpr.qll 6160f3a14ff1cbd6a297edae015769f90e8e31201639828d8a9d0d6e38c1ef99 b8c8a12f78281e558d230c6959236780758e9645fe22aca697b948535c20f9be -lib/codeql/rust/generated/SlicePat.qll b4de6692eebf1205940e04da963adc20a07b15923c3c3a7a512a24e3bd8342c9 ee9b919983807f39d97cfe8ca66b76bdbfde76db02db5c93268ce22cbddf4213 -lib/codeql/rust/generated/Stmt.qll 55688c8f42f6e7fd1b871e572d75fac60d0543e38c4be4638abbb00187651d3d f978006a8453137f989249e849a7c935a090da3a9b0116145da80068760e12fd -lib/codeql/rust/generated/Synth.qll 6d1c4648a7f705bf5d7e8f8081f835c03feb6eee99bbf5fcca825902cb0cac20 620582c3743f8e0172288660bf5b2f344d8696620675ad0a04df20da55ba9c45 -lib/codeql/rust/generated/SynthConstructors.qll 15f62ecc76505a326df6a6d61896892ecbacdd1edc8bb4fede39f1a84e36431e 15f62ecc76505a326df6a6d61896892ecbacdd1edc8bb4fede39f1a84e36431e -lib/codeql/rust/generated/TupleExpr.qll 13e4dbc1afcabf388c793145cd399789f4014662f2eed1d49cbe96eeb8355413 bfa0708885c120bad24e29deb29641c69a5e5361654f3a144ead9543bfbd7197 -lib/codeql/rust/generated/TuplePat.qll 23911b2ac7ee2279df8ef40a6e447437ef0ed62518504b17874a7652bf5e3f4b fc4f6f7ea40754290de194ac55939f08549bd637104baf8dc84ca3938bcbd1f1 -lib/codeql/rust/generated/TupleStructPat.qll fff004cce780501eac94fe4b146619a84e02c85cae12ffeba5a4058e8c9738ea 738659f8208aa65d1d8cf601e0d92a90a890d6cbaec51cf04c81fc75a827e30b -lib/codeql/rust/generated/TypeRef.qll 7cc468c2f473ee13c11a97c4360100376560e8fc42f25a136f1500fe31a31533 7cc468c2f473ee13c11a97c4360100376560e8fc42f25a136f1500fe31a31533 -lib/codeql/rust/generated/UnaryOpExpr.qll fd55d4bc9cd1a49d1f38f02fef16771f29bb5fb2512abd18341d56665859d18c f271ef5036410c018f48d6f15b17cb9beaf4111a42fc638ac4ed3db974a5f870 -lib/codeql/rust/generated/UnderscoreExpr.qll cd7f615e41562b80d89e413c1c808048da7746fd445f0eb6ad8c5d9996b44d5d cd7f615e41562b80d89e413c1c808048da7746fd445f0eb6ad8c5d9996b44d5d -lib/codeql/rust/generated/Unimplemented.qll 375b7935b7f4103728ece3042282ae82d19e471d7a9fa58c8cbdea31ea0cb113 375b7935b7f4103728ece3042282ae82d19e471d7a9fa58c8cbdea31ea0cb113 -lib/codeql/rust/generated/UnsafeBlockExpr.qll 8464597373ea46f6391394f02c4ceb93ffe8441b434e6e71907b0a3369f72d8e 8464597373ea46f6391394f02c4ceb93ffe8441b434e6e71907b0a3369f72d8e -lib/codeql/rust/generated/WildPat.qll 8a2cede00ac2941cb94e294ffa81ada9ae6e61d8d8a720ce4f288740345802f8 8a2cede00ac2941cb94e294ffa81ada9ae6e61d8d8a720ce4f288740345802f8 -lib/codeql/rust/generated/YeetExpr.qll 2b37cf55ec26958cf226885e99d81c8bbc6ece69fbe92d9fcc8884ee0bc4aad4 e371531507311ea8a9fbaac74442fe9994ae85f0acdb79cc870e5318af52aba9 -lib/codeql/rust/generated/YieldExpr.qll 70ca98e14b24f12a3cbfe690417543fdce45b162f241834e2f7f58543aa11bda 40fe1281107317a7d80c7141229eed9c6904805dff615dfd0141ede2457e2c57 -test/extractor-tests/generated/Expr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +lib/codeql/rust/generated/RangeExpr.qll 1678fa524166552a36d73cad9d34213309b1989c1e427bc990b5c11a12588ce5 beb90978cea26a2ec9d3e8cc7b0b6a728ae952212ada5d6ad19319120f3218a8 +lib/codeql/rust/generated/RangePat.qll 2e96aece5ff2300659c2729c7037f7334790456d86160dc1e16ae99545c6ed0d eae4f95f9eaacbc2319ee67556dcc164527d82a6eaa5af59f6efce9caf3cba3b +lib/codeql/rust/generated/Raw.qll 358a5b315ed73e67446de7d4c32a6430832fa7cbf62f2be3ee0100c494ff3764 6b9628a5e9a8d6d953f87d332520652654292932225abc4d60c6a1dba1cd369c +lib/codeql/rust/generated/RecordExpr.qll bdafc10cde139617b67cb46bb205f99bc3fc0b9fd8634d304b81b524b9592aa8 2826c453c72416237467b08cf9ad9421b03203a8593420146dad8e1e71711b8a +lib/codeql/rust/generated/RecordExprField.qll eb06236fbdb856169dfe50ae1ebf59384222de6670ca91c34eed647823dda4ce 750bc7ab1e156db3927d6dd206e9d2c9388519425c0e8665afd322a6594aa5e2 +lib/codeql/rust/generated/RecordPat.qll 20b62cfd4ee4e911ad4a2b8e5762da2abb7ff0c1d7f21cc6f72b1ebcbebbcd42 c0502e6bfc637058524cf7369c63396ca5440c58e5e91600fecd35ca5299d86c +lib/codeql/rust/generated/RecordPatField.qll d862245163667ede676e407f109ad44e4ce732de59ea9025b696dd8b9803fbef 60166a21d7deee112325bc301b5893cf3072c4d8d095dbf9080cb00269b71d40 +lib/codeql/rust/generated/RefExpr.qll 917d810bda28f3f4319770ae5c8eb4ae40887f3c97669fde072078d3f5536114 7793027298da1fb787f8823146507f1ccfab046977cc71743045b3c2f3b5da02 +lib/codeql/rust/generated/RefPat.qll 1a0322f152758edb6650c530073cc6aead3d81ee51310e2d99936e10b56dac6d 5201f6455665c655daf6b9f686c66e14f9994b4d83624f0a478837a9a420cb0f +lib/codeql/rust/generated/RepeatExpr.qll 5a33101a5e2ba973beafe0d933ad5ca238050eb6f88638826dc37a712c05afaa c2cea180b7c068a3483cbda73168effe762ab2aa56bb8c590c8a15b6e54961ce +lib/codeql/rust/generated/ReturnExpr.qll 3d8fffeb6420a35d78f4f2e2e3e4ccf1c8454022c50395be2e8446f29740ddfa cc9dd916dc18114469d2eed9b82f83518af0de78797ad98777b29a5055bc77df +lib/codeql/rust/generated/SlicePat.qll 73dce5e310068357eb41e8c51923ff5c4054548db27987cde85735ddf071fc44 67fa0c285c110f18446689d1eaad9e82896df79d62999ad3f788fc295fa1d2c3 +lib/codeql/rust/generated/Stmt.qll 58b010f32956f2736a7b9ebb43467ecd03308a1f27c99e2b09bb925c349ac859 9859da4a4aa29b4f7ab47313b2dfe8baf9717a162fcd8bd62a7cbab4afd1886e +lib/codeql/rust/generated/Synth.qll 69415291e37195836bcc6810cccfdbacad4e1528bb125e26d2cc6b53daf1666b 6c79ab425ea2e132a2bc0eeea4f9f62cf3e259e911deb0c02c9fbdd56957e291 +lib/codeql/rust/generated/SynthConstructors.qll ff41f7bac5ae52e0eb4db378ddd389d65209d927046743852071650b86b4066a ff41f7bac5ae52e0eb4db378ddd389d65209d927046743852071650b86b4066a +lib/codeql/rust/generated/TupleExpr.qll 0828181e2f1f1f233598eab367688615356f6b91451a40f8d812d247d93467fc 2473c52d3dfbec6c8cd66bd439c85959e854f617edf5afe545252a24304f2f2e +lib/codeql/rust/generated/TuplePat.qll a1b22c20ca02497e9be8c6edaeaff214a669ecb0d2493890e79c28c485f512a1 5cc082ea99de61662b2d4c8b59f7a833236e7e448943e8ee894ab6066cc761c4 +lib/codeql/rust/generated/TupleStructPat.qll 089563349c9866f5703e9d306ba2a475d7d4002e7236dbbf2feeb89290b4d24c a77842d7262a7d19b175f239d1ee6550b3b66a4efe903c5112bb82c0abd7b05d +lib/codeql/rust/generated/TypeRef.qll 62cda2a3bd01a8c8356f11e5deb38ead4a8af630df27d88b8f60b5458d263527 62cda2a3bd01a8c8356f11e5deb38ead4a8af630df27d88b8f60b5458d263527 +lib/codeql/rust/generated/UnderscoreExpr.qll 964b77ddae265ad51fd03fcb7ef008fcb34eb5ea1a7ac0cd06ed84c1922fc07f 964b77ddae265ad51fd03fcb7ef008fcb34eb5ea1a7ac0cd06ed84c1922fc07f +lib/codeql/rust/generated/Unimplemented.qll bcf63c2be3e0f7b88704a76ed182616101cd4b317f539ef5a65e5a4b87fb6b39 0e3e0ba85e03f327334b752c1dd1aa82b71bf1601725fcc071d93a29e40e1188 +lib/codeql/rust/generated/UnimplementedDeclaration.qll a6eb4e61be018288304be010e063b68039a97f2cfe19e7049d3d54c65c88e9ab 662da5c38f5907d1f0f9990caca2114bf5e3b179591104dde777ae67262815df +lib/codeql/rust/generated/UnsafeBlockExpr.qll 52edde0daa57fea065f06537db05b5d442c63b3fa8777bf55ef2b2106c228ee9 52edde0daa57fea065f06537db05b5d442c63b3fa8777bf55ef2b2106c228ee9 +lib/codeql/rust/generated/WildcardPat.qll 84da49dc571151b0c5e0661426546a53d499ce37fe927ca07f67c4977dd70e16 84da49dc571151b0c5e0661426546a53d499ce37fe927ca07f67c4977dd70e16 +lib/codeql/rust/generated/YeetExpr.qll 0e673204c592b6025570098b14e0378a0e0c68d13be9217ce1543f2781667d42 6546ce98d42717d4e6932e1add628591e488d063ef2a79bf093b831645342e21 +lib/codeql/rust/generated/YieldExpr.qll 8f28a069a4a97d17a10b92200766f57ef0d372b88dd650f909167c7b3d643cc7 a0d8578c4f69e042788b7e1a8c066663541f1782589ea7521741d0b801ca0661 +test/extractor-tests/generated/AsmExpr/AsmExpr.ql 009b9c7470dc71fbd8bb75e17b180df196407550f0e4ddb9b760b58033c80245 03c2a6c81038d1f81058cf9d59a239c72db7f08e32faf694dbd976e93aa6fac1 +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql fae7f09b653698aa78626a268711bbd8336c9d6572ab9fe85967a8bec69e33f5 91dd5893cefeb9fd45dea49962dfee5a373be790f5ab3569f79d9ffa05613033 +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql de0941b5e2fad01300b77ac6db85ec37bd85b7d508b01e2b8a332c1ab9f6e787 7f9bdd81447cbc5a63b09c41a7d0edc15f826f7e672c518dc6fca08ae0107639 +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql 75f59d680d0f559dfc586306af2748c59c15789514a4ebca9f908ccc1fd63674 1a9f952485846fb93fc0afeabeb07845fa5c026520a0542302f971cb6b4d8e3e +test/extractor-tests/generated/AwaitExpr/AwaitExpr.ql bd2a401989b0f452b448fadd8d456dac9c46ca5ffe3775e5ac46e755782a4f20 c1922cdd6995a9c63eb841abf09f575bc78ec0be222062034b89ff63649a875e +test/extractor-tests/generated/BecomeExpr/BecomeExpr.ql 5661cb0d7b2285af31207232de2b685e851e4d70224cb16045bc0221c107de43 1fd41642343791d9b69e0c633ea3318c0a855f51f50062cb58225820a7540d50 +test/extractor-tests/generated/BinaryExpr/BinaryExpr.ql 3db360cb56d154f060175aceb5d14b14f51855b6b28ef3d67fb76b20ad239c01 4f4ff1915cc7f705d1ab5d6e507b28989f7ea19a7f76fc5ae6fb9dc11b31fcda +test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.ql 44e0664654d91130933e9c17909dc780866dc6e63b241079751f0356b8951ab9 97032408c8efea44a635b487365ada5d0564ec34c9d79901b6bc64c43a4962a6 +test/extractor-tests/generated/BlockExpr/BlockExpr.ql fd1bc52af4bad96423cb86b1eed02595e139e533f48533299e32b7b45360b47f 021b58c6e6cad40cc0707d0a78fd8c4ddbc529422d3bb9ac62c490b2abc1bb00 +test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql b02c87bba8bdbeffab05632133a17d36b355624d7521083cc6c0b02f88b2ba46 91141e01393ec04f4bb1f86373f5f25c837b13865ab540419050e6c547cc2690 +test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql 4de30a1e3c9de174688b8f9af57f72dfa6d9a2e3b3ab1b972ee69342ebd7ecad a6948240014d27fa9af7f56859cff2f8f7b44097f0bc47fbbb91b5be35e11d91 +test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql 6df26e837dc4f8ecf6dda674dfc89b2dce25da5dc3301beba461c5c1e1776201 b4e205949d06fa355997f5a399ce1f7c381023e38be4db4ecbcec676d8ebec69 +test/extractor-tests/generated/BoxExpr/BoxExpr.ql d74e58c16466ae5c08716eb027cb562ed50a96965fcaee3d0ebb64f1c9086c7b 9b01b9343cfa07e76de9ed781a5c03532fc740c8f794147d71815c98dfbcc076 +test/extractor-tests/generated/BoxPat/BoxPat.ql 1a5fd42309c669b3790a903d15b53d83ed5ccfa82409a1abba648b6fec39343a a4086b69da34827b14b63eee15eec3b951de14e941004024324fc00ec8680bc4 +test/extractor-tests/generated/BreakExpr/BreakExpr.ql 2897243d4fe6e0975f7621cff7a44609f6f0d015e77bff9c73a0dca32e3e7b44 6a072aa7f6ab27d6f6e887e7fe86213668c1bacce6cddfa2b1e65afcc13abce7 +test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.ql dd9b5ac06b3677eea02bc3204e3b23f212f29c418343a052befd903e622ffc32 f66a646c7efcb326ff70961df623761d342af4134677245e413cb9fc603334ab +test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.ql e338d2582b191d4ae1640504262d5a0d5ed23ddf850b5adfffb679a057f55e5e f57e618dac8c79d70e520d1508e70032662db8e4fc43b319365e195efcbdc847 +test/extractor-tests/generated/CallExpr/CallExpr.ql 2b91a02ad6f2ba6e200b2797dabda4dbcea08c7c2836d0a1be4bf47a7e7d786c 6830905e8993836f258c84b557f0f044dd5ebb32dad8d74089a903ca0d820eb5 +test/extractor-tests/generated/CallExpr/CallExpr_getArg.ql 0c7e6eb1bab788050c51ae36b954925c48618c5d6fb3129522eada6d911288be 251ae5a7119a2cfe427650c38e7df5d3c0a1711aa7a2ced21f5022798a5088d0 +test/extractor-tests/generated/CastExpr/CastExpr.ql 6028e49e8788d424ac83f7e70aca394c72834789d61517a26b9d6901f40ef734 a3fe7712c8d97fee8aa7505c3a2be03f296f8032207a24dd44f6dd91a463a068 +test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql 75fd05fb47e90426745d6c8ffff35cbcba3fb0792317155d0a139b7a4b87dd14 865a776a3312ef5e93a9a857a6ad7d66233e58547c4fa3ce924dbb320a324e2c +test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.ql 48fb8656a350ba16cc3cd291692b542dca137587ee971999c439700c74e6dcba 5ff21525959142237ee1a32c9feacf331083fb40502df6ddf78dfb8d93caed66 +test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.ql 34f8b8fc82e0c798f3cddc7ad1bb80a361c95da9d8a768fb787d6ffc3be1c755 9c14ee19cf74f516d201b8be72fe3496e425cfd42db223fb537cc92515e2b021 +test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql 43fb702201d21b8f716df8e128f1b7995604f5829b832a163672ab465c2fbde8 fc28c03768a514260ce0feae6d7c347508c4800054b184cb3f9004bbaca33fd6 +test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql 9ca3cf0695df6e71ad7c308ded9b1085474c105d85ea730d98921543a14029fc 45d17bb933d54f2dc56c95ef0a74b6cc00493eba6db3aec2b9319972675ff331 +test/extractor-tests/generated/ConstExpr/ConstExpr.ql 644c34489fd7deb3790f9de131d958cd96102d5c09eb3b07bbf5462b3e90d253 025192a0bd742c16baf8b627f3b8216442a74c6497b752dd1207f572743a0f5a +test/extractor-tests/generated/ContinueExpr/ContinueExpr.ql 259d98acb2d237ac630a7f92a26256f1af92372a3ef5b5feaf022b9b42a6a726 bed3e1332d65736194fa758e4a91433785e9da2ddc31d56c29ad27a7df392802 +test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.ql 0fa15905b4c06382ab6bde50d28804d7b0af4f53229e69fc8038a77f190f7b24 2fb577cb92456371f5f056fed5a07998914a27f560d41da43fc3b94827436cac +test/extractor-tests/generated/ElementListExpr/ElementListExpr.ql 22ba315472cfc2ea9cbe6759a0e2a3250b696cca823a992539545690bb4db2bd e968c8fe3592f17a2b84ea6ae2607d860c93fdfc49537940cbbe71f52e59f09d +test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.ql 0a327e668c653a31d98f64290db768f68383d103cce4354076a226df708fe982 50231f088f3d81abd66be0ab1bf7159f47f8705cec977677b15738897dba5342 +test/extractor-tests/generated/ExprStmt/ExprStmt.ql 037695af057183ef9e35569c9255625cb17b10590632aad4f9a917ab036a9b9e 8ded0651563b0447b3040303ad9e0b1bc9e2873ad5485ae4c6447f5893c77402 +test/extractor-tests/generated/FieldExpr/FieldExpr.ql 6d85c8b85905baf66ae1f6ed716e42530d814f86261d98eddceab861939227e5 5765fb0376978a9006e2dc175bb224c5c944f19ddf628a2b933b1bebf81015a2 test/extractor-tests/generated/Function/Function.ql c49434420dbb6fc3d9e6294161dcd3d3b306fae5ba5c85b610e534b8b15ef74c fe02208b673b74eebed92b5cbb3a8a06c31c0681eb28f3e596515663f14fa9e2 -test/extractor-tests/generated/Module/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e -test/extractor-tests/generated/Pat/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e -test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e -test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e -test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e -test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/GenericArgList/GenericArgList.ql f03097d3a9840ba08efa367d9da32011da8474e078eb13e14dd8a17955689887 57b9934868d324e7e99e9e79b8c3e2a5f760ba9ed6bed98b537dc3f5580253bd +test/extractor-tests/generated/IdentPat/IdentPat.ql dee6892ebf23f374f8e0403e7f6c4006f958159ecffc96dde8e4244e689ed7b4 0b48b337bc9ddc184ca240e3aafd9f5fdcfb1348f0a4e80106d4ce6541567f84 +test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.ql 725da30485e43fb0c42e6f888a14eba4e2f9d75cc5144d2c9831ccac5eb10496 e680e324500a34d3c70958f9976f5e3643e3403475ef57ccaf6d7a402b40f30f +test/extractor-tests/generated/IfExpr/IfExpr.ql 4463607934fd504a6b2d65829d8e336308af6908cf12387fe8bbaa3c8c5360bd 28b5580a4e628286023b5d0de549d087f0a4224ecbb02bc7b3197d8f404b5066 +test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql 4b4f3edfd0ed419fc580f3def6005760711874cc442c42ea817d70053ec07fca f97f65f91aa3f4967a2d3de836235d9c9a15f424cfced79d84f2580abf2c6077 +test/extractor-tests/generated/IndexExpr/IndexExpr.ql 6cfc282e84f9844630ebdb4dfc60f645d18a737d9b0e9f014c08476c935a92f7 86a336ac0193f0d6cc6fc7427b0423867a10323de0f95cda88f76a178c213430 +test/extractor-tests/generated/Label/Label.ql ba8cbde90392eef8f9faf6177776272dfb000abac260c6231fb00bff46ac1a39 4718da4da854e89513758c964f11117e329ed00e548e14890ec916c93500c529 +test/extractor-tests/generated/LetExpr/LetExpr.ql b311fb10d3a65cf682ced02aa4c9b589a84cb92adc653fbe630d471d88ca5f8a 3d93cc0cda8a6f34090d3000fee4a14e31fcf0fdc4d201a8d414e27cb8b9e4f4 +test/extractor-tests/generated/LetStmt/LetStmt.ql 842f58d8d744a567c44bf3742e4a9146339184903e0e119506b17f2958596bee 4900bc11ddedca66c8992b6384cd7bc1ae084bab93452bbf54e76b2e4342e46b +test/extractor-tests/generated/LetStmt/LetStmt_getElse.ql 88bd37786d0a738d2cb0c861a2411236d9dce09b98ff050b5f03b0888ed2f521 622d96d1e99fd174c284b7a3f05eddf30faf667cddff2eb942e01128488b398d +test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.ql 6e9a36a2a226ea0df1f01886bbd4e14997eb91f5b9422e37ce4985fd15a80622 ffbc3d9278e10aa78304cbc8876d96fe678a1d2f52ad170f651f842d1787156b +test/extractor-tests/generated/LetStmt/LetStmt_getType.ql 3326644b606a846afbd2eaf8ed4223eadb0061e23e953d085d2a3df0935ef534 c414e5a1f927779249a26c370ba07c82c99d489cb65f984003674b288a690109 +test/extractor-tests/generated/LiteralExpr/LiteralExpr.ql 9fb9c6336d1e3a657d988ffb53a43ce66b8403e46bea05d73d546ae774a647bc 708e2878eca3e9661e8b0d54180b4a6f512d9233178e9ad5683a1f72fa9656aa +test/extractor-tests/generated/LiteralPat/LiteralPat.ql b7636712d6a5e0b76c0195444514284b9d81ea948d42f19e683e134fe61f8a9a 9836c86f457b967ee9f5dd06f3c3206131d41bc838df60b5bd0ee8369a9a88fc +test/extractor-tests/generated/LoopExpr/LoopExpr.ql 58dabe29df959b265fa568cdde1b589d65ca8649c8aae0f30079565c1106ad72 929fd3c5c4f01f47f926c49f1a519d415063ff23d5e1fb2f2e8f72bb5aa7fdd6 +test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql 1febfb8cff9b4f7ba1a658a2832238d2355f0f609778af33a3877e977aaf1805 6b9c008b041beb1c0a7e249b7f4a1bd5cea0885f82543a8909a23a7068f1f837 +test/extractor-tests/generated/MatchArm/MatchArm.ql bf1ff34940f8682e69450bc3429b0e071ae2e31b94699cd7579dddf6126f821b 83329681067983788ac712fd72299719e4cd1ce85cea613e373751e6bed05f42 +test/extractor-tests/generated/MatchArm/MatchArm_getGuard.ql 2e99e932536c510e846a51bab4f4e153b1731131f144c813cfadb122d619864e 312c619de2aec0753e4fa66e0500fa67a9982989420a48dd16e75b5a04f01b9f +test/extractor-tests/generated/MatchExpr/MatchExpr.ql c2bf8277536a02691229a1866fb565b2bd2b3ee651cb1d38e1581db19239e0b9 901d909dc00b9f86815f5794d2639dc7367dfd04030d2404fc1e49e9c5948b81 +test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.ql a66b46c591bf9ce084e74a8b9cd7a0af5ab5e12e166b59cff0a1cc73a97278c3 58f20c67202abed5a9d659008333f3807663f85367db898dffe01bd2ba9c9b03 +test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.ql d09a8c2c0d277bfe4770822e79fdf94a2bc80e7b8bcd47361396a5a467aaa193 b6e9710ab5f6f2865c40cc155952e8833955f2c4c2cc5694f1008ffaa4d67bd5 +test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.ql 4d975396405739dbb05a4019add804b92d97b12c8ead6107603540ed2b3fefdb c66bcda4342519fe2179e2cdd67ff6ddc7b3e8a475432b611f6de20578eb2f6d +test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.ql 2226b4759bee9091d88a7d72be5d8f8ad43f17b07fdd1a1f64ae3da5aa6aa333 ee9e06838b879ce90b00d9289eea32fbda9c02e0074d306a2f1f5991956c7deb +test/extractor-tests/generated/MissingExpr/MissingExpr.ql bb85675a4b8a8118913fd91389f8282863613edda3fb804b917cce0675a8bb76 f2e600f8fb723f8f1bde4b0b0ef41f59b4e652882b5c788e8f6767822d5574e4 +test/extractor-tests/generated/MissingPat/MissingPat.ql 7a9ee46a40f6bfd31336beb6d9f6256fb8099cb6c052ba3131a95a45716224a4 619375e7dc6d95b8f1d1c958217350fc1553882f0f41ebd9f7a071d6947232d8 +test/extractor-tests/generated/Module/Module.ql 0afd07f619ee68a7f7270ebf9a4a6b7d6849448924083369c4101650854e1e77 b3239a1ebdde858179f4eba19e6c0cb3ea28b823f423fdff90f7b870b7fbf003 +test/extractor-tests/generated/Module/Module_getDeclaration.ql 8343f2b4be470a502c4bfdba9ef74173a440f45b7300aa9d517c2bd68ccac36a fc7666228fd1d3fe4fc63466aa04ee8adf62e9fe0008fd92ea337c8585a7fef5 +test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.ql 579e667797cb071784fa4c8e4e79bffd8b7a797bc70a68054ab51950dbebf4f0 dd92801d8909d83be1f824a2dfc599551c11b63ad1e96593e22d3b43464d7cf1 +test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.ql f18b39caeb2d9410cd1c4b472c31477da8dcff27ad43837e57c679a8eda0ca76 bb30037b5001d78585df9d23d9c4c73d1f864bb8b3778f402838f18acacfadc6 +test/extractor-tests/generated/OrPat/OrPat.ql 51d9a0f5993510542a2cca353c1ca48ba1e5fb97a65bee7f02398cd90debaa41 06e0936b80a07a16e22fad3a3a541000f170fd5ad301a3170b98a91f51d09144 +test/extractor-tests/generated/OrPat/OrPat_getArg.ql 693d62aa9817ce7661b4698c2948bca6567c1376b2ae832f3020462e8ab8d2ee 1fd9809826c6f2dece3014299f1d70210c9f23e5eefbd04b1d6024e1ecd46209 +test/extractor-tests/generated/Path/Path.ql 331bcbea004111727f36fb9325b53bf1ac87cc62ffcd68659636fa68786529fd 94ca6f7c3df16779cf6b340099330e5e1122d2e58708a8ab2aaf0f4c78a92200 +test/extractor-tests/generated/PathExpr/PathExpr.ql 3013e12d5dab5c38c5b8fcaec59e78a3c6477f4edc8b01b078ecbfe7b8f82ffb 40427c9d420456174e1524ed046a5f445b9b72ca8b87abefb6c9498d4c809fc5 +test/extractor-tests/generated/PathPat/PathPat.ql 57dd735fe179cc1b91ee66b7849bcdd1aabe661762e88e1678cdaaa53526a10c 1734a45d47ee484fbf2cadb5620b28874a904fe944030a9e39166a6a25aa0de7 +test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql e69ba11e6509519bf8cc527d21aacc330eba756a49b2b6c88422837aa0cbfe28 77424ea4db666f93de683562096d435dc88f141bfc0b1122187067299a775183 +test/extractor-tests/generated/RangeExpr/RangeExpr.ql c6e56a997c3543818ce6ffadabbab3bb233a099caa9e06e36519ac02f666dc93 0dcabe2df4c8ab3ba7b171cefb009a09c442ff71373f828c6c667bbb9eee2e45 +test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.ql 063ee8f6146110b97f4ee8944a5f37f0dd7cd5be049f13546d42a888a973d826 1184cc1fe937a01e9d12577478750be1497d4f99231486ae6d75104e7304eeb2 +test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.ql 6a7eb53c6b2a4587212f65c522387f726b2b9b3f204708a2a764e238aec8d89f 8b3095fdd9c6900eef656d4e9e18f5f4866b285634cc725e73246976af20450c +test/extractor-tests/generated/RangePat/RangePat.ql 4cb48cd2a96ecaa3998f70e2ef5b117749448d9166af743d3b8cfe6f90938665 d5a894f6e56b28c1438e37191ddd623d89e4eb07d5c979ae3795119de9d01e49 +test/extractor-tests/generated/RangePat/RangePat_getEnd.ql 823307f0e43fe6c02843417d254c6584e2ead04b961158f04494eb8197b9905e 016805e6063be3846cef24a5680f4f17e68ee9714430120aa91fface3461d97c +test/extractor-tests/generated/RangePat/RangePat_getStart.ql 1457a38514bf9fa7de44a4e5e3dd5218410149133074252bdf64d5eef5197d43 e9a6393aed20c710b2f19bc6482262664d8bc0245b5dfc35f636aa7966e0dba4 +test/extractor-tests/generated/RecordExpr/RecordExpr.ql 20dcdc18d2c8edeb06945915b87c77578000a67690e234c9f96d9f5520c53159 2e8d975f70a7d6ee8e9dd1c896eb95a4de079f4f4fa1031f6276e3212386c895 +test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.ql ef36c6fb3dd9d77c58b573661834d20d8176544137cbcd8f6c2a9c9aaa335574 d9d652ae1067dda138af2211a8b5fbc67129c571cb9c1faf5048e1e372cf1dd0 +test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql 6989f2b785813685e2233476abb13c0041a417d6a7e33179336739160f2569b7 fa1e08ee46ac863fdf69fc71b1823f18db6195aa66ea4a228c7c8eee3b448130 +test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.ql d221a3847a077d3574de6ea15ccf433f1bea24baa1080eb90f9e3d104f1ba22a 97b325e5fa8bc8af4968dc96bf5930d05bb4083d7a945ab6a34a55a7016da09d +test/extractor-tests/generated/RecordExprField/RecordExprField.ql c533740aecaae604d5c7d3261aa8df511d837b19fd74b4f88897373da6d932bd 037e33faf0195cb67314f7eef9571088391586366bf71a6fef3ef83845fb573c +test/extractor-tests/generated/RecordPat/RecordPat.ql 54bae18e24900a8a6ada5f72334e3507c17156227afd908c1b7354c11c6bafe1 8613ce169564ce0ab912bd9b3340ff3a8040f8f3ccd56d6dfd3a56eb59a00bd8 +test/extractor-tests/generated/RecordPat/RecordPat_getFld.ql 4bd86be1173bf404bc6901399be7da2b6f12d989f2ad2b158002de18b534e0e0 cbca368f9196d886affce4e1ee01bb5918c1a22a17dedd367f8cd943aefe06c2 +test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql d2730342a2203ad7d6385a64d53874050bd084fe74c05168df223499f7e86100 0d223ccb9c127100557b70da89f0c6ec7c559babc885bff46b97f5cb7b877e63 +test/extractor-tests/generated/RecordPatField/RecordPatField.ql 70babedca815ef3a5759a398993cd20645a43d45ada0e71ba68318811274606e 24635139cc3b95bfa36921008ff1db0455257ed0a0384b10ac267dbd4a125fb9 +test/extractor-tests/generated/RefExpr/RefExpr.ql e859cd59dbaa5aa5555aa13d4a75b7bfe2dbdb2d5c50675f3753adaaaabdedc2 d330ee941e9932054c32d0be5a52f38f285e4dc529821759ea38633f8ddbd517 +test/extractor-tests/generated/RefPat/RefPat.ql a5fa2a4435c11a935c0ed2dfb925874d44484dd0e0a6e31d50db7c1f63b1efaf e85077fdeb58983542b8a78f65bfc8498121fa699f5798c48dc59f1b74fa0b04 +test/extractor-tests/generated/RepeatExpr/RepeatExpr.ql a883874b6db9c084123b795ddc4b972f41da554a07d41b7d42242a4b4156ccc8 4aef5ebe3124ea3e13851df3e65d430b64740a3fda2fa4be4c6a3634e9f00fc1 +test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql 65397add1001e1593a303e3cec51e74aa4830a63e899b458a4247d017a84942d 34f138d22c9fa9195acd0c91a230dcf74dc5373db2315db0414aba710217720b +test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql bea07d8461c84e87bd642ca3af79aeff53f3ca3b79a6cd73ff8c514bcf213655 3cb63fb46da4d1c305694fd7a004016ab7c5ec96372279ce58cdb5c2e7a1dcc1 +test/extractor-tests/generated/SlicePat/SlicePat.ql 7170bbb932c27e90aaeb4bcc2fe35e8e919427fa420d8e2ea7097ad41b850fef 9fcbfce069e43e61832dba9d92c80b015a68e437683f5a3531b016dcd9de7824 +test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.ql e2f42681f3fc56b1e4dc1dafa8be1d20f164017eabc6144eae0a30fa4b8e7a38 235e67231d2650f9085fcc0ff28e116d8a1e499fbddf0db1352eb3517d9ba722 +test/extractor-tests/generated/SlicePat/SlicePat_getSlice.ql 9f57b88b0bbe4726577994c7980c284edb72139b7036aaa9c7dabc235cbafb48 38416e3490ab10ed512dac698aac9cf9b74cd2ab68ef1f9b5721ace18cb2d03f +test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.ql ba921a0d73d6d76a7c83c12c0cb3bdfe2c40c6a206777614c4898d51a7349cf7 c5c36d8e9e5a5177be29b84ade0653121ba0e7888a9eda59498bd61d2be38e26 +test/extractor-tests/generated/TupleExpr/TupleExpr.ql a14037288887ffd865289c4082e8438384344e3eeee9eed3bd4e36297670d94f b96191f6b65049e48899e72ac8e5b120ab3c6028bfa26df0e9c8aadd943c1023 +test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.ql bce5ec6f86043699d913abe258754c198cb1a562d0f1baa79c5d41e11377f622 8880feac2a89ded4e729b023fd8ef59350f44c30889e248c2e4db476544ec544 +test/extractor-tests/generated/TuplePat/TuplePat.ql 1f87a26474a0c39a9c238ec0218409e5e21a3253a94e0de9a87c526174c1d32d 579e3482ca83a9a6c35c3db8d202e52c67cdbb99ac00c19c5a1babe76b6e8acd +test/extractor-tests/generated/TuplePat/TuplePat_getArg.ql 97090448b81f1b347a4dfa4c954dadfeed09291ce03efe9fbb2f0cf95e16a815 549ccc1b8812f103fba5793cda3bb22544cea33dc5465166c506317d7156c4c8 +test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.ql 8f8bafa2ff18f3141bb2f2e33b19d1caf94c8814787b61f2e0147bf5e7f588e7 5333d06176129b818cf7f6caff772a4097cf62911378f99e88c2ea6036277f1f +test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql 2d14109d39c7519a113340f4223067a12ae715bdf4ad51b7c2c321ed90094731 36a7b3e17238a1eee8233364fa201aaec83347c9ce8de00b0e99d23bc0fc9cc3 +test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.ql f308a61384af5feebc58028a95d26499b6a666c7599b30aed33efbaca86c06b2 f298af5a861410281dee6cf22d3ceaa286a5be4d27968750321f2d016c34a0dd +test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.ql 47e84e7db2d1cc23aca4c28b5bba2826eeeaba07377eb8c8de5141bcb9c36ab8 a5c1d23e2521c38b12c0942c88403bea5a0d77a4763f273ffdf48eaa000a00ff +test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql 5f19a261ade6e3249029d7268cc0385092234a896e72ccdf8376a592be1d545e bb4fefecefaa2d9634f31026e5ec8bff561bacf55a4105727032bab08fdbdea3 +test/extractor-tests/generated/TypeRef/TypeRef.ql 73283955206c7e1ef71009969826e34c7f37624547c2ef39c80a23583cb37216 fedf7995b69805ce7ccc4e29aa592043cff2f7ac6730a70d27ed883d922b4684 +test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql 54cc3f7e6e9b9ac58922842dcd1960250e8bbb7ede5a63134ae622abc447be1e 1d5558d4ec9e4a1a510f37206772af3bf41015a99f1e9b83cc530db496dc2a5f +test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.ql ec74c75dedb4e669b3e6eba8f7568c415f5172c1ebd4f73e4710d401928448cc 8923aaaf5c5c70005aabc9696879ea73c5d9d83507c8db5a237cbab037953509 +test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.ql a743dbb15736b809e30769e1ea136afc9f0226885139150d6d1a5d353b6cb6fb 09849f178208406742007009da7f9b359b814477190d9d95370b94378e60be17 +test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.ql 4409e1c39b7729dc393a0d60f9d6aa0dfeed294a090285442de85ce746095eb5 572d88a9c879905519d9a63d5937949771f9c163ee2ea8ba4eabe0f16c28ca67 +test/extractor-tests/generated/WildcardPat/WildcardPat.ql 375da3e10385e17ff4005528e08629ce4aa6a796b2fb3aa20178f75615af0ede 16823ab6240a113c005136cb3747bd3e69de4b4e341eafb2d1f39956c7de749d +test/extractor-tests/generated/YeetExpr/YeetExpr.ql c5919f7f2f42b7dc08b0fefc553bb602a772925c226c943e2c96158adaea7797 a5bfdf225d9f9653f5aae00f30744d03f7d1045ddb4469f23e57194b3b1a2f8e +test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.ql 4ab79339d3f0a2a0334f66a7513ae5d27bcd608fdaf557da71757896e20f81b7 6d7b9da72a325b83539da4f353df2a0d4fcd11493773547ac89031525e7cd1fa +test/extractor-tests/generated/YieldExpr/YieldExpr.ql 3bf0ed6b4ec11dbe8b6af6cb0c51813c193e17bd9df0a23cdb1bf39cecddd915 0ff0219d5356bd9cb62df995577909898b4b28e0ecd860339361731e4f64e703 +test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.ql 944d36a39b4955638c5ae4972110ea84304691d34f39dccfe3ee3964033f383b 62c9be460d299afd0e994f412148ac37585d011efaceb9221be22ebc97943bc0 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 7cbeda2ad1b6..753ae9b6790d 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -1,6 +1,8 @@ /.generated.list linguist-generated /.gitattributes linguist-generated /lib/codeql/rust/elements/ArrayExpr.qll linguist-generated +/lib/codeql/rust/elements/AsmExpr.qll linguist-generated +/lib/codeql/rust/elements/AsmExprConstructor.qll linguist-generated /lib/codeql/rust/elements/AstNode.qll linguist-generated /lib/codeql/rust/elements/AsyncBlockExpr.qll linguist-generated /lib/codeql/rust/elements/AsyncBlockExprConstructor.qll linguist-generated @@ -8,10 +10,8 @@ /lib/codeql/rust/elements/AwaitExprConstructor.qll linguist-generated /lib/codeql/rust/elements/BecomeExpr.qll linguist-generated /lib/codeql/rust/elements/BecomeExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/BinaryOpExpr.qll linguist-generated -/lib/codeql/rust/elements/BinaryOpExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/BindPat.qll linguist-generated -/lib/codeql/rust/elements/BindPatConstructor.qll linguist-generated +/lib/codeql/rust/elements/BinaryExpr.qll linguist-generated +/lib/codeql/rust/elements/BinaryExprConstructor.qll linguist-generated /lib/codeql/rust/elements/BlockExpr.qll linguist-generated /lib/codeql/rust/elements/BlockExprBase.qll linguist-generated /lib/codeql/rust/elements/BlockExprConstructor.qll linguist-generated @@ -42,12 +42,14 @@ /lib/codeql/rust/elements/FieldExpr.qll linguist-generated /lib/codeql/rust/elements/FieldExprConstructor.qll linguist-generated /lib/codeql/rust/elements/FunctionConstructor.qll linguist-generated +/lib/codeql/rust/elements/GenericArgList.qll linguist-generated +/lib/codeql/rust/elements/GenericArgListConstructor.qll linguist-generated +/lib/codeql/rust/elements/IdentPat.qll linguist-generated +/lib/codeql/rust/elements/IdentPatConstructor.qll linguist-generated /lib/codeql/rust/elements/IfExpr.qll linguist-generated /lib/codeql/rust/elements/IfExprConstructor.qll linguist-generated /lib/codeql/rust/elements/IndexExpr.qll linguist-generated /lib/codeql/rust/elements/IndexExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/InlineAsmExpr.qll linguist-generated -/lib/codeql/rust/elements/InlineAsmExprConstructor.qll linguist-generated /lib/codeql/rust/elements/ItemStmt.qll linguist-generated /lib/codeql/rust/elements/ItemStmtConstructor.qll linguist-generated /lib/codeql/rust/elements/Label.qll linguist-generated @@ -56,10 +58,10 @@ /lib/codeql/rust/elements/LetExprConstructor.qll linguist-generated /lib/codeql/rust/elements/LetStmt.qll linguist-generated /lib/codeql/rust/elements/LetStmtConstructor.qll linguist-generated -/lib/codeql/rust/elements/LitPat.qll linguist-generated -/lib/codeql/rust/elements/LitPatConstructor.qll linguist-generated /lib/codeql/rust/elements/LiteralExpr.qll linguist-generated /lib/codeql/rust/elements/LiteralExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/LiteralPat.qll linguist-generated +/lib/codeql/rust/elements/LiteralPatConstructor.qll linguist-generated /lib/codeql/rust/elements/LoopExpr.qll linguist-generated /lib/codeql/rust/elements/LoopExprConstructor.qll linguist-generated /lib/codeql/rust/elements/MatchArm.qll linguist-generated @@ -79,22 +81,26 @@ /lib/codeql/rust/elements/OrPat.qll linguist-generated /lib/codeql/rust/elements/OrPatConstructor.qll linguist-generated /lib/codeql/rust/elements/Pat.qll linguist-generated +/lib/codeql/rust/elements/Path.qll linguist-generated +/lib/codeql/rust/elements/PathConstructor.qll linguist-generated /lib/codeql/rust/elements/PathExpr.qll linguist-generated /lib/codeql/rust/elements/PathExprConstructor.qll linguist-generated /lib/codeql/rust/elements/PathPat.qll linguist-generated /lib/codeql/rust/elements/PathPatConstructor.qll linguist-generated +/lib/codeql/rust/elements/PrefixExpr.qll linguist-generated +/lib/codeql/rust/elements/PrefixExprConstructor.qll linguist-generated /lib/codeql/rust/elements/RangeExpr.qll linguist-generated /lib/codeql/rust/elements/RangeExprConstructor.qll linguist-generated /lib/codeql/rust/elements/RangePat.qll linguist-generated /lib/codeql/rust/elements/RangePatConstructor.qll linguist-generated -/lib/codeql/rust/elements/RecordFieldPat.qll linguist-generated -/lib/codeql/rust/elements/RecordFieldPatConstructor.qll linguist-generated -/lib/codeql/rust/elements/RecordLitExpr.qll linguist-generated -/lib/codeql/rust/elements/RecordLitExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/RecordLitField.qll linguist-generated -/lib/codeql/rust/elements/RecordLitFieldConstructor.qll linguist-generated +/lib/codeql/rust/elements/RecordExpr.qll linguist-generated +/lib/codeql/rust/elements/RecordExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/RecordExprField.qll linguist-generated +/lib/codeql/rust/elements/RecordExprFieldConstructor.qll linguist-generated /lib/codeql/rust/elements/RecordPat.qll linguist-generated /lib/codeql/rust/elements/RecordPatConstructor.qll linguist-generated +/lib/codeql/rust/elements/RecordPatField.qll linguist-generated +/lib/codeql/rust/elements/RecordPatFieldConstructor.qll linguist-generated /lib/codeql/rust/elements/RefExpr.qll linguist-generated /lib/codeql/rust/elements/RefExprConstructor.qll linguist-generated /lib/codeql/rust/elements/RefPat.qll linguist-generated @@ -114,28 +120,27 @@ /lib/codeql/rust/elements/TupleStructPatConstructor.qll linguist-generated /lib/codeql/rust/elements/TypeRef.qll linguist-generated /lib/codeql/rust/elements/TypeRefConstructor.qll linguist-generated -/lib/codeql/rust/elements/UnaryOpExpr.qll linguist-generated -/lib/codeql/rust/elements/UnaryOpExprConstructor.qll linguist-generated /lib/codeql/rust/elements/UnderscoreExpr.qll linguist-generated /lib/codeql/rust/elements/UnderscoreExprConstructor.qll linguist-generated /lib/codeql/rust/elements/Unimplemented.qll linguist-generated -/lib/codeql/rust/elements/UnimplementedConstructor.qll linguist-generated +/lib/codeql/rust/elements/UnimplementedDeclaration.qll linguist-generated +/lib/codeql/rust/elements/UnimplementedDeclarationConstructor.qll linguist-generated /lib/codeql/rust/elements/UnsafeBlockExpr.qll linguist-generated /lib/codeql/rust/elements/UnsafeBlockExprConstructor.qll linguist-generated -/lib/codeql/rust/elements/WildPat.qll linguist-generated -/lib/codeql/rust/elements/WildPatConstructor.qll linguist-generated +/lib/codeql/rust/elements/WildcardPat.qll linguist-generated +/lib/codeql/rust/elements/WildcardPatConstructor.qll linguist-generated /lib/codeql/rust/elements/YeetExpr.qll linguist-generated /lib/codeql/rust/elements/YeetExprConstructor.qll linguist-generated /lib/codeql/rust/elements/YieldExpr.qll linguist-generated /lib/codeql/rust/elements/YieldExprConstructor.qll linguist-generated /lib/codeql/rust/elements.qll linguist-generated /lib/codeql/rust/generated/ArrayExpr.qll linguist-generated +/lib/codeql/rust/generated/AsmExpr.qll linguist-generated /lib/codeql/rust/generated/AstNode.qll linguist-generated /lib/codeql/rust/generated/AsyncBlockExpr.qll linguist-generated /lib/codeql/rust/generated/AwaitExpr.qll linguist-generated /lib/codeql/rust/generated/BecomeExpr.qll linguist-generated -/lib/codeql/rust/generated/BinaryOpExpr.qll linguist-generated -/lib/codeql/rust/generated/BindPat.qll linguist-generated +/lib/codeql/rust/generated/BinaryExpr.qll linguist-generated /lib/codeql/rust/generated/BlockExpr.qll linguist-generated /lib/codeql/rust/generated/BlockExprBase.qll linguist-generated /lib/codeql/rust/generated/BoxExpr.qll linguist-generated @@ -154,15 +159,16 @@ /lib/codeql/rust/generated/ExprStmt.qll linguist-generated /lib/codeql/rust/generated/FieldExpr.qll linguist-generated /lib/codeql/rust/generated/Function.qll linguist-generated +/lib/codeql/rust/generated/GenericArgList.qll linguist-generated +/lib/codeql/rust/generated/IdentPat.qll linguist-generated /lib/codeql/rust/generated/IfExpr.qll linguist-generated /lib/codeql/rust/generated/IndexExpr.qll linguist-generated -/lib/codeql/rust/generated/InlineAsmExpr.qll linguist-generated /lib/codeql/rust/generated/ItemStmt.qll linguist-generated /lib/codeql/rust/generated/Label.qll linguist-generated /lib/codeql/rust/generated/LetExpr.qll linguist-generated /lib/codeql/rust/generated/LetStmt.qll linguist-generated -/lib/codeql/rust/generated/LitPat.qll linguist-generated /lib/codeql/rust/generated/LiteralExpr.qll linguist-generated +/lib/codeql/rust/generated/LiteralPat.qll linguist-generated /lib/codeql/rust/generated/Locatable.qll linguist-generated /lib/codeql/rust/generated/LoopExpr.qll linguist-generated /lib/codeql/rust/generated/MatchArm.qll linguist-generated @@ -175,16 +181,18 @@ /lib/codeql/rust/generated/OrPat.qll linguist-generated /lib/codeql/rust/generated/ParentChild.qll linguist-generated /lib/codeql/rust/generated/Pat.qll linguist-generated +/lib/codeql/rust/generated/Path.qll linguist-generated /lib/codeql/rust/generated/PathExpr.qll linguist-generated /lib/codeql/rust/generated/PathPat.qll linguist-generated +/lib/codeql/rust/generated/PrefixExpr.qll linguist-generated /lib/codeql/rust/generated/PureSynthConstructors.qll linguist-generated /lib/codeql/rust/generated/RangeExpr.qll linguist-generated /lib/codeql/rust/generated/RangePat.qll linguist-generated /lib/codeql/rust/generated/Raw.qll linguist-generated -/lib/codeql/rust/generated/RecordFieldPat.qll linguist-generated -/lib/codeql/rust/generated/RecordLitExpr.qll linguist-generated -/lib/codeql/rust/generated/RecordLitField.qll linguist-generated +/lib/codeql/rust/generated/RecordExpr.qll linguist-generated +/lib/codeql/rust/generated/RecordExprField.qll linguist-generated /lib/codeql/rust/generated/RecordPat.qll linguist-generated +/lib/codeql/rust/generated/RecordPatField.qll linguist-generated /lib/codeql/rust/generated/RefExpr.qll linguist-generated /lib/codeql/rust/generated/RefPat.qll linguist-generated /lib/codeql/rust/generated/RepeatExpr.qll linguist-generated @@ -197,18 +205,121 @@ /lib/codeql/rust/generated/TuplePat.qll linguist-generated /lib/codeql/rust/generated/TupleStructPat.qll linguist-generated /lib/codeql/rust/generated/TypeRef.qll linguist-generated -/lib/codeql/rust/generated/UnaryOpExpr.qll linguist-generated /lib/codeql/rust/generated/UnderscoreExpr.qll linguist-generated /lib/codeql/rust/generated/Unimplemented.qll linguist-generated +/lib/codeql/rust/generated/UnimplementedDeclaration.qll linguist-generated /lib/codeql/rust/generated/UnsafeBlockExpr.qll linguist-generated -/lib/codeql/rust/generated/WildPat.qll linguist-generated +/lib/codeql/rust/generated/WildcardPat.qll linguist-generated /lib/codeql/rust/generated/YeetExpr.qll linguist-generated /lib/codeql/rust/generated/YieldExpr.qll linguist-generated -/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/AsmExpr/AsmExpr.ql linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql linguist-generated +/test/extractor-tests/generated/AwaitExpr/AwaitExpr.ql linguist-generated +/test/extractor-tests/generated/BecomeExpr/BecomeExpr.ql linguist-generated +/test/extractor-tests/generated/BinaryExpr/BinaryExpr.ql linguist-generated +/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql linguist-generated +/test/extractor-tests/generated/BoxExpr/BoxExpr.ql linguist-generated +/test/extractor-tests/generated/BoxPat/BoxPat.ql linguist-generated +/test/extractor-tests/generated/BreakExpr/BreakExpr.ql linguist-generated +/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.ql linguist-generated +/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.ql linguist-generated +/test/extractor-tests/generated/CallExpr/CallExpr.ql linguist-generated +/test/extractor-tests/generated/CallExpr/CallExpr_getArg.ql linguist-generated +/test/extractor-tests/generated/CastExpr/CastExpr.ql linguist-generated +/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql linguist-generated +/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.ql linguist-generated +/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.ql linguist-generated +/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql linguist-generated +/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql linguist-generated +/test/extractor-tests/generated/ConstExpr/ConstExpr.ql linguist-generated +/test/extractor-tests/generated/ContinueExpr/ContinueExpr.ql linguist-generated +/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.ql linguist-generated +/test/extractor-tests/generated/ElementListExpr/ElementListExpr.ql linguist-generated +/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.ql linguist-generated +/test/extractor-tests/generated/ExprStmt/ExprStmt.ql linguist-generated +/test/extractor-tests/generated/FieldExpr/FieldExpr.ql linguist-generated /test/extractor-tests/generated/Function/Function.ql linguist-generated -/test/extractor-tests/generated/Module/MISSING_SOURCE.txt linguist-generated -/test/extractor-tests/generated/Pat/MISSING_SOURCE.txt linguist-generated -/test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt linguist-generated -/test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt linguist-generated -/test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt linguist-generated -/test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/GenericArgList/GenericArgList.ql linguist-generated +/test/extractor-tests/generated/IdentPat/IdentPat.ql linguist-generated +/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.ql linguist-generated +/test/extractor-tests/generated/IfExpr/IfExpr.ql linguist-generated +/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql linguist-generated +/test/extractor-tests/generated/IndexExpr/IndexExpr.ql linguist-generated +/test/extractor-tests/generated/Label/Label.ql linguist-generated +/test/extractor-tests/generated/LetExpr/LetExpr.ql linguist-generated +/test/extractor-tests/generated/LetStmt/LetStmt.ql linguist-generated +/test/extractor-tests/generated/LetStmt/LetStmt_getElse.ql linguist-generated +/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.ql linguist-generated +/test/extractor-tests/generated/LetStmt/LetStmt_getType.ql linguist-generated +/test/extractor-tests/generated/LiteralExpr/LiteralExpr.ql linguist-generated +/test/extractor-tests/generated/LiteralPat/LiteralPat.ql linguist-generated +/test/extractor-tests/generated/LoopExpr/LoopExpr.ql linguist-generated +/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql linguist-generated +/test/extractor-tests/generated/MatchArm/MatchArm.ql linguist-generated +/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.ql linguist-generated +/test/extractor-tests/generated/MatchExpr/MatchExpr.ql linguist-generated +/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.ql linguist-generated +/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.ql linguist-generated +/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.ql linguist-generated +/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.ql linguist-generated +/test/extractor-tests/generated/MissingExpr/MissingExpr.ql linguist-generated +/test/extractor-tests/generated/MissingPat/MissingPat.ql linguist-generated +/test/extractor-tests/generated/Module/Module.ql linguist-generated +/test/extractor-tests/generated/Module/Module_getDeclaration.ql linguist-generated +/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.ql linguist-generated +/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.ql linguist-generated +/test/extractor-tests/generated/OrPat/OrPat.ql linguist-generated +/test/extractor-tests/generated/OrPat/OrPat_getArg.ql linguist-generated +/test/extractor-tests/generated/Path/Path.ql linguist-generated +/test/extractor-tests/generated/PathExpr/PathExpr.ql linguist-generated +/test/extractor-tests/generated/PathPat/PathPat.ql linguist-generated +/test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql linguist-generated +/test/extractor-tests/generated/RangeExpr/RangeExpr.ql linguist-generated +/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.ql linguist-generated +/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.ql linguist-generated +/test/extractor-tests/generated/RangePat/RangePat.ql linguist-generated +/test/extractor-tests/generated/RangePat/RangePat_getEnd.ql linguist-generated +/test/extractor-tests/generated/RangePat/RangePat_getStart.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql linguist-generated +/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.ql linguist-generated +/test/extractor-tests/generated/RecordExprField/RecordExprField.ql linguist-generated +/test/extractor-tests/generated/RecordPat/RecordPat.ql linguist-generated +/test/extractor-tests/generated/RecordPat/RecordPat_getFld.ql linguist-generated +/test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql linguist-generated +/test/extractor-tests/generated/RecordPatField/RecordPatField.ql linguist-generated +/test/extractor-tests/generated/RefExpr/RefExpr.ql linguist-generated +/test/extractor-tests/generated/RefPat/RefPat.ql linguist-generated +/test/extractor-tests/generated/RepeatExpr/RepeatExpr.ql linguist-generated +/test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql linguist-generated +/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql linguist-generated +/test/extractor-tests/generated/SlicePat/SlicePat.ql linguist-generated +/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.ql linguist-generated +/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.ql linguist-generated +/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.ql linguist-generated +/test/extractor-tests/generated/TupleExpr/TupleExpr.ql linguist-generated +/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.ql linguist-generated +/test/extractor-tests/generated/TuplePat/TuplePat.ql linguist-generated +/test/extractor-tests/generated/TuplePat/TuplePat_getArg.ql linguist-generated +/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.ql linguist-generated +/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql linguist-generated +/test/extractor-tests/generated/TypeRef/TypeRef.ql linguist-generated +/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql linguist-generated +/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.ql linguist-generated +/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.ql linguist-generated +/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.ql linguist-generated +/test/extractor-tests/generated/WildcardPat/WildcardPat.ql linguist-generated +/test/extractor-tests/generated/YeetExpr/YeetExpr.ql linguist-generated +/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.ql linguist-generated +/test/extractor-tests/generated/YieldExpr/YieldExpr.ql linguist-generated +/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.ql linguist-generated diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 1370362bf0f0..5f49d7177546 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -81,7 +81,7 @@ class CallExprTree extends StandardPostOrderTree instanceof CallExpr { override ControlFlowTree getChildNode(int i) { result = super.getArg(i) } } -class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryOpExpr { +class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryExpr { override ControlFlowTree getChildNode(int i) { i = 0 and result = super.getLhs() or diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index c470b41d84c7..64342d92af2c 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -4,12 +4,12 @@ */ import codeql.rust.elements.ArrayExpr +import codeql.rust.elements.AsmExpr import codeql.rust.elements.AstNode import codeql.rust.elements.AsyncBlockExpr import codeql.rust.elements.AwaitExpr import codeql.rust.elements.BecomeExpr -import codeql.rust.elements.BinaryOpExpr -import codeql.rust.elements.BindPat +import codeql.rust.elements.BinaryExpr import codeql.rust.elements.BlockExpr import codeql.rust.elements.BlockExprBase import codeql.rust.elements.BoxExpr @@ -28,15 +28,16 @@ import codeql.rust.elements.Expr import codeql.rust.elements.ExprStmt import codeql.rust.elements.FieldExpr import codeql.rust.elements.Function +import codeql.rust.elements.GenericArgList +import codeql.rust.elements.IdentPat import codeql.rust.elements.IfExpr import codeql.rust.elements.IndexExpr -import codeql.rust.elements.InlineAsmExpr import codeql.rust.elements.ItemStmt import codeql.rust.elements.Label import codeql.rust.elements.LetExpr import codeql.rust.elements.LetStmt -import codeql.rust.elements.LitPat import codeql.rust.elements.LiteralExpr +import codeql.rust.elements.LiteralPat import codeql.rust.elements.Locatable import codeql.rust.elements.LoopExpr import codeql.rust.elements.MatchArm @@ -48,14 +49,16 @@ import codeql.rust.elements.Module import codeql.rust.elements.OffsetOfExpr import codeql.rust.elements.OrPat import codeql.rust.elements.Pat +import codeql.rust.elements.Path import codeql.rust.elements.PathExpr import codeql.rust.elements.PathPat +import codeql.rust.elements.PrefixExpr import codeql.rust.elements.RangeExpr import codeql.rust.elements.RangePat -import codeql.rust.elements.RecordFieldPat -import codeql.rust.elements.RecordLitExpr -import codeql.rust.elements.RecordLitField +import codeql.rust.elements.RecordExpr +import codeql.rust.elements.RecordExprField import codeql.rust.elements.RecordPat +import codeql.rust.elements.RecordPatField import codeql.rust.elements.RefExpr import codeql.rust.elements.RefPat import codeql.rust.elements.RepeatExpr @@ -66,10 +69,10 @@ import codeql.rust.elements.TupleExpr import codeql.rust.elements.TuplePat import codeql.rust.elements.TupleStructPat import codeql.rust.elements.TypeRef -import codeql.rust.elements.UnaryOpExpr import codeql.rust.elements.UnderscoreExpr import codeql.rust.elements.Unimplemented +import codeql.rust.elements.UnimplementedDeclaration import codeql.rust.elements.UnsafeBlockExpr -import codeql.rust.elements.WildPat +import codeql.rust.elements.WildcardPat import codeql.rust.elements.YeetExpr import codeql.rust.elements.YieldExpr diff --git a/rust/ql/lib/codeql/rust/elements/ArrayExpr.qll b/rust/ql/lib/codeql/rust/elements/ArrayExpr.qll index b0328ef9382b..6ac6a1e2f01f 100644 --- a/rust/ql/lib/codeql/rust/elements/ArrayExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ArrayExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.ArrayExpr +/** + * An array expression. For example: + * ``` + * [1, 2, 3]; + * [1; 10]; + * ``` + */ class ArrayExpr extends Generated::ArrayExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/AsmExpr.qll b/rust/ql/lib/codeql/rust/elements/AsmExpr.qll new file mode 100644 index 000000000000..9e9038c76806 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/AsmExpr.qll @@ -0,0 +1,16 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `AsmExpr`. + */ + +private import codeql.rust.generated.AsmExpr + +/** + * An inline assembly expression. For example: + * ``` + * unsafe { + * builtin # asm(_); + * } + * ``` + */ +class AsmExpr extends Generated::AsmExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/WildPatConstructor.qll b/rust/ql/lib/codeql/rust/elements/AsmExprConstructor.qll similarity index 64% rename from rust/ql/lib/codeql/rust/elements/WildPatConstructor.qll rename to rust/ql/lib/codeql/rust/elements/AsmExprConstructor.qll index 13375a8d8aef..0a65d8b6d491 100644 --- a/rust/ql/lib/codeql/rust/elements/WildPatConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/AsmExprConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `WildPat` synthesized instances. + * `AsmExpr` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `WildPat` synthesized instances. + * The characteristic predicate of `AsmExpr` synthesized instances. * INTERNAL: Do not use. */ -predicate constructWildPat(Raw::WildPat id) { any() } +predicate constructAsmExpr(Raw::AsmExpr id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll b/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll index e024eec6e920..c07aaa28f5d4 100644 --- a/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.AsyncBlockExpr +/** + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` + */ class AsyncBlockExpr extends Generated::AsyncBlockExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/AwaitExpr.qll b/rust/ql/lib/codeql/rust/elements/AwaitExpr.qll index 420be7dc8408..47a3773b555c 100644 --- a/rust/ql/lib/codeql/rust/elements/AwaitExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/AwaitExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.AwaitExpr +/** + * An `await` expression. For example: + * ``` + * async { + * let x = foo().await; + * x + * } + * ``` + */ class AwaitExpr extends Generated::AwaitExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BecomeExpr.qll b/rust/ql/lib/codeql/rust/elements/BecomeExpr.qll index 6893087ec0e4..6af07fe750cc 100644 --- a/rust/ql/lib/codeql/rust/elements/BecomeExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BecomeExpr.qll @@ -5,4 +5,15 @@ private import codeql.rust.generated.BecomeExpr +/** + * A `become` expression. For example: + * ``` + * fn fact_a(n: i32, a: i32) -> i32 { + * if n == 0 { + * a + * } else { + * become fact_a(n - 1, n * a) + * } + * } ``` + */ class BecomeExpr extends Generated::BecomeExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BinaryExpr.qll b/rust/ql/lib/codeql/rust/elements/BinaryExpr.qll new file mode 100644 index 000000000000..b2d251d79208 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/BinaryExpr.qll @@ -0,0 +1,18 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `BinaryExpr`. + */ + +private import codeql.rust.generated.BinaryExpr + +/** + * A binary operation expression. For example: + * ``` + * x + y; + * x && y; + * x <= y; + * x = y; + * x += y; + * ``` + */ +class BinaryExpr extends Generated::BinaryExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BinaryExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/BinaryExprConstructor.qll new file mode 100644 index 000000000000..46c40c87be77 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/BinaryExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `BinaryExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.rust.generated.Raw + +/** + * The characteristic predicate of `BinaryExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructBinaryExpr(Raw::BinaryExpr id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/BinaryOpExpr.qll b/rust/ql/lib/codeql/rust/elements/BinaryOpExpr.qll deleted file mode 100644 index e5de5d9aa453..000000000000 --- a/rust/ql/lib/codeql/rust/elements/BinaryOpExpr.qll +++ /dev/null @@ -1,8 +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 `BinaryOpExpr`. - */ - -private import codeql.rust.generated.BinaryOpExpr - -class BinaryOpExpr extends Generated::BinaryOpExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BindPat.qll b/rust/ql/lib/codeql/rust/elements/BindPat.qll deleted file mode 100644 index eb0d2b00448e..000000000000 --- a/rust/ql/lib/codeql/rust/elements/BindPat.qll +++ /dev/null @@ -1,8 +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 `BindPat`. - */ - -private import codeql.rust.generated.BindPat - -class BindPat extends Generated::BindPat { } diff --git a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll index 0ba5e1a2eb8d..f8f93be4f5c2 100644 --- a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll @@ -5,4 +5,18 @@ private import codeql.rust.generated.BlockExpr +/** + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` + */ class BlockExpr extends Generated::BlockExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BoxExpr.qll b/rust/ql/lib/codeql/rust/elements/BoxExpr.qll index 1525f7796f58..f61555a0e03f 100644 --- a/rust/ql/lib/codeql/rust/elements/BoxExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BoxExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.BoxExpr +/** + * A box expression. For example: + * ``` + * let x = #[rustc_box] Box::new(42); + * ``` + */ class BoxExpr extends Generated::BoxExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BoxPat.qll b/rust/ql/lib/codeql/rust/elements/BoxPat.qll index e2b1d9b7e779..ba0d1d732ffc 100644 --- a/rust/ql/lib/codeql/rust/elements/BoxPat.qll +++ b/rust/ql/lib/codeql/rust/elements/BoxPat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.BoxPat +/** + * A box pattern. For example: + * ``` + * match x { + * box Option::Some(y) => y, + * box Option::None => 0, + * }; + * ``` + */ class BoxPat extends Generated::BoxPat { } diff --git a/rust/ql/lib/codeql/rust/elements/BreakExpr.qll b/rust/ql/lib/codeql/rust/elements/BreakExpr.qll index cd98d7003a05..c8b23f6685d2 100644 --- a/rust/ql/lib/codeql/rust/elements/BreakExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BreakExpr.qll @@ -5,4 +5,21 @@ private import codeql.rust.generated.BreakExpr +/** + * A break expression. For example: + * ``` + * loop { + * if not_ready() { + * break; + * } + * } + * ``` + * ``` + * let x = 'label: loop { + * if done() { + * break 'label 42; + * } + * }; + * ``` + */ class BreakExpr extends Generated::BreakExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/CallExpr.qll b/rust/ql/lib/codeql/rust/elements/CallExpr.qll index ee14b172e50c..ef1b34fd7038 100644 --- a/rust/ql/lib/codeql/rust/elements/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/CallExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.CallExpr +/** + * A function call expression. For example: + * ``` + * foo(42); + * foo::(42); + * foo[0](42); + * foo(1) = 4; + * ``` + */ class CallExpr extends Generated::CallExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/CastExpr.qll b/rust/ql/lib/codeql/rust/elements/CastExpr.qll index 3b7b41955cd8..3dcafca58965 100644 --- a/rust/ql/lib/codeql/rust/elements/CastExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/CastExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.CastExpr +/** + * A cast expression. For example: + * ``` + * value as u64; + * ``` + */ class CastExpr extends Generated::CastExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ClosureExpr.qll b/rust/ql/lib/codeql/rust/elements/ClosureExpr.qll index 661d98ce1b27..863897ac6419 100644 --- a/rust/ql/lib/codeql/rust/elements/ClosureExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ClosureExpr.qll @@ -5,4 +5,16 @@ private import codeql.rust.generated.ClosureExpr +/** + * A closure expression. For example: + * ``` + * |x| x + 1; + * move |x: i32| -> i32 { x + 1 }; + * async |x: i32, y| x + y; + * #[coroutine] + * |x| yield x; + * #[coroutine] + * static |x| yield x; + * ``` + */ class ClosureExpr extends Generated::ClosureExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ConstBlockPat.qll b/rust/ql/lib/codeql/rust/elements/ConstBlockPat.qll index 80b48ac034e8..96463f23483c 100644 --- a/rust/ql/lib/codeql/rust/elements/ConstBlockPat.qll +++ b/rust/ql/lib/codeql/rust/elements/ConstBlockPat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.ConstBlockPat +/** + * A const block pattern. For example: + * ``` + * match x { + * const { 1 + 2 + 3 } => "ok", + * _ => "fail", + * }; + * ``` + */ class ConstBlockPat extends Generated::ConstBlockPat { } diff --git a/rust/ql/lib/codeql/rust/elements/ConstExpr.qll b/rust/ql/lib/codeql/rust/elements/ConstExpr.qll index 375e7dcc7fda..1e76306bea02 100644 --- a/rust/ql/lib/codeql/rust/elements/ConstExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ConstExpr.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.ConstExpr +/** + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` + */ class ConstExpr extends Generated::ConstExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ContinueExpr.qll b/rust/ql/lib/codeql/rust/elements/ContinueExpr.qll index f23879671e33..c5674d62b193 100644 --- a/rust/ql/lib/codeql/rust/elements/ContinueExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ContinueExpr.qll @@ -5,4 +5,21 @@ private import codeql.rust.generated.ContinueExpr +/** + * A continue expression. For example: + * ``` + * loop { + * if not_ready() { + * continue; + * } + * } + * ``` + * ``` + * 'label: loop { + * if not_ready() { + * continue 'label; + * } + * } + * ``` + */ class ContinueExpr extends Generated::ContinueExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/Declaration.qll b/rust/ql/lib/codeql/rust/elements/Declaration.qll index b4e0971d591e..c6a4ecb8e8b3 100644 --- a/rust/ql/lib/codeql/rust/elements/Declaration.qll +++ b/rust/ql/lib/codeql/rust/elements/Declaration.qll @@ -5,4 +5,7 @@ private import codeql.rust.generated.Declaration +/** + * The base class for declarations. + */ class Declaration extends Generated::Declaration { } diff --git a/rust/ql/lib/codeql/rust/elements/ElementListExpr.qll b/rust/ql/lib/codeql/rust/elements/ElementListExpr.qll index 7513353fce3d..e9437b2e6a1a 100644 --- a/rust/ql/lib/codeql/rust/elements/ElementListExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ElementListExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.ElementListExpr +/** + * An element list expression. For example: + * ``` + * [1, 2, 3, 4, 5]; + * [1, 2, 3, 4, 5][0] = 6; + * ``` + */ class ElementListExpr extends Generated::ElementListExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/Expr.qll b/rust/ql/lib/codeql/rust/elements/Expr.qll index 40a7beac2499..581580fcfb09 100644 --- a/rust/ql/lib/codeql/rust/elements/Expr.qll +++ b/rust/ql/lib/codeql/rust/elements/Expr.qll @@ -5,4 +5,7 @@ private import codeql.rust.generated.Expr +/** + * The base class for expressions. + */ class Expr extends Generated::Expr { } diff --git a/rust/ql/lib/codeql/rust/elements/ExprStmt.qll b/rust/ql/lib/codeql/rust/elements/ExprStmt.qll index 0ec9cdbc813d..e3239ef2e8be 100644 --- a/rust/ql/lib/codeql/rust/elements/ExprStmt.qll +++ b/rust/ql/lib/codeql/rust/elements/ExprStmt.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.ExprStmt +/** + * An expression statement. For example: + * ``` + * start(); + * finish() + * use std::env; + * ``` + */ class ExprStmt extends Generated::ExprStmt { } diff --git a/rust/ql/lib/codeql/rust/elements/FieldExpr.qll b/rust/ql/lib/codeql/rust/elements/FieldExpr.qll index 656bd807afdb..a70cb61105e7 100644 --- a/rust/ql/lib/codeql/rust/elements/FieldExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/FieldExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.FieldExpr +/** + * A field access expression. For example: + * ``` + * x.foo + * ``` + */ class FieldExpr extends Generated::FieldExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/Function.qll b/rust/ql/lib/codeql/rust/elements/Function.qll index 23531c2bbd1f..bbeb26d9d9e3 100644 --- a/rust/ql/lib/codeql/rust/elements/Function.qll +++ b/rust/ql/lib/codeql/rust/elements/Function.qll @@ -8,7 +8,7 @@ private import codeql.rust.generated.Function /** * A function declaration. For example * ``` - * fn foo(x: u32) -> u64 { (x + 1).into() } + * fn foo(x: u32) -> u64 {(x + 1).into()} * ``` * A function declaration within a trait might not have a body: * ``` diff --git a/rust/ql/lib/codeql/rust/elements/GenericArgList.qll b/rust/ql/lib/codeql/rust/elements/GenericArgList.qll new file mode 100644 index 000000000000..43c85a596aa1 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/GenericArgList.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `GenericArgList`. + */ + +private import codeql.rust.generated.GenericArgList + +/** + * The base class for generic arguments. + * ``` + * x.foo::(42); + * ``` + */ +class GenericArgList extends Generated::GenericArgList { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordFieldPatConstructor.qll b/rust/ql/lib/codeql/rust/elements/GenericArgListConstructor.qll similarity index 62% rename from rust/ql/lib/codeql/rust/elements/RecordFieldPatConstructor.qll rename to rust/ql/lib/codeql/rust/elements/GenericArgListConstructor.qll index 4d0aa7f23279..1c22ba333e6a 100644 --- a/rust/ql/lib/codeql/rust/elements/RecordFieldPatConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/GenericArgListConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `RecordFieldPat` synthesized instances. + * `GenericArgList` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `RecordFieldPat` synthesized instances. + * The characteristic predicate of `GenericArgList` synthesized instances. * INTERNAL: Do not use. */ -predicate constructRecordFieldPat(Raw::RecordFieldPat id) { any() } +predicate constructGenericArgList(Raw::GenericArgList id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/IdentPat.qll b/rust/ql/lib/codeql/rust/elements/IdentPat.qll new file mode 100644 index 000000000000..4668ecdb853f --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/IdentPat.qll @@ -0,0 +1,23 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `IdentPat`. + */ + +private import codeql.rust.generated.IdentPat + +/** + * A binding pattern. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * y@Option::Some(_) => y, + * Option::None => 0, + * }; + * ``` + */ +class IdentPat extends Generated::IdentPat { } diff --git a/rust/ql/lib/codeql/rust/elements/BindPatConstructor.qll b/rust/ql/lib/codeql/rust/elements/IdentPatConstructor.qll similarity index 62% rename from rust/ql/lib/codeql/rust/elements/BindPatConstructor.qll rename to rust/ql/lib/codeql/rust/elements/IdentPatConstructor.qll index 80445356bf0d..0ceec57153b7 100644 --- a/rust/ql/lib/codeql/rust/elements/BindPatConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/IdentPatConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `BindPat` synthesized instances. + * `IdentPat` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `BindPat` synthesized instances. + * The characteristic predicate of `IdentPat` synthesized instances. * INTERNAL: Do not use. */ -predicate constructBindPat(Raw::BindPat id) { any() } +predicate constructIdentPat(Raw::IdentPat id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/IfExpr.qll b/rust/ql/lib/codeql/rust/elements/IfExpr.qll index c1500f592c07..ca5886e65673 100644 --- a/rust/ql/lib/codeql/rust/elements/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/IfExpr.qll @@ -5,4 +5,19 @@ private import codeql.rust.generated.IfExpr +/** + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 1 + * } else { + * 0 + * } + * ``` + */ class IfExpr extends Generated::IfExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/IndexExpr.qll b/rust/ql/lib/codeql/rust/elements/IndexExpr.qll index fde06bd4d916..d67dfeda33b9 100644 --- a/rust/ql/lib/codeql/rust/elements/IndexExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/IndexExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.IndexExpr +/** + * An index expression. For example: + * ``` + * list[42]; + * list[42] = 1; + * ``` + */ class IndexExpr extends Generated::IndexExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/InlineAsmExpr.qll b/rust/ql/lib/codeql/rust/elements/InlineAsmExpr.qll deleted file mode 100644 index b89e49e3af36..000000000000 --- a/rust/ql/lib/codeql/rust/elements/InlineAsmExpr.qll +++ /dev/null @@ -1,8 +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 `InlineAsmExpr`. - */ - -private import codeql.rust.generated.InlineAsmExpr - -class InlineAsmExpr extends Generated::InlineAsmExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ItemStmt.qll b/rust/ql/lib/codeql/rust/elements/ItemStmt.qll index de2a1b22f758..1e4d1f45e7d0 100644 --- a/rust/ql/lib/codeql/rust/elements/ItemStmt.qll +++ b/rust/ql/lib/codeql/rust/elements/ItemStmt.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.ItemStmt +/** + * An item statement. For example: + * ``` + * fn print_hello() { + * println!("Hello, world!"); + * } + * print_hello(); + * ``` + */ class ItemStmt extends Generated::ItemStmt { } diff --git a/rust/ql/lib/codeql/rust/elements/Label.qll b/rust/ql/lib/codeql/rust/elements/Label.qll index 20a006754e9f..43dffc197b1f 100644 --- a/rust/ql/lib/codeql/rust/elements/Label.qll +++ b/rust/ql/lib/codeql/rust/elements/Label.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.Label +/** + * A label. For example: + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` + */ class Label extends Generated::Label { } diff --git a/rust/ql/lib/codeql/rust/elements/LetExpr.qll b/rust/ql/lib/codeql/rust/elements/LetExpr.qll index 78862471d1bc..27979b514540 100644 --- a/rust/ql/lib/codeql/rust/elements/LetExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/LetExpr.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.LetExpr +/** + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` + */ class LetExpr extends Generated::LetExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/LetStmt.qll b/rust/ql/lib/codeql/rust/elements/LetStmt.qll index f01b81ceb305..10a58875d496 100644 --- a/rust/ql/lib/codeql/rust/elements/LetStmt.qll +++ b/rust/ql/lib/codeql/rust/elements/LetStmt.qll @@ -5,4 +5,16 @@ private import codeql.rust.generated.LetStmt +/** + * A let statement. For example: + * ``` + * let x = 42; + * let x: i32 = 42; + * let x: i32; + * let x; + * let (x, y) = (1, 2); + * let Some(x) = std::env::var("FOO") else { + * return; + * }; + */ class LetStmt extends Generated::LetStmt { } diff --git a/rust/ql/lib/codeql/rust/elements/LitPat.qll b/rust/ql/lib/codeql/rust/elements/LitPat.qll deleted file mode 100644 index 0e8ac98c70d0..000000000000 --- a/rust/ql/lib/codeql/rust/elements/LitPat.qll +++ /dev/null @@ -1,8 +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 `LitPat`. - */ - -private import codeql.rust.generated.LitPat - -class LitPat extends Generated::LitPat { } diff --git a/rust/ql/lib/codeql/rust/elements/LiteralExpr.qll b/rust/ql/lib/codeql/rust/elements/LiteralExpr.qll index d6f928693580..bf892ed395cf 100644 --- a/rust/ql/lib/codeql/rust/elements/LiteralExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/LiteralExpr.qll @@ -5,4 +5,16 @@ private import codeql.rust.generated.LiteralExpr +/** + * A literal expression. For example: + * ``` + * 42; + * 42.0; + * "Hello, world!"; + * b"Hello, world!"; + * 'x'; + * b'x'; + * r"Hello, world!"; + * true; + */ class LiteralExpr extends Generated::LiteralExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/LiteralPat.qll b/rust/ql/lib/codeql/rust/elements/LiteralPat.qll new file mode 100644 index 000000000000..53f0f809ad77 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/LiteralPat.qll @@ -0,0 +1,17 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `LiteralPat`. + */ + +private import codeql.rust.generated.LiteralPat + +/** + * A literal pattern. For example: + * ``` + * match x { + * 42 => "ok", + * _ => "fail", + * } + * ``` + */ +class LiteralPat extends Generated::LiteralPat { } diff --git a/rust/ql/lib/codeql/rust/elements/LiteralPatConstructor.qll b/rust/ql/lib/codeql/rust/elements/LiteralPatConstructor.qll new file mode 100644 index 000000000000..4c8d0d8ad00c --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/LiteralPatConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `LiteralPat` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.rust.generated.Raw + +/** + * The characteristic predicate of `LiteralPat` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructLiteralPat(Raw::LiteralPat id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/LoopExpr.qll b/rust/ql/lib/codeql/rust/elements/LoopExpr.qll index 6f08d6648a21..fdc49e1e85e6 100644 --- a/rust/ql/lib/codeql/rust/elements/LoopExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/LoopExpr.qll @@ -5,4 +5,28 @@ private import codeql.rust.generated.LoopExpr +/** + * A loop expression. For example: + * ``` + * loop { + * println!("Hello, world (again)!"); + * }; + * ``` + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` + * ``` + * let mut x = 0; + * loop { + * if x < 10 { + * x += 1; + * } else { + * break; + * } + * }; + * ``` + */ class LoopExpr extends Generated::LoopExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/MatchArm.qll b/rust/ql/lib/codeql/rust/elements/MatchArm.qll index 914d70d35583..9a83487cd225 100644 --- a/rust/ql/lib/codeql/rust/elements/MatchArm.qll +++ b/rust/ql/lib/codeql/rust/elements/MatchArm.qll @@ -5,4 +5,19 @@ private import codeql.rust.generated.MatchArm +/** + * A match arm. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * }; + * ``` + */ class MatchArm extends Generated::MatchArm { } diff --git a/rust/ql/lib/codeql/rust/elements/MatchExpr.qll b/rust/ql/lib/codeql/rust/elements/MatchExpr.qll index fcb352bc2b44..752b795e5e0b 100644 --- a/rust/ql/lib/codeql/rust/elements/MatchExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MatchExpr.qll @@ -5,4 +5,19 @@ private import codeql.rust.generated.MatchExpr +/** + * A match expression. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * } + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * } + * ``` + */ class MatchExpr extends Generated::MatchExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll index 855035925c3b..0a7bdc6b8567 100644 --- a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.MethodCallExpr +/** + * A method call expression. For example: + * ``` + * x.foo(42); + * x.foo::(42); + */ class MethodCallExpr extends Generated::MethodCallExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/MissingExpr.qll b/rust/ql/lib/codeql/rust/elements/MissingExpr.qll index 3ee2f3a6e4e8..2190168eaf5f 100644 --- a/rust/ql/lib/codeql/rust/elements/MissingExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MissingExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.MissingExpr +/** + * A missing expression, used as a placeholder for incomplete syntax. + * + * ``` + * let x = non_existing_macro!(); + * ``` + */ class MissingExpr extends Generated::MissingExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/MissingPat.qll b/rust/ql/lib/codeql/rust/elements/MissingPat.qll index 88db4cdc7794..c1d875555e3a 100644 --- a/rust/ql/lib/codeql/rust/elements/MissingPat.qll +++ b/rust/ql/lib/codeql/rust/elements/MissingPat.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.MissingPat +/** + * A missing pattern, used as a place holder for incomplete syntax. + * ``` + * match Some(42) { + * .. => "bad use of .. syntax", + * }; + * ``` + */ class MissingPat extends Generated::MissingPat { } diff --git a/rust/ql/lib/codeql/rust/elements/Module.qll b/rust/ql/lib/codeql/rust/elements/Module.qll index a001bb4edb8a..bd0207365269 100644 --- a/rust/ql/lib/codeql/rust/elements/Module.qll +++ b/rust/ql/lib/codeql/rust/elements/Module.qll @@ -5,4 +5,15 @@ private import codeql.rust.generated.Module +/** + * A module declaration. For example: + * ``` + * mod foo; + * ``` + * ``` + * mod bar { + * pub fn baz() {} + * } + * ``` + */ class Module extends Generated::Module { } diff --git a/rust/ql/lib/codeql/rust/elements/OffsetOfExpr.qll b/rust/ql/lib/codeql/rust/elements/OffsetOfExpr.qll index 88097b2c34a6..cac4448162ef 100644 --- a/rust/ql/lib/codeql/rust/elements/OffsetOfExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/OffsetOfExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.OffsetOfExpr +/** + * An `offset_of` expression. For example: + * ``` + * builtin # offset_of(Struct, field); + * ``` + */ class OffsetOfExpr extends Generated::OffsetOfExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/OrPat.qll b/rust/ql/lib/codeql/rust/elements/OrPat.qll index 797060365a4e..d07bfe004769 100644 --- a/rust/ql/lib/codeql/rust/elements/OrPat.qll +++ b/rust/ql/lib/codeql/rust/elements/OrPat.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.OrPat +/** + * An or pattern. For example: + * ``` + * match x { + * Option::Some(y) | Option::None => 0, + * } + * ``` + */ class OrPat extends Generated::OrPat { } diff --git a/rust/ql/lib/codeql/rust/elements/Pat.qll b/rust/ql/lib/codeql/rust/elements/Pat.qll index 7e3c032c05b5..157f1289e6ad 100644 --- a/rust/ql/lib/codeql/rust/elements/Pat.qll +++ b/rust/ql/lib/codeql/rust/elements/Pat.qll @@ -5,4 +5,7 @@ private import codeql.rust.generated.Pat +/** + * The base class for patterns. + */ class Pat extends Generated::Pat { } diff --git a/rust/ql/lib/codeql/rust/elements/Path.qll b/rust/ql/lib/codeql/rust/elements/Path.qll new file mode 100644 index 000000000000..ac41381d30f5 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/Path.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `Path`. + */ + +private import codeql.rust.generated.Path + +/** + * A path. For example: + * ``` + * foo::bar; + * ``` + */ +class Path extends Generated::Path { } diff --git a/rust/ql/lib/codeql/rust/elements/LitPatConstructor.qll b/rust/ql/lib/codeql/rust/elements/PathConstructor.qll similarity index 63% rename from rust/ql/lib/codeql/rust/elements/LitPatConstructor.qll rename to rust/ql/lib/codeql/rust/elements/PathConstructor.qll index a72498ba0978..ed195d2554b0 100644 --- a/rust/ql/lib/codeql/rust/elements/LitPatConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/PathConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `LitPat` synthesized instances. + * `Path` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `LitPat` synthesized instances. + * The characteristic predicate of `Path` synthesized instances. * INTERNAL: Do not use. */ -predicate constructLitPat(Raw::LitPat id) { any() } +predicate constructPath(Raw::Path id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/PathExpr.qll b/rust/ql/lib/codeql/rust/elements/PathExpr.qll index 237ca6b71f1f..9919e62afac6 100644 --- a/rust/ql/lib/codeql/rust/elements/PathExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/PathExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.PathExpr +/** + * A path expression. For example: + * ``` + * let x = variable; + * let x = foo::bar; + * let y = ::foo; + * let z = ::foo; + * ``` + */ class PathExpr extends Generated::PathExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/PathPat.qll b/rust/ql/lib/codeql/rust/elements/PathPat.qll index 92d794c658a7..f5e3329e18c0 100644 --- a/rust/ql/lib/codeql/rust/elements/PathPat.qll +++ b/rust/ql/lib/codeql/rust/elements/PathPat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.PathPat +/** + * A path pattern. For example: + * ``` + * match x { + * Foo::Bar => "ok", + * _ => "fail", + * } + * ``` + */ class PathPat extends Generated::PathPat { } diff --git a/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll b/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll new file mode 100644 index 000000000000..632f9d76742f --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll @@ -0,0 +1,16 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `PrefixExpr`. + */ + +private import codeql.rust.generated.PrefixExpr + +/** + * A unary operation expression. For example: + * ``` + * let x = -42 + * let y = !true + * let z = *ptr + * ``` + */ +class PrefixExpr extends Generated::PrefixExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/PrefixExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/PrefixExprConstructor.qll new file mode 100644 index 000000000000..c4d3cc8f4bb8 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/PrefixExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `PrefixExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.rust.generated.Raw + +/** + * The characteristic predicate of `PrefixExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructPrefixExpr(Raw::PrefixExpr id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/RangeExpr.qll b/rust/ql/lib/codeql/rust/elements/RangeExpr.qll index 67cd4b107217..106922a0602b 100644 --- a/rust/ql/lib/codeql/rust/elements/RangeExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/RangeExpr.qll @@ -5,4 +5,15 @@ private import codeql.rust.generated.RangeExpr +/** + * A range expression. For example: + * ``` + * let x = 1..=10; + * let x = 1..10; + * let x = 10..; + * let x = ..10; + * let x = ..=10; + * let x = ..; + * ``` + */ class RangeExpr extends Generated::RangeExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/RangePat.qll b/rust/ql/lib/codeql/rust/elements/RangePat.qll index eeae9c8aec8b..ed0dbba6177f 100644 --- a/rust/ql/lib/codeql/rust/elements/RangePat.qll +++ b/rust/ql/lib/codeql/rust/elements/RangePat.qll @@ -5,4 +5,14 @@ private import codeql.rust.generated.RangePat +/** + * A range pattern. For example: + * ``` + * match x { + * ..15 => "too cold", + * 16..=25 => "just right", + * 26.. => "too hot", + * } + * ``` + */ class RangePat extends Generated::RangePat { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordExpr.qll b/rust/ql/lib/codeql/rust/elements/RecordExpr.qll new file mode 100644 index 000000000000..6403f5c6f50a --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/RecordExpr.qll @@ -0,0 +1,17 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `RecordExpr`. + */ + +private import codeql.rust.generated.RecordExpr + +/** + * A record expression. For example: + * ``` + * let first = Foo { a: 1, b: 2 }; + * let second = Foo { a: 2, ..first }; + * Foo { a: 1, b: 2 }[2] = 10; + * Foo { .. } = second; + * ``` + */ +class RecordExpr extends Generated::RecordExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/RecordExprConstructor.qll new file mode 100644 index 000000000000..5351a9300730 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/RecordExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `RecordExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.rust.generated.Raw + +/** + * The characteristic predicate of `RecordExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructRecordExpr(Raw::RecordExpr id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/RecordExprField.qll b/rust/ql/lib/codeql/rust/elements/RecordExprField.qll new file mode 100644 index 000000000000..e202511d0ae3 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/RecordExprField.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `RecordExprField`. + */ + +private import codeql.rust.generated.RecordExprField + +/** + * A field in a record expression. For example `a: 1` in: + * ``` + * Foo { a: 1, b: 2 }; + * ``` + */ +class RecordExprField extends Generated::RecordExprField { } diff --git a/rust/ql/lib/codeql/rust/elements/InlineAsmExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/RecordExprFieldConstructor.qll similarity index 58% rename from rust/ql/lib/codeql/rust/elements/InlineAsmExprConstructor.qll rename to rust/ql/lib/codeql/rust/elements/RecordExprFieldConstructor.qll index 9cf7d34d2467..1296a998fa82 100644 --- a/rust/ql/lib/codeql/rust/elements/InlineAsmExprConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/RecordExprFieldConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `InlineAsmExpr` synthesized instances. + * `RecordExprField` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `InlineAsmExpr` synthesized instances. + * The characteristic predicate of `RecordExprField` synthesized instances. * INTERNAL: Do not use. */ -predicate constructInlineAsmExpr(Raw::InlineAsmExpr id) { any() } +predicate constructRecordExprField(Raw::RecordExprField id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/RecordFieldPat.qll b/rust/ql/lib/codeql/rust/elements/RecordFieldPat.qll deleted file mode 100644 index 2b892418c4fc..000000000000 --- a/rust/ql/lib/codeql/rust/elements/RecordFieldPat.qll +++ /dev/null @@ -1,8 +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 `RecordFieldPat`. - */ - -private import codeql.rust.generated.RecordFieldPat - -class RecordFieldPat extends Generated::RecordFieldPat { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordLitExpr.qll b/rust/ql/lib/codeql/rust/elements/RecordLitExpr.qll deleted file mode 100644 index 87653911e1d0..000000000000 --- a/rust/ql/lib/codeql/rust/elements/RecordLitExpr.qll +++ /dev/null @@ -1,8 +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 `RecordLitExpr`. - */ - -private import codeql.rust.generated.RecordLitExpr - -class RecordLitExpr extends Generated::RecordLitExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordLitExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/RecordLitExprConstructor.qll deleted file mode 100644 index f5d6c3d9fe30..000000000000 --- a/rust/ql/lib/codeql/rust/elements/RecordLitExprConstructor.qll +++ /dev/null @@ -1,14 +0,0 @@ -// generated by codegen, remove this comment if you wish to edit this file -/** - * This module defines the hook used internally to tweak the characteristic predicate of - * `RecordLitExpr` synthesized instances. - * INTERNAL: Do not use. - */ - -private import codeql.rust.generated.Raw - -/** - * The characteristic predicate of `RecordLitExpr` synthesized instances. - * INTERNAL: Do not use. - */ -predicate constructRecordLitExpr(Raw::RecordLitExpr id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/RecordLitField.qll b/rust/ql/lib/codeql/rust/elements/RecordLitField.qll deleted file mode 100644 index 1a30e1a1e91a..000000000000 --- a/rust/ql/lib/codeql/rust/elements/RecordLitField.qll +++ /dev/null @@ -1,8 +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 `RecordLitField`. - */ - -private import codeql.rust.generated.RecordLitField - -class RecordLitField extends Generated::RecordLitField { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordPat.qll b/rust/ql/lib/codeql/rust/elements/RecordPat.qll index ac412f19d3d0..0f62ffadfc23 100644 --- a/rust/ql/lib/codeql/rust/elements/RecordPat.qll +++ b/rust/ql/lib/codeql/rust/elements/RecordPat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.RecordPat +/** + * A record pattern. For example: + * ``` + * match x { + * Foo { a: 1, b: 2 } => "ok", + * Foo { .. } => "fail", + * } + * ``` + */ class RecordPat extends Generated::RecordPat { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordPatField.qll b/rust/ql/lib/codeql/rust/elements/RecordPatField.qll new file mode 100644 index 000000000000..d221f700bc4b --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/RecordPatField.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `RecordPatField`. + */ + +private import codeql.rust.generated.RecordPatField + +/** + * A field in a record pattern. For example `a: 1` in: + * ``` + * let Foo { a: 1, b: 2 } = foo; + * ``` + */ +class RecordPatField extends Generated::RecordPatField { } diff --git a/rust/ql/lib/codeql/rust/elements/RecordLitFieldConstructor.qll b/rust/ql/lib/codeql/rust/elements/RecordPatFieldConstructor.qll similarity index 62% rename from rust/ql/lib/codeql/rust/elements/RecordLitFieldConstructor.qll rename to rust/ql/lib/codeql/rust/elements/RecordPatFieldConstructor.qll index 537701fc7d5d..cc86518509f1 100644 --- a/rust/ql/lib/codeql/rust/elements/RecordLitFieldConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/RecordPatFieldConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `RecordLitField` synthesized instances. + * `RecordPatField` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `RecordLitField` synthesized instances. + * The characteristic predicate of `RecordPatField` synthesized instances. * INTERNAL: Do not use. */ -predicate constructRecordLitField(Raw::RecordLitField id) { any() } +predicate constructRecordPatField(Raw::RecordPatField id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/RefExpr.qll b/rust/ql/lib/codeql/rust/elements/RefExpr.qll index 3916a8ad3bc9..b4a1a44f7100 100644 --- a/rust/ql/lib/codeql/rust/elements/RefExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/RefExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.RefExpr +/** + * A reference expression. For example: + * ``` + * let ref_const = &foo; + * let ref_mut = &mut foo; + * let raw_const: &mut i32 = &raw const foo; + * let raw_mut: &mut i32 = &raw mut foo; + * ``` + */ class RefExpr extends Generated::RefExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/RefPat.qll b/rust/ql/lib/codeql/rust/elements/RefPat.qll index 3c9c59e88c5e..91aa06c50145 100644 --- a/rust/ql/lib/codeql/rust/elements/RefPat.qll +++ b/rust/ql/lib/codeql/rust/elements/RefPat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.RefPat +/** + * A reference pattern. For example: + * ``` + * match x { + * &mut Option::Some(y) => y, + * &Option::None => 0, + * }; + * ``` + */ class RefPat extends Generated::RefPat { } diff --git a/rust/ql/lib/codeql/rust/elements/RepeatExpr.qll b/rust/ql/lib/codeql/rust/elements/RepeatExpr.qll index 0f84446136b2..e5216581efc7 100644 --- a/rust/ql/lib/codeql/rust/elements/RepeatExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/RepeatExpr.qll @@ -5,4 +5,9 @@ private import codeql.rust.generated.RepeatExpr +/** + * A repeat expression. For example: + * ``` + * [1; 10]; + */ class RepeatExpr extends Generated::RepeatExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ReturnExpr.qll b/rust/ql/lib/codeql/rust/elements/ReturnExpr.qll index c8a26c595cd9..384e83f31366 100644 --- a/rust/ql/lib/codeql/rust/elements/ReturnExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ReturnExpr.qll @@ -5,4 +5,17 @@ private import codeql.rust.generated.ReturnExpr +/** + * A return expression. For example: + * ``` + * fn some_value() -> i32 { + * return 42; + * } + * ``` + * ``` + * fn no_value() -> () { + * return; + * } + * ``` + */ class ReturnExpr extends Generated::ReturnExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/SlicePat.qll b/rust/ql/lib/codeql/rust/elements/SlicePat.qll index d89f159a7a7b..1c8ded0f1dd5 100644 --- a/rust/ql/lib/codeql/rust/elements/SlicePat.qll +++ b/rust/ql/lib/codeql/rust/elements/SlicePat.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.SlicePat +/** + * A slice pattern. For example: + * ``` + * match x { + * [1, 2, 3, 4, 5] => "ok", + * [1, 2, ..] => "fail", + * [x, y, .., z, 7] => "fail", + * } + */ class SlicePat extends Generated::SlicePat { } diff --git a/rust/ql/lib/codeql/rust/elements/Stmt.qll b/rust/ql/lib/codeql/rust/elements/Stmt.qll index 4b3bd89ea76f..fbcb61c60ce2 100644 --- a/rust/ql/lib/codeql/rust/elements/Stmt.qll +++ b/rust/ql/lib/codeql/rust/elements/Stmt.qll @@ -5,4 +5,7 @@ private import codeql.rust.generated.Stmt +/** + * The base class for statements. + */ class Stmt extends Generated::Stmt { } diff --git a/rust/ql/lib/codeql/rust/elements/TupleExpr.qll b/rust/ql/lib/codeql/rust/elements/TupleExpr.qll index b769d9532f65..0ef129aa7655 100644 --- a/rust/ql/lib/codeql/rust/elements/TupleExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/TupleExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.TupleExpr +/** + * A tuple expression. For example: + * ``` + * (1, "one"); + * (2, "two")[0] = 3; + * ``` + */ class TupleExpr extends Generated::TupleExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/TuplePat.qll b/rust/ql/lib/codeql/rust/elements/TuplePat.qll index f814215aec65..c62adb8f1e7c 100644 --- a/rust/ql/lib/codeql/rust/elements/TuplePat.qll +++ b/rust/ql/lib/codeql/rust/elements/TuplePat.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.TuplePat +/** + * A tuple pattern. For example: + * ``` + * let (x, y) = (1, 2); + * let (a, b, .., z) = (1, 2, 3, 4, 5); + * ``` + */ class TuplePat extends Generated::TuplePat { } diff --git a/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll b/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll index e4c4ffb24ec5..48054a74025e 100644 --- a/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll +++ b/rust/ql/lib/codeql/rust/elements/TupleStructPat.qll @@ -5,4 +5,14 @@ private import codeql.rust.generated.TupleStructPat +/** + * A tuple struct pattern. For example: + * ``` + * match x { + * Tuple("a", 1, 2, 3) => "great", + * Tuple(.., 3) => "fine", + * Tuple(..) => "fail", + * }; + * ``` + */ class TupleStructPat extends Generated::TupleStructPat { } diff --git a/rust/ql/lib/codeql/rust/elements/TypeRef.qll b/rust/ql/lib/codeql/rust/elements/TypeRef.qll index 950ecbd9726a..296e3d4a40be 100644 --- a/rust/ql/lib/codeql/rust/elements/TypeRef.qll +++ b/rust/ql/lib/codeql/rust/elements/TypeRef.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.TypeRef +/** + * The base class for type references. + * ``` + * let x: i32; + * let y: Vec; + * let z: Option; + * ``` + */ class TypeRef extends Generated::TypeRef { } diff --git a/rust/ql/lib/codeql/rust/elements/UnaryOpExpr.qll b/rust/ql/lib/codeql/rust/elements/UnaryOpExpr.qll deleted file mode 100644 index b0b3608b0c78..000000000000 --- a/rust/ql/lib/codeql/rust/elements/UnaryOpExpr.qll +++ /dev/null @@ -1,8 +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 `UnaryOpExpr`. - */ - -private import codeql.rust.generated.UnaryOpExpr - -class UnaryOpExpr extends Generated::UnaryOpExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/UnderscoreExpr.qll b/rust/ql/lib/codeql/rust/elements/UnderscoreExpr.qll index 420d50244077..4b5d09500d1a 100644 --- a/rust/ql/lib/codeql/rust/elements/UnderscoreExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/UnderscoreExpr.qll @@ -5,4 +5,10 @@ private import codeql.rust.generated.UnderscoreExpr +/** + * An underscore expression. For example: + * ``` + * _ = 42; + * ``` + */ class UnderscoreExpr extends Generated::UnderscoreExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/Unimplemented.qll b/rust/ql/lib/codeql/rust/elements/Unimplemented.qll index 272d9538a9c5..7bd4fed7e27a 100644 --- a/rust/ql/lib/codeql/rust/elements/Unimplemented.qll +++ b/rust/ql/lib/codeql/rust/elements/Unimplemented.qll @@ -5,4 +5,7 @@ private import codeql.rust.generated.Unimplemented +/** + * The base class for unimplemented nodes. This is used to mark nodes that are not yet extracted. + */ class Unimplemented extends Generated::Unimplemented { } diff --git a/rust/ql/lib/codeql/rust/elements/UnimplementedConstructor.qll b/rust/ql/lib/codeql/rust/elements/UnimplementedConstructor.qll deleted file mode 100644 index 1216fd22ce58..000000000000 --- a/rust/ql/lib/codeql/rust/elements/UnimplementedConstructor.qll +++ /dev/null @@ -1,14 +0,0 @@ -// generated by codegen, remove this comment if you wish to edit this file -/** - * This module defines the hook used internally to tweak the characteristic predicate of - * `Unimplemented` synthesized instances. - * INTERNAL: Do not use. - */ - -private import codeql.rust.generated.Raw - -/** - * The characteristic predicate of `Unimplemented` synthesized instances. - * INTERNAL: Do not use. - */ -predicate constructUnimplemented(Raw::Unimplemented id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/UnimplementedDeclaration.qll b/rust/ql/lib/codeql/rust/elements/UnimplementedDeclaration.qll new file mode 100644 index 000000000000..4f4d309bbd5f --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/UnimplementedDeclaration.qll @@ -0,0 +1,11 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `UnimplementedDeclaration`. + */ + +private import codeql.rust.generated.UnimplementedDeclaration + +/** + * A declaration that is not yet extracted. + */ +class UnimplementedDeclaration extends Generated::UnimplementedDeclaration { } diff --git a/rust/ql/lib/codeql/rust/elements/BinaryOpExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/UnimplementedDeclarationConstructor.qll similarity index 54% rename from rust/ql/lib/codeql/rust/elements/BinaryOpExprConstructor.qll rename to rust/ql/lib/codeql/rust/elements/UnimplementedDeclarationConstructor.qll index 757b2f42e300..825e3fa836b4 100644 --- a/rust/ql/lib/codeql/rust/elements/BinaryOpExprConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/UnimplementedDeclarationConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `BinaryOpExpr` synthesized instances. + * `UnimplementedDeclaration` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `BinaryOpExpr` synthesized instances. + * The characteristic predicate of `UnimplementedDeclaration` synthesized instances. * INTERNAL: Do not use. */ -predicate constructBinaryOpExpr(Raw::BinaryOpExpr id) { any() } +predicate constructUnimplementedDeclaration(Raw::UnimplementedDeclaration id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/UnsafeBlockExpr.qll b/rust/ql/lib/codeql/rust/elements/UnsafeBlockExpr.qll index 514cfeb0c97e..513192521905 100644 --- a/rust/ql/lib/codeql/rust/elements/UnsafeBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/UnsafeBlockExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.UnsafeBlockExpr +/** + * An unsafe block expression. For example: + * ``` + * let layout = unsafe { + * let x = 42; + * Layout::from_size_align_unchecked(size, align) + * }; + * ``` + */ class UnsafeBlockExpr extends Generated::UnsafeBlockExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/WildPat.qll b/rust/ql/lib/codeql/rust/elements/WildPat.qll deleted file mode 100644 index 346b61e8c2b0..000000000000 --- a/rust/ql/lib/codeql/rust/elements/WildPat.qll +++ /dev/null @@ -1,8 +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 `WildPat`. - */ - -private import codeql.rust.generated.WildPat - -class WildPat extends Generated::WildPat { } diff --git a/rust/ql/lib/codeql/rust/elements/WildcardPat.qll b/rust/ql/lib/codeql/rust/elements/WildcardPat.qll new file mode 100644 index 000000000000..d5283f4e4d21 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/WildcardPat.qll @@ -0,0 +1,14 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `WildcardPat`. + */ + +private import codeql.rust.generated.WildcardPat + +/** + * A wildcard pattern. For example: + * ``` + * let _ = 42; + * ``` + */ +class WildcardPat extends Generated::WildcardPat { } diff --git a/rust/ql/lib/codeql/rust/elements/UnaryOpExprConstructor.qll b/rust/ql/lib/codeql/rust/elements/WildcardPatConstructor.qll similarity index 63% rename from rust/ql/lib/codeql/rust/elements/UnaryOpExprConstructor.qll rename to rust/ql/lib/codeql/rust/elements/WildcardPatConstructor.qll index bd155164de94..edd5db183aa1 100644 --- a/rust/ql/lib/codeql/rust/elements/UnaryOpExprConstructor.qll +++ b/rust/ql/lib/codeql/rust/elements/WildcardPatConstructor.qll @@ -1,14 +1,14 @@ // generated by codegen, remove this comment if you wish to edit this file /** * This module defines the hook used internally to tweak the characteristic predicate of - * `UnaryOpExpr` synthesized instances. + * `WildcardPat` synthesized instances. * INTERNAL: Do not use. */ private import codeql.rust.generated.Raw /** - * The characteristic predicate of `UnaryOpExpr` synthesized instances. + * The characteristic predicate of `WildcardPat` synthesized instances. * INTERNAL: Do not use. */ -predicate constructUnaryOpExpr(Raw::UnaryOpExpr id) { any() } +predicate constructWildcardPat(Raw::WildcardPat id) { any() } diff --git a/rust/ql/lib/codeql/rust/elements/YeetExpr.qll b/rust/ql/lib/codeql/rust/elements/YeetExpr.qll index 8cab74bd9535..6e891621e477 100644 --- a/rust/ql/lib/codeql/rust/elements/YeetExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/YeetExpr.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.YeetExpr +/** + * A `yeet` expression. For example: + * ``` + * if x < size { + * do yeet "index out of bounds"; + * } + * ``` + */ class YeetExpr extends Generated::YeetExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/YieldExpr.qll b/rust/ql/lib/codeql/rust/elements/YieldExpr.qll index f9aed8f7e1c1..e92218e1a2fe 100644 --- a/rust/ql/lib/codeql/rust/elements/YieldExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/YieldExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.YieldExpr +/** + * A `yield` expression. For example: + * ``` + * let one = #[coroutine] + * || { + * yield 1; + * }; + * ``` + */ class YieldExpr extends Generated::YieldExpr { } diff --git a/rust/ql/lib/codeql/rust/generated/ArrayExpr.qll b/rust/ql/lib/codeql/rust/generated/ArrayExpr.qll index 50ec9dd97cad..ab9803e70595 100644 --- a/rust/ql/lib/codeql/rust/generated/ArrayExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ArrayExpr.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An array expression. For example: + * ``` + * [1, 2, 3]; + * [1; 10]; + * ``` * INTERNAL: Do not reference the `Generated::ArrayExpr` class directly. * Use the subclass `ArrayExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/AsmExpr.qll b/rust/ql/lib/codeql/rust/generated/AsmExpr.qll new file mode 100644 index 000000000000..05933b5d84cb --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/AsmExpr.qll @@ -0,0 +1,36 @@ +// generated by codegen +/** + * This module provides the generated definition of `AsmExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Expr + +/** + * INTERNAL: This module contains the fully generated definition of `AsmExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * An inline assembly expression. For example: + * ``` + * unsafe { + * builtin # asm(_); + * } + * ``` + * INTERNAL: Do not reference the `Generated::AsmExpr` class directly. + * Use the subclass `AsmExpr`, where the following predicates are available. + */ + class AsmExpr extends Synth::TAsmExpr, Expr { + override string getAPrimaryQlClass() { result = "AsmExpr" } + + /** + * Gets the expression of this asm expression. + */ + Expr getExpr() { + result = Synth::convertExprFromRaw(Synth::convertAsmExprToRaw(this).(Raw::AsmExpr).getExpr()) + } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll b/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll index 17b7d1b630d6..3d011e059ac9 100644 --- a/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.BlockExprBase */ module Generated { /** + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` * INTERNAL: Do not reference the `Generated::AsyncBlockExpr` class directly. * Use the subclass `AsyncBlockExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/AwaitExpr.qll b/rust/ql/lib/codeql/rust/generated/AwaitExpr.qll index 4c982b7c249e..2e80995a7b9c 100644 --- a/rust/ql/lib/codeql/rust/generated/AwaitExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/AwaitExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An `await` expression. For example: + * ``` + * async { + * let x = foo().await; + * x + * } + * ``` * INTERNAL: Do not reference the `Generated::AwaitExpr` class directly. * Use the subclass `AwaitExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BecomeExpr.qll b/rust/ql/lib/codeql/rust/generated/BecomeExpr.qll index 5af91bbd3ff3..d021d1046809 100644 --- a/rust/ql/lib/codeql/rust/generated/BecomeExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/BecomeExpr.qll @@ -14,6 +14,15 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A `become` expression. For example: + * ``` + * fn fact_a(n: i32, a: i32) -> i32 { + * if n == 0 { + * a + * } else { + * become fact_a(n - 1, n * a) + * } + * } ``` * INTERNAL: Do not reference the `Generated::BecomeExpr` class directly. * Use the subclass `BecomeExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BinaryExpr.qll b/rust/ql/lib/codeql/rust/generated/BinaryExpr.qll new file mode 100644 index 000000000000..1c9c331c4494 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/BinaryExpr.qll @@ -0,0 +1,57 @@ +// generated by codegen +/** + * This module provides the generated definition of `BinaryExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Expr + +/** + * INTERNAL: This module contains the fully generated definition of `BinaryExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A binary operation expression. For example: + * ``` + * x + y; + * x && y; + * x <= y; + * x = y; + * x += y; + * ``` + * INTERNAL: Do not reference the `Generated::BinaryExpr` class directly. + * Use the subclass `BinaryExpr`, where the following predicates are available. + */ + class BinaryExpr extends Synth::TBinaryExpr, Expr { + override string getAPrimaryQlClass() { result = "BinaryExpr" } + + /** + * Gets the lhs of this binary expression. + */ + Expr getLhs() { + result = + Synth::convertExprFromRaw(Synth::convertBinaryExprToRaw(this).(Raw::BinaryExpr).getLhs()) + } + + /** + * Gets the rhs of this binary expression. + */ + Expr getRhs() { + result = + Synth::convertExprFromRaw(Synth::convertBinaryExprToRaw(this).(Raw::BinaryExpr).getRhs()) + } + + /** + * Gets the op of this binary expression, if it exists. + */ + string getOp() { result = Synth::convertBinaryExprToRaw(this).(Raw::BinaryExpr).getOp() } + + /** + * Holds if `getOp()` exists. + */ + final predicate hasOp() { exists(this.getOp()) } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/BinaryOpExpr.qll b/rust/ql/lib/codeql/rust/generated/BinaryOpExpr.qll deleted file mode 100644 index 3f790dfec9a9..000000000000 --- a/rust/ql/lib/codeql/rust/generated/BinaryOpExpr.qll +++ /dev/null @@ -1,49 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `BinaryOpExpr`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Expr - -/** - * INTERNAL: This module contains the fully generated definition of `BinaryOpExpr` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::BinaryOpExpr` class directly. - * Use the subclass `BinaryOpExpr`, where the following predicates are available. - */ - class BinaryOpExpr extends Synth::TBinaryOpExpr, Expr { - override string getAPrimaryQlClass() { result = "BinaryOpExpr" } - - /** - * Gets the lhs of this binary op expression. - */ - Expr getLhs() { - result = - Synth::convertExprFromRaw(Synth::convertBinaryOpExprToRaw(this).(Raw::BinaryOpExpr).getLhs()) - } - - /** - * Gets the rhs of this binary op expression. - */ - Expr getRhs() { - result = - Synth::convertExprFromRaw(Synth::convertBinaryOpExprToRaw(this).(Raw::BinaryOpExpr).getRhs()) - } - - /** - * Gets the op of this binary op expression, if it exists. - */ - string getOp() { result = Synth::convertBinaryOpExprToRaw(this).(Raw::BinaryOpExpr).getOp() } - - /** - * Holds if `getOp()` exists. - */ - final predicate hasOp() { exists(this.getOp()) } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/BindPat.qll b/rust/ql/lib/codeql/rust/generated/BindPat.qll deleted file mode 100644 index b58d24225851..000000000000 --- a/rust/ql/lib/codeql/rust/generated/BindPat.qll +++ /dev/null @@ -1,42 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `BindPat`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Pat - -/** - * INTERNAL: This module contains the fully generated definition of `BindPat` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::BindPat` class directly. - * Use the subclass `BindPat`, where the following predicates are available. - */ - class BindPat extends Synth::TBindPat, Pat { - override string getAPrimaryQlClass() { result = "BindPat" } - - /** - * Gets the binding of this bind pat. - */ - string getBindingId() { - result = Synth::convertBindPatToRaw(this).(Raw::BindPat).getBindingId() - } - - /** - * Gets the subpat of this bind pat, if it exists. - */ - Pat getSubpat() { - result = Synth::convertPatFromRaw(Synth::convertBindPatToRaw(this).(Raw::BindPat).getSubpat()) - } - - /** - * Holds if `getSubpat()` exists. - */ - final predicate hasSubpat() { exists(this.getSubpat()) } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/BlockExpr.qll b/rust/ql/lib/codeql/rust/generated/BlockExpr.qll index 52ca4526377d..d1fbf92c3ab4 100644 --- a/rust/ql/lib/codeql/rust/generated/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/BlockExpr.qll @@ -15,6 +15,18 @@ import codeql.rust.elements.Label */ module Generated { /** + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` * INTERNAL: Do not reference the `Generated::BlockExpr` class directly. * Use the subclass `BlockExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BoxExpr.qll b/rust/ql/lib/codeql/rust/generated/BoxExpr.qll index 4a367bc7b2f7..4a59828330c9 100644 --- a/rust/ql/lib/codeql/rust/generated/BoxExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/BoxExpr.qll @@ -14,6 +14,10 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A box expression. For example: + * ``` + * let x = #[rustc_box] Box::new(42); + * ``` * INTERNAL: Do not reference the `Generated::BoxExpr` class directly. * Use the subclass `BoxExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BoxPat.qll b/rust/ql/lib/codeql/rust/generated/BoxPat.qll index 690fc5155d7c..c6b7e4c22bff 100644 --- a/rust/ql/lib/codeql/rust/generated/BoxPat.qll +++ b/rust/ql/lib/codeql/rust/generated/BoxPat.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A box pattern. For example: + * ``` + * match x { + * box Option::Some(y) => y, + * box Option::None => 0, + * }; + * ``` * INTERNAL: Do not reference the `Generated::BoxPat` class directly. * Use the subclass `BoxPat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BreakExpr.qll b/rust/ql/lib/codeql/rust/generated/BreakExpr.qll index 9e4d90b4973e..2fbd3280280d 100644 --- a/rust/ql/lib/codeql/rust/generated/BreakExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/BreakExpr.qll @@ -15,6 +15,21 @@ import codeql.rust.elements.Label */ module Generated { /** + * A break expression. For example: + * ``` + * loop { + * if not_ready() { + * break; + * } + * } + * ``` + * ``` + * let x = 'label: loop { + * if done() { + * break 'label 42; + * } + * }; + * ``` * INTERNAL: Do not reference the `Generated::BreakExpr` class directly. * Use the subclass `BreakExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/CallExpr.qll b/rust/ql/lib/codeql/rust/generated/CallExpr.qll index 0ca5f2b604d5..6152049b6785 100644 --- a/rust/ql/lib/codeql/rust/generated/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/CallExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A function call expression. For example: + * ``` + * foo(42); + * foo::(42); + * foo[0](42); + * foo(1) = 4; + * ``` * INTERNAL: Do not reference the `Generated::CallExpr` class directly. * Use the subclass `CallExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/CastExpr.qll b/rust/ql/lib/codeql/rust/generated/CastExpr.qll index f9b717f9114c..01f880f106cc 100644 --- a/rust/ql/lib/codeql/rust/generated/CastExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/CastExpr.qll @@ -15,6 +15,10 @@ import codeql.rust.elements.TypeRef */ module Generated { /** + * A cast expression. For example: + * ``` + * value as u64; + * ``` * INTERNAL: Do not reference the `Generated::CastExpr` class directly. * Use the subclass `CastExpr`, where the following predicates are available. */ @@ -30,11 +34,11 @@ module Generated { } /** - * Gets the type reference of this cast expression. + * Gets the type of this cast expression. */ - TypeRef getTypeRef() { + TypeRef getType() { result = - Synth::convertTypeRefFromRaw(Synth::convertCastExprToRaw(this).(Raw::CastExpr).getTypeRef()) + Synth::convertTypeRefFromRaw(Synth::convertCastExprToRaw(this).(Raw::CastExpr).getType()) } } } diff --git a/rust/ql/lib/codeql/rust/generated/ClosureExpr.qll b/rust/ql/lib/codeql/rust/generated/ClosureExpr.qll index 2c1b31af0264..822fbdcc6772 100644 --- a/rust/ql/lib/codeql/rust/generated/ClosureExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ClosureExpr.qll @@ -16,6 +16,16 @@ import codeql.rust.elements.TypeRef */ module Generated { /** + * A closure expression. For example: + * ``` + * |x| x + 1; + * move |x: i32| -> i32 { x + 1 }; + * async |x: i32, y| x + y; + * #[coroutine] + * |x| yield x; + * #[coroutine] + * static |x| yield x; + * ``` * INTERNAL: Do not reference the `Generated::ClosureExpr` class directly. * Use the subclass `ClosureExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ConstBlockPat.qll b/rust/ql/lib/codeql/rust/generated/ConstBlockPat.qll index f741124f180c..74f3fd6bcdcd 100644 --- a/rust/ql/lib/codeql/rust/generated/ConstBlockPat.qll +++ b/rust/ql/lib/codeql/rust/generated/ConstBlockPat.qll @@ -15,6 +15,13 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A const block pattern. For example: + * ``` + * match x { + * const { 1 + 2 + 3 } => "ok", + * _ => "fail", + * }; + * ``` * INTERNAL: Do not reference the `Generated::ConstBlockPat` class directly. * Use the subclass `ConstBlockPat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ConstExpr.qll b/rust/ql/lib/codeql/rust/generated/ConstExpr.qll index 1c11dba419c1..d237ec3d9d59 100644 --- a/rust/ql/lib/codeql/rust/generated/ConstExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ConstExpr.qll @@ -14,6 +14,12 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` * INTERNAL: Do not reference the `Generated::ConstExpr` class directly. * Use the subclass `ConstExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ContinueExpr.qll b/rust/ql/lib/codeql/rust/generated/ContinueExpr.qll index b03aed387ae9..d11925dfb3a1 100644 --- a/rust/ql/lib/codeql/rust/generated/ContinueExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ContinueExpr.qll @@ -15,6 +15,21 @@ import codeql.rust.elements.Label */ module Generated { /** + * A continue expression. For example: + * ``` + * loop { + * if not_ready() { + * continue; + * } + * } + * ``` + * ``` + * 'label: loop { + * if not_ready() { + * continue 'label; + * } + * } + * ``` * INTERNAL: Do not reference the `Generated::ContinueExpr` class directly. * Use the subclass `ContinueExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Declaration.qll b/rust/ql/lib/codeql/rust/generated/Declaration.qll index 0cc2a30f178b..1b6a78cf8c04 100644 --- a/rust/ql/lib/codeql/rust/generated/Declaration.qll +++ b/rust/ql/lib/codeql/rust/generated/Declaration.qll @@ -14,6 +14,7 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for declarations. * INTERNAL: Do not reference the `Generated::Declaration` class directly. * Use the subclass `Declaration`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ElementListExpr.qll b/rust/ql/lib/codeql/rust/generated/ElementListExpr.qll index ae6ac160ef09..8fcd4c626224 100644 --- a/rust/ql/lib/codeql/rust/generated/ElementListExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ElementListExpr.qll @@ -15,6 +15,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An element list expression. For example: + * ``` + * [1, 2, 3, 4, 5]; + * [1, 2, 3, 4, 5][0] = 6; + * ``` * INTERNAL: Do not reference the `Generated::ElementListExpr` class directly. * Use the subclass `ElementListExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Expr.qll b/rust/ql/lib/codeql/rust/generated/Expr.qll index f395ff11840e..f7e8b41056bd 100644 --- a/rust/ql/lib/codeql/rust/generated/Expr.qll +++ b/rust/ql/lib/codeql/rust/generated/Expr.qll @@ -14,6 +14,7 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for expressions. * INTERNAL: Do not reference the `Generated::Expr` class directly. * Use the subclass `Expr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ExprStmt.qll b/rust/ql/lib/codeql/rust/generated/ExprStmt.qll index 08d3dfc5a863..4f6bc664240b 100644 --- a/rust/ql/lib/codeql/rust/generated/ExprStmt.qll +++ b/rust/ql/lib/codeql/rust/generated/ExprStmt.qll @@ -15,6 +15,12 @@ import codeql.rust.elements.Stmt */ module Generated { /** + * An expression statement. For example: + * ``` + * start(); + * finish() + * use std::env; + * ``` * INTERNAL: Do not reference the `Generated::ExprStmt` class directly. * Use the subclass `ExprStmt`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/FieldExpr.qll b/rust/ql/lib/codeql/rust/generated/FieldExpr.qll index 82688dbf44b4..fc282ca4a493 100644 --- a/rust/ql/lib/codeql/rust/generated/FieldExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/FieldExpr.qll @@ -14,6 +14,10 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A field access expression. For example: + * ``` + * x.foo + * ``` * INTERNAL: Do not reference the `Generated::FieldExpr` class directly. * Use the subclass `FieldExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Function.qll b/rust/ql/lib/codeql/rust/generated/Function.qll index f0c053f97152..1b0c7ae375e7 100644 --- a/rust/ql/lib/codeql/rust/generated/Function.qll +++ b/rust/ql/lib/codeql/rust/generated/Function.qll @@ -17,7 +17,7 @@ module Generated { /** * A function declaration. For example * ``` - * fn foo(x: u32) -> u64 { (x + 1).into() } + * fn foo(x: u32) -> u64 {(x + 1).into()} * ``` * A function declaration within a trait might not have a body: * ``` diff --git a/rust/ql/lib/codeql/rust/generated/GenericArgList.qll b/rust/ql/lib/codeql/rust/generated/GenericArgList.qll new file mode 100644 index 000000000000..10e436d5d7c4 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/GenericArgList.qll @@ -0,0 +1,28 @@ +// generated by codegen +/** + * This module provides the generated definition of `GenericArgList`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.AstNode +import codeql.rust.elements.Unimplemented + +/** + * INTERNAL: This module contains the fully generated definition of `GenericArgList` and should not + * be referenced directly. + */ +module Generated { + /** + * The base class for generic arguments. + * ``` + * x.foo::(42); + * ``` + * INTERNAL: Do not reference the `Generated::GenericArgList` class directly. + * Use the subclass `GenericArgList`, where the following predicates are available. + */ + class GenericArgList extends Synth::TGenericArgList, AstNode, Unimplemented { + override string getAPrimaryQlClass() { result = "GenericArgList" } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/IdentPat.qll b/rust/ql/lib/codeql/rust/generated/IdentPat.qll new file mode 100644 index 000000000000..9ebabc254ad9 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/IdentPat.qll @@ -0,0 +1,56 @@ +// generated by codegen +/** + * This module provides the generated definition of `IdentPat`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Pat + +/** + * INTERNAL: This module contains the fully generated definition of `IdentPat` and should not + * be referenced directly. + */ +module Generated { + /** + * A binding pattern. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * y@Option::Some(_) => y, + * Option::None => 0, + * }; + * ``` + * INTERNAL: Do not reference the `Generated::IdentPat` class directly. + * Use the subclass `IdentPat`, where the following predicates are available. + */ + class IdentPat extends Synth::TIdentPat, Pat { + override string getAPrimaryQlClass() { result = "IdentPat" } + + /** + * Gets the binding of this ident pat. + */ + string getBindingId() { + result = Synth::convertIdentPatToRaw(this).(Raw::IdentPat).getBindingId() + } + + /** + * Gets the subpat of this ident pat, if it exists. + */ + Pat getSubpat() { + result = + Synth::convertPatFromRaw(Synth::convertIdentPatToRaw(this).(Raw::IdentPat).getSubpat()) + } + + /** + * Holds if `getSubpat()` exists. + */ + final predicate hasSubpat() { exists(this.getSubpat()) } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/IfExpr.qll b/rust/ql/lib/codeql/rust/generated/IfExpr.qll index 4b90ac9b50ac..728ad847fb06 100644 --- a/rust/ql/lib/codeql/rust/generated/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/IfExpr.qll @@ -14,6 +14,19 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 1 + * } else { + * 0 + * } + * ``` * INTERNAL: Do not reference the `Generated::IfExpr` class directly. * Use the subclass `IfExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/IndexExpr.qll b/rust/ql/lib/codeql/rust/generated/IndexExpr.qll index fd6021f30145..a9a762be1bd0 100644 --- a/rust/ql/lib/codeql/rust/generated/IndexExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/IndexExpr.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An index expression. For example: + * ``` + * list[42]; + * list[42] = 1; + * ``` * INTERNAL: Do not reference the `Generated::IndexExpr` class directly. * Use the subclass `IndexExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/InlineAsmExpr.qll b/rust/ql/lib/codeql/rust/generated/InlineAsmExpr.qll deleted file mode 100644 index 4478cfee53b5..000000000000 --- a/rust/ql/lib/codeql/rust/generated/InlineAsmExpr.qll +++ /dev/null @@ -1,33 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `InlineAsmExpr`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Expr - -/** - * INTERNAL: This module contains the fully generated definition of `InlineAsmExpr` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::InlineAsmExpr` class directly. - * Use the subclass `InlineAsmExpr`, where the following predicates are available. - */ - class InlineAsmExpr extends Synth::TInlineAsmExpr, Expr { - override string getAPrimaryQlClass() { result = "InlineAsmExpr" } - - /** - * Gets the expression of this inline asm expression. - */ - Expr getExpr() { - result = - Synth::convertExprFromRaw(Synth::convertInlineAsmExprToRaw(this) - .(Raw::InlineAsmExpr) - .getExpr()) - } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/ItemStmt.qll b/rust/ql/lib/codeql/rust/generated/ItemStmt.qll index 2be48967c7cb..d33d0aeeafeb 100644 --- a/rust/ql/lib/codeql/rust/generated/ItemStmt.qll +++ b/rust/ql/lib/codeql/rust/generated/ItemStmt.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Stmt */ module Generated { /** + * An item statement. For example: + * ``` + * fn print_hello() { + * println!("Hello, world!"); + * } + * print_hello(); + * ``` * INTERNAL: Do not reference the `Generated::ItemStmt` class directly. * Use the subclass `ItemStmt`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Label.qll b/rust/ql/lib/codeql/rust/generated/Label.qll index 6922dd193acd..cea7c19778d2 100644 --- a/rust/ql/lib/codeql/rust/generated/Label.qll +++ b/rust/ql/lib/codeql/rust/generated/Label.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * A label. For example: + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` * INTERNAL: Do not reference the `Generated::Label` class directly. * Use the subclass `Label`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/LetExpr.qll b/rust/ql/lib/codeql/rust/generated/LetExpr.qll index a4dccae48760..3608012f30e0 100644 --- a/rust/ql/lib/codeql/rust/generated/LetExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/LetExpr.qll @@ -15,6 +15,12 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` * INTERNAL: Do not reference the `Generated::LetExpr` class directly. * Use the subclass `LetExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/LetStmt.qll b/rust/ql/lib/codeql/rust/generated/LetStmt.qll index 8f52f441dfc7..d4d70aff0fb9 100644 --- a/rust/ql/lib/codeql/rust/generated/LetStmt.qll +++ b/rust/ql/lib/codeql/rust/generated/LetStmt.qll @@ -17,6 +17,16 @@ import codeql.rust.elements.TypeRef */ module Generated { /** + * A let statement. For example: + * ``` + * let x = 42; + * let x: i32 = 42; + * let x: i32; + * let x; + * let (x, y) = (1, 2); + * let Some(x) = std::env::var("FOO") else { + * return; + * }; * INTERNAL: Do not reference the `Generated::LetStmt` class directly. * Use the subclass `LetStmt`, where the following predicates are available. */ @@ -31,17 +41,17 @@ module Generated { } /** - * Gets the type reference of this let statement, if it exists. + * Gets the type of this let statement, if it exists. */ - TypeRef getTypeRef() { + TypeRef getType() { result = - Synth::convertTypeRefFromRaw(Synth::convertLetStmtToRaw(this).(Raw::LetStmt).getTypeRef()) + Synth::convertTypeRefFromRaw(Synth::convertLetStmtToRaw(this).(Raw::LetStmt).getType()) } /** - * Holds if `getTypeRef()` exists. + * Holds if `getType()` exists. */ - final predicate hasTypeRef() { exists(this.getTypeRef()) } + final predicate hasType() { exists(this.getType()) } /** * Gets the initializer of this let statement, if it exists. diff --git a/rust/ql/lib/codeql/rust/generated/LitPat.qll b/rust/ql/lib/codeql/rust/generated/LitPat.qll deleted file mode 100644 index 1133ee3d1f1a..000000000000 --- a/rust/ql/lib/codeql/rust/generated/LitPat.qll +++ /dev/null @@ -1,31 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `LitPat`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Expr -import codeql.rust.elements.Pat - -/** - * INTERNAL: This module contains the fully generated definition of `LitPat` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::LitPat` class directly. - * Use the subclass `LitPat`, where the following predicates are available. - */ - class LitPat extends Synth::TLitPat, Pat { - override string getAPrimaryQlClass() { result = "LitPat" } - - /** - * Gets the expression of this lit pat. - */ - Expr getExpr() { - result = Synth::convertExprFromRaw(Synth::convertLitPatToRaw(this).(Raw::LitPat).getExpr()) - } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/LiteralExpr.qll b/rust/ql/lib/codeql/rust/generated/LiteralExpr.qll index c54501545923..7c9ee19e3217 100644 --- a/rust/ql/lib/codeql/rust/generated/LiteralExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/LiteralExpr.qll @@ -14,6 +14,16 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A literal expression. For example: + * ``` + * 42; + * 42.0; + * "Hello, world!"; + * b"Hello, world!"; + * 'x'; + * b'x'; + * r"Hello, world!"; + * true; * INTERNAL: Do not reference the `Generated::LiteralExpr` class directly. * Use the subclass `LiteralExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/LiteralPat.qll b/rust/ql/lib/codeql/rust/generated/LiteralPat.qll new file mode 100644 index 000000000000..ba38d34342cc --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/LiteralPat.qll @@ -0,0 +1,39 @@ +// generated by codegen +/** + * This module provides the generated definition of `LiteralPat`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Expr +import codeql.rust.elements.Pat + +/** + * INTERNAL: This module contains the fully generated definition of `LiteralPat` and should not + * be referenced directly. + */ +module Generated { + /** + * A literal pattern. For example: + * ``` + * match x { + * 42 => "ok", + * _ => "fail", + * } + * ``` + * INTERNAL: Do not reference the `Generated::LiteralPat` class directly. + * Use the subclass `LiteralPat`, where the following predicates are available. + */ + class LiteralPat extends Synth::TLiteralPat, Pat { + override string getAPrimaryQlClass() { result = "LiteralPat" } + + /** + * Gets the expression of this literal pat. + */ + Expr getExpr() { + result = + Synth::convertExprFromRaw(Synth::convertLiteralPatToRaw(this).(Raw::LiteralPat).getExpr()) + } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/LoopExpr.qll b/rust/ql/lib/codeql/rust/generated/LoopExpr.qll index c4479efdb1af..0f2d6ef94f73 100644 --- a/rust/ql/lib/codeql/rust/generated/LoopExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/LoopExpr.qll @@ -15,6 +15,28 @@ import codeql.rust.elements.Label */ module Generated { /** + * A loop expression. For example: + * ``` + * loop { + * println!("Hello, world (again)!"); + * }; + * ``` + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` + * ``` + * let mut x = 0; + * loop { + * if x < 10 { + * x += 1; + * } else { + * break; + * } + * }; + * ``` * INTERNAL: Do not reference the `Generated::LoopExpr` class directly. * Use the subclass `LoopExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/MatchArm.qll b/rust/ql/lib/codeql/rust/generated/MatchArm.qll index cec99d17c321..5198bf908a9e 100644 --- a/rust/ql/lib/codeql/rust/generated/MatchArm.qll +++ b/rust/ql/lib/codeql/rust/generated/MatchArm.qll @@ -16,6 +16,19 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A match arm. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * }; + * ``` * INTERNAL: Do not reference the `Generated::MatchArm` class directly. * Use the subclass `MatchArm`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/MatchExpr.qll b/rust/ql/lib/codeql/rust/generated/MatchExpr.qll index 87569d02ba02..bf2eb004981e 100644 --- a/rust/ql/lib/codeql/rust/generated/MatchExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/MatchExpr.qll @@ -15,6 +15,19 @@ import codeql.rust.elements.MatchArm */ module Generated { /** + * A match expression. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * } + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * } + * ``` * INTERNAL: Do not reference the `Generated::MatchExpr` class directly. * Use the subclass `MatchExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/generated/MethodCallExpr.qll index 18eacc9dc202..8bb7c201596c 100644 --- a/rust/ql/lib/codeql/rust/generated/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/MethodCallExpr.qll @@ -7,7 +7,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.Expr -import codeql.rust.elements.Unimplemented +import codeql.rust.elements.GenericArgList /** * INTERNAL: This module contains the fully generated definition of `MethodCallExpr` and should not @@ -15,6 +15,10 @@ import codeql.rust.elements.Unimplemented */ module Generated { /** + * A method call expression. For example: + * ``` + * x.foo(42); + * x.foo::(42); * INTERNAL: Do not reference the `Generated::MethodCallExpr` class directly. * Use the subclass `MethodCallExpr`, where the following predicates are available. */ @@ -61,9 +65,9 @@ module Generated { /** * Gets the generic arguments of this method call expression, if it exists. */ - Unimplemented getGenericArgs() { + GenericArgList getGenericArgs() { result = - Synth::convertUnimplementedFromRaw(Synth::convertMethodCallExprToRaw(this) + Synth::convertGenericArgListFromRaw(Synth::convertMethodCallExprToRaw(this) .(Raw::MethodCallExpr) .getGenericArgs()) } diff --git a/rust/ql/lib/codeql/rust/generated/MissingExpr.qll b/rust/ql/lib/codeql/rust/generated/MissingExpr.qll index 250c639fbeb8..955d662bce41 100644 --- a/rust/ql/lib/codeql/rust/generated/MissingExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/MissingExpr.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A missing expression, used as a placeholder for incomplete syntax. + * + * ``` + * let x = non_existing_macro!(); + * ``` * INTERNAL: Do not reference the `Generated::MissingExpr` class directly. * Use the subclass `MissingExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/MissingPat.qll b/rust/ql/lib/codeql/rust/generated/MissingPat.qll index fb8af9f5f5b8..ac1c7f349a9c 100644 --- a/rust/ql/lib/codeql/rust/generated/MissingPat.qll +++ b/rust/ql/lib/codeql/rust/generated/MissingPat.qll @@ -14,6 +14,12 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A missing pattern, used as a place holder for incomplete syntax. + * ``` + * match Some(42) { + * .. => "bad use of .. syntax", + * }; + * ``` * INTERNAL: Do not reference the `Generated::MissingPat` class directly. * Use the subclass `MissingPat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Module.qll b/rust/ql/lib/codeql/rust/generated/Module.qll index ae5100ee9d8f..68fc098d321b 100644 --- a/rust/ql/lib/codeql/rust/generated/Module.qll +++ b/rust/ql/lib/codeql/rust/generated/Module.qll @@ -14,6 +14,15 @@ import codeql.rust.elements.Declaration */ module Generated { /** + * A module declaration. For example: + * ``` + * mod foo; + * ``` + * ``` + * mod bar { + * pub fn baz() {} + * } + * ``` * INTERNAL: Do not reference the `Generated::Module` class directly. * Use the subclass `Module`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/OffsetOfExpr.qll b/rust/ql/lib/codeql/rust/generated/OffsetOfExpr.qll index c481a52cff4a..109a63775e66 100644 --- a/rust/ql/lib/codeql/rust/generated/OffsetOfExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/OffsetOfExpr.qll @@ -15,6 +15,10 @@ import codeql.rust.elements.TypeRef */ module Generated { /** + * An `offset_of` expression. For example: + * ``` + * builtin # offset_of(Struct, field); + * ``` * INTERNAL: Do not reference the `Generated::OffsetOfExpr` class directly. * Use the subclass `OffsetOfExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/OrPat.qll b/rust/ql/lib/codeql/rust/generated/OrPat.qll index 8f1541ea9b31..946e7679af05 100644 --- a/rust/ql/lib/codeql/rust/generated/OrPat.qll +++ b/rust/ql/lib/codeql/rust/generated/OrPat.qll @@ -14,6 +14,12 @@ import codeql.rust.elements.Pat */ module Generated { /** + * An or pattern. For example: + * ``` + * match x { + * Option::Some(y) | Option::None => 0, + * } + * ``` * INTERNAL: Do not reference the `Generated::OrPat` class directly. * Use the subclass `OrPat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/generated/ParentChild.qll index 73b1c76f46fb..f2bc4668f794 100644 --- a/rust/ql/lib/codeql/rust/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/generated/ParentChild.qll @@ -23,6 +23,21 @@ private module Impl { ) } + private Element getImmediateChildOfUnimplemented( + Unimplemented e, int index, string partialPredicateCall + ) { + exists(int b, int bElement, int n | + b = 0 and + bElement = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfElement(e, i, _)) | i) and + n = bElement and + ( + none() + or + result = getImmediateChildOfElement(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfAstNode(AstNode e, int index, string partialPredicateCall) { exists(int b, int bLocatable, int n | b = 0 and @@ -64,6 +79,25 @@ private module Impl { ) } + private Element getImmediateChildOfGenericArgList( + GenericArgList e, int index, string partialPredicateCall + ) { + exists(int b, int bAstNode, int bUnimplemented, int n | + b = 0 and + bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and + bUnimplemented = + bAstNode + 1 + max(int i | i = -1 or exists(getImmediateChildOfUnimplemented(e, i, _)) | i) and + n = bUnimplemented and + ( + none() + or + result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfUnimplemented(e, index - bAstNode, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfLabel(Label e, int index, string partialPredicateCall) { exists(int b, int bAstNode, int n | b = 0 and @@ -112,26 +146,25 @@ private module Impl { ) } - private Element getImmediateChildOfRecordFieldPat( - RecordFieldPat e, int index, string partialPredicateCall - ) { - exists(int b, int bAstNode, int n, int nPat | + private Element getImmediateChildOfPath(Path e, int index, string partialPredicateCall) { + exists(int b, int bAstNode, int bUnimplemented, int n | b = 0 and bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and - n = bAstNode and - nPat = n + 1 and + bUnimplemented = + bAstNode + 1 + max(int i | i = -1 or exists(getImmediateChildOfUnimplemented(e, i, _)) | i) and + n = bUnimplemented and ( none() or result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) or - index = n and result = e.getPat() and partialPredicateCall = "Pat()" + result = getImmediateChildOfUnimplemented(e, index - bAstNode, partialPredicateCall) ) ) } - private Element getImmediateChildOfRecordLitField( - RecordLitField e, int index, string partialPredicateCall + private Element getImmediateChildOfRecordExprField( + RecordExprField e, int index, string partialPredicateCall ) { exists(int b, int bAstNode, int n, int nExpr | b = 0 and @@ -148,20 +181,25 @@ private module Impl { ) } - private Element getImmediateChildOfStmt(Stmt e, int index, string partialPredicateCall) { - exists(int b, int bAstNode, int n | + private Element getImmediateChildOfRecordPatField( + RecordPatField e, int index, string partialPredicateCall + ) { + exists(int b, int bAstNode, int n, int nPat | b = 0 and bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and n = bAstNode and + nPat = n + 1 and ( none() or result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) + or + index = n and result = e.getPat() and partialPredicateCall = "Pat()" ) ) } - private Element getImmediateChildOfTypeRef(TypeRef e, int index, string partialPredicateCall) { + private Element getImmediateChildOfStmt(Stmt 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 @@ -174,17 +212,19 @@ private module Impl { ) } - private Element getImmediateChildOfUnimplemented( - Unimplemented e, int index, string partialPredicateCall - ) { - exists(int b, int bAstNode, int n | + private Element getImmediateChildOfTypeRef(TypeRef e, int index, string partialPredicateCall) { + exists(int b, int bAstNode, int bUnimplemented, int n | b = 0 and bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and - n = bAstNode and + bUnimplemented = + bAstNode + 1 + max(int i | i = -1 or exists(getImmediateChildOfUnimplemented(e, i, _)) | i) and + n = bUnimplemented and ( none() or result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfUnimplemented(e, index - bAstNode, partialPredicateCall) ) ) } @@ -202,7 +242,7 @@ private module Impl { ) } - private Element getImmediateChildOfAwaitExpr(AwaitExpr e, int index, string partialPredicateCall) { + private Element getImmediateChildOfAsmExpr(AsmExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nExpr | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and @@ -218,7 +258,7 @@ private module Impl { ) } - private Element getImmediateChildOfBecomeExpr(BecomeExpr e, int index, string partialPredicateCall) { + private Element getImmediateChildOfAwaitExpr(AwaitExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nExpr | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and @@ -234,39 +274,37 @@ private module Impl { ) } - private Element getImmediateChildOfBinaryOpExpr( - BinaryOpExpr e, int index, string partialPredicateCall - ) { - exists(int b, int bExpr, int n, int nLhs, int nRhs | + private Element getImmediateChildOfBecomeExpr(BecomeExpr e, int index, string partialPredicateCall) { + exists(int b, int bExpr, int n, int nExpr | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and n = bExpr and - nLhs = n + 1 and - nRhs = nLhs + 1 and + nExpr = n + 1 and ( none() or result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) or - index = n and result = e.getLhs() and partialPredicateCall = "Lhs()" - or - index = nLhs and result = e.getRhs() and partialPredicateCall = "Rhs()" + index = n and result = e.getExpr() and partialPredicateCall = "Expr()" ) ) } - private Element getImmediateChildOfBindPat(BindPat e, int index, string partialPredicateCall) { - exists(int b, int bPat, int n, int nSubpat | + private Element getImmediateChildOfBinaryExpr(BinaryExpr e, int index, string partialPredicateCall) { + exists(int b, int bExpr, int n, int nLhs, int nRhs | b = 0 and - bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and - n = bPat and - nSubpat = n + 1 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nLhs = n + 1 and + nRhs = nLhs + 1 and ( none() or - result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) or - index = n and result = e.getSubpat() and partialPredicateCall = "Subpat()" + index = n and result = e.getLhs() and partialPredicateCall = "Lhs()" + or + index = nLhs and result = e.getRhs() and partialPredicateCall = "Rhs()" ) ) } @@ -365,12 +403,12 @@ private module Impl { } private Element getImmediateChildOfCastExpr(CastExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nExpr, int nTypeRef | + exists(int b, int bExpr, int n, int nExpr, int nType | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and n = bExpr and nExpr = n + 1 and - nTypeRef = nExpr + 1 and + nType = nExpr + 1 and ( none() or @@ -378,7 +416,7 @@ private module Impl { or index = n and result = e.getExpr() and partialPredicateCall = "Expr()" or - index = nExpr and result = e.getTypeRef() and partialPredicateCall = "TypeRef()" + index = nExpr and result = e.getType() and partialPredicateCall = "Type()" ) ) } @@ -513,6 +551,22 @@ private module Impl { ) } + private Element getImmediateChildOfIdentPat(IdentPat e, int index, string partialPredicateCall) { + exists(int b, int bPat, int n, int nSubpat | + b = 0 and + bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and + n = bPat and + nSubpat = n + 1 and + ( + none() + or + result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + or + index = n and result = e.getSubpat() and partialPredicateCall = "Subpat()" + ) + ) + } + private Element getImmediateChildOfIfExpr(IfExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nCondition, int nThen, int nElse | b = 0 and @@ -554,24 +608,6 @@ private module Impl { ) } - private Element getImmediateChildOfInlineAsmExpr( - InlineAsmExpr e, int index, string partialPredicateCall - ) { - exists(int b, int bExpr, int n, int nExpr | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nExpr = n + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - index = n and result = e.getExpr() and partialPredicateCall = "Expr()" - ) - ) - } - private Element getImmediateChildOfItemStmt(ItemStmt e, int index, string partialPredicateCall) { exists(int b, int bStmt, int n | b = 0 and @@ -605,13 +641,13 @@ private module Impl { } private Element getImmediateChildOfLetStmt(LetStmt e, int index, string partialPredicateCall) { - exists(int b, int bStmt, int n, int nPat, int nTypeRef, int nInitializer, int nElse | + exists(int b, int bStmt, int n, int nPat, int nType, int nInitializer, int nElse | b = 0 and bStmt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfStmt(e, i, _)) | i) and n = bStmt and nPat = n + 1 and - nTypeRef = nPat + 1 and - nInitializer = nTypeRef + 1 and + nType = nPat + 1 and + nInitializer = nType + 1 and nElse = nInitializer + 1 and ( none() @@ -620,42 +656,42 @@ private module Impl { or index = n and result = e.getPat() and partialPredicateCall = "Pat()" or - index = nPat and result = e.getTypeRef() and partialPredicateCall = "TypeRef()" + index = nPat and result = e.getType() and partialPredicateCall = "Type()" or - index = nTypeRef and result = e.getInitializer() and partialPredicateCall = "Initializer()" + index = nType and result = e.getInitializer() and partialPredicateCall = "Initializer()" or index = nInitializer and result = e.getElse() and partialPredicateCall = "Else()" ) ) } - private Element getImmediateChildOfLitPat(LitPat e, int index, string partialPredicateCall) { - exists(int b, int bPat, int n, int nExpr | + private Element getImmediateChildOfLiteralExpr( + LiteralExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n | b = 0 and - bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and - n = bPat and - nExpr = n + 1 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and ( none() or - result = getImmediateChildOfPat(e, index - b, partialPredicateCall) - or - index = n and result = e.getExpr() and partialPredicateCall = "Expr()" + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) ) ) } - private Element getImmediateChildOfLiteralExpr( - LiteralExpr e, int index, string partialPredicateCall - ) { - exists(int b, int bExpr, int n | + private Element getImmediateChildOfLiteralPat(LiteralPat e, int index, string partialPredicateCall) { + exists(int b, int bPat, int n, int nExpr | b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and + bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and + n = bPat and + nExpr = n + 1 and ( none() or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + result = getImmediateChildOfPat(e, index - b, partialPredicateCall) + or + index = n and result = e.getExpr() and partialPredicateCall = "Expr()" ) ) } @@ -837,6 +873,22 @@ private module Impl { ) } + private Element getImmediateChildOfPrefixExpr(PrefixExpr e, int index, string partialPredicateCall) { + exists(int b, int bExpr, int n, int nExpr | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nExpr = n + 1 and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + index = n and result = e.getExpr() and partialPredicateCall = "Expr()" + ) + ) + } + private Element getImmediateChildOfRangeExpr(RangeExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nLhs, int nRhs | b = 0 and @@ -875,16 +927,14 @@ private module Impl { ) } - private Element getImmediateChildOfRecordLitExpr( - RecordLitExpr e, int index, string partialPredicateCall - ) { - exists(int b, int bExpr, int n, int nPath, int nField, int nSpread | + private Element getImmediateChildOfRecordExpr(RecordExpr e, int index, string partialPredicateCall) { + exists(int b, int bExpr, int n, int nPath, int nFld, int nSpread | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and n = bExpr and nPath = n + 1 and - nField = nPath + 1 + max(int i | i = -1 or exists(e.getField(i)) | i) and - nSpread = nField + 1 and + nFld = nPath + 1 + max(int i | i = -1 or exists(e.getFld(i)) | i) and + nSpread = nFld + 1 and ( none() or @@ -892,21 +942,21 @@ private module Impl { or index = n and result = e.getPath() and partialPredicateCall = "Path()" or - result = e.getField(index - nPath) and - partialPredicateCall = "Field(" + (index - nPath).toString() + ")" + result = e.getFld(index - nPath) and + partialPredicateCall = "Fld(" + (index - nPath).toString() + ")" or - index = nField and result = e.getSpread() and partialPredicateCall = "Spread()" + index = nFld and result = e.getSpread() and partialPredicateCall = "Spread()" ) ) } private Element getImmediateChildOfRecordPat(RecordPat e, int index, string partialPredicateCall) { - exists(int b, int bPat, int n, int nPath, int nArg | + exists(int b, int bPat, int n, int nPath, int nFld | b = 0 and bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and n = bPat and nPath = n + 1 and - nArg = nPath + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and + nFld = nPath + 1 + max(int i | i = -1 or exists(e.getFld(i)) | i) and ( none() or @@ -914,8 +964,8 @@ private module Impl { or index = n and result = e.getPath() and partialPredicateCall = "Path()" or - result = e.getArg(index - nPath) and - partialPredicateCall = "Arg(" + (index - nPath).toString() + ")" + result = e.getFld(index - nPath) and + partialPredicateCall = "Fld(" + (index - nPath).toString() + ")" ) ) } @@ -1048,40 +1098,45 @@ private module Impl { ) } - private Element getImmediateChildOfUnaryOpExpr( - UnaryOpExpr e, int index, string partialPredicateCall + private Element getImmediateChildOfUnderscoreExpr( + UnderscoreExpr e, int index, string partialPredicateCall ) { - exists(int b, int bExpr, int n, int nExpr | + exists(int b, int bExpr, int n | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and n = bExpr and - nExpr = n + 1 and ( none() or result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - index = n and result = e.getExpr() and partialPredicateCall = "Expr()" ) ) } - private Element getImmediateChildOfUnderscoreExpr( - UnderscoreExpr e, int index, string partialPredicateCall + private Element getImmediateChildOfUnimplementedDeclaration( + UnimplementedDeclaration e, int index, string partialPredicateCall ) { - exists(int b, int bExpr, int n | + exists(int b, int bDeclaration, int bUnimplemented, int n | b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and + bDeclaration = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfDeclaration(e, i, _)) | i) and + bUnimplemented = + bDeclaration + 1 + + max(int i | i = -1 or exists(getImmediateChildOfUnimplemented(e, i, _)) | i) and + n = bUnimplemented and ( none() or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + result = getImmediateChildOfDeclaration(e, index - b, partialPredicateCall) + or + result = getImmediateChildOfUnimplemented(e, index - bDeclaration, partialPredicateCall) ) ) } - private Element getImmediateChildOfWildPat(WildPat e, int index, string partialPredicateCall) { + private Element getImmediateChildOfWildcardPat( + WildcardPat e, int index, string partialPredicateCall + ) { exists(int b, int bPat, int n | b = 0 and bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and @@ -1219,25 +1274,27 @@ private module Impl { // * none() simplifies generation, as we can append `or ...` without a special case for the first item none() or + result = getImmediateChildOfGenericArgList(e, index, partialAccessor) + or result = getImmediateChildOfLabel(e, index, partialAccessor) or result = getImmediateChildOfMatchArm(e, index, partialAccessor) or - result = getImmediateChildOfRecordFieldPat(e, index, partialAccessor) + result = getImmediateChildOfPath(e, index, partialAccessor) + or + result = getImmediateChildOfRecordExprField(e, index, partialAccessor) or - result = getImmediateChildOfRecordLitField(e, index, partialAccessor) + result = getImmediateChildOfRecordPatField(e, index, partialAccessor) or result = getImmediateChildOfTypeRef(e, index, partialAccessor) or - result = getImmediateChildOfUnimplemented(e, index, partialAccessor) + result = getImmediateChildOfAsmExpr(e, index, partialAccessor) or result = getImmediateChildOfAwaitExpr(e, index, partialAccessor) or result = getImmediateChildOfBecomeExpr(e, index, partialAccessor) or - result = getImmediateChildOfBinaryOpExpr(e, index, partialAccessor) - or - result = getImmediateChildOfBindPat(e, index, partialAccessor) + result = getImmediateChildOfBinaryExpr(e, index, partialAccessor) or result = getImmediateChildOfBoxExpr(e, index, partialAccessor) or @@ -1263,22 +1320,22 @@ private module Impl { or result = getImmediateChildOfFunction(e, index, partialAccessor) or + result = getImmediateChildOfIdentPat(e, index, partialAccessor) + or result = getImmediateChildOfIfExpr(e, index, partialAccessor) or result = getImmediateChildOfIndexExpr(e, index, partialAccessor) or - result = getImmediateChildOfInlineAsmExpr(e, index, partialAccessor) - or result = getImmediateChildOfItemStmt(e, index, partialAccessor) or result = getImmediateChildOfLetExpr(e, index, partialAccessor) or result = getImmediateChildOfLetStmt(e, index, partialAccessor) or - result = getImmediateChildOfLitPat(e, index, partialAccessor) - or result = getImmediateChildOfLiteralExpr(e, index, partialAccessor) or + result = getImmediateChildOfLiteralPat(e, index, partialAccessor) + or result = getImmediateChildOfLoopExpr(e, index, partialAccessor) or result = getImmediateChildOfMatchExpr(e, index, partialAccessor) @@ -1299,11 +1356,13 @@ private module Impl { or result = getImmediateChildOfPathPat(e, index, partialAccessor) or + result = getImmediateChildOfPrefixExpr(e, index, partialAccessor) + or result = getImmediateChildOfRangeExpr(e, index, partialAccessor) or result = getImmediateChildOfRangePat(e, index, partialAccessor) or - result = getImmediateChildOfRecordLitExpr(e, index, partialAccessor) + result = getImmediateChildOfRecordExpr(e, index, partialAccessor) or result = getImmediateChildOfRecordPat(e, index, partialAccessor) or @@ -1321,11 +1380,11 @@ private module Impl { or result = getImmediateChildOfTupleStructPat(e, index, partialAccessor) or - result = getImmediateChildOfUnaryOpExpr(e, index, partialAccessor) - or result = getImmediateChildOfUnderscoreExpr(e, index, partialAccessor) or - result = getImmediateChildOfWildPat(e, index, partialAccessor) + result = getImmediateChildOfUnimplementedDeclaration(e, index, partialAccessor) + or + result = getImmediateChildOfWildcardPat(e, index, partialAccessor) or result = getImmediateChildOfYeetExpr(e, index, partialAccessor) or diff --git a/rust/ql/lib/codeql/rust/generated/Pat.qll b/rust/ql/lib/codeql/rust/generated/Pat.qll index c21fcf46d715..b7be54a90785 100644 --- a/rust/ql/lib/codeql/rust/generated/Pat.qll +++ b/rust/ql/lib/codeql/rust/generated/Pat.qll @@ -14,6 +14,7 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for patterns. * INTERNAL: Do not reference the `Generated::Pat` class directly. * Use the subclass `Pat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Path.qll b/rust/ql/lib/codeql/rust/generated/Path.qll new file mode 100644 index 000000000000..c929101f21a7 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/Path.qll @@ -0,0 +1,28 @@ +// generated by codegen +/** + * This module provides the generated definition of `Path`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.AstNode +import codeql.rust.elements.Unimplemented + +/** + * INTERNAL: This module contains the fully generated definition of `Path` and should not + * be referenced directly. + */ +module Generated { + /** + * A path. For example: + * ``` + * foo::bar; + * ``` + * INTERNAL: Do not reference the `Generated::Path` class directly. + * Use the subclass `Path`, where the following predicates are available. + */ + class Path extends Synth::TPath, AstNode, Unimplemented { + override string getAPrimaryQlClass() { result = "Path" } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/PathExpr.qll b/rust/ql/lib/codeql/rust/generated/PathExpr.qll index 7a164820a73d..6002e6b42dea 100644 --- a/rust/ql/lib/codeql/rust/generated/PathExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/PathExpr.qll @@ -7,7 +7,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.Expr -import codeql.rust.elements.Unimplemented +import codeql.rust.elements.Path /** * INTERNAL: This module contains the fully generated definition of `PathExpr` and should not @@ -15,6 +15,13 @@ import codeql.rust.elements.Unimplemented */ module Generated { /** + * A path expression. For example: + * ``` + * let x = variable; + * let x = foo::bar; + * let y = ::foo; + * let z = ::foo; + * ``` * INTERNAL: Do not reference the `Generated::PathExpr` class directly. * Use the subclass `PathExpr`, where the following predicates are available. */ @@ -24,11 +31,9 @@ module Generated { /** * Gets the path of this path expression. */ - Unimplemented getPath() { + Path getPath() { result = - Synth::convertUnimplementedFromRaw(Synth::convertPathExprToRaw(this) - .(Raw::PathExpr) - .getPath()) + Synth::convertPathFromRaw(Synth::convertPathExprToRaw(this).(Raw::PathExpr).getPath()) } } } diff --git a/rust/ql/lib/codeql/rust/generated/PathPat.qll b/rust/ql/lib/codeql/rust/generated/PathPat.qll index 5fb2acfb13cf..7670849b7492 100644 --- a/rust/ql/lib/codeql/rust/generated/PathPat.qll +++ b/rust/ql/lib/codeql/rust/generated/PathPat.qll @@ -7,7 +7,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.Pat -import codeql.rust.elements.Unimplemented +import codeql.rust.elements.Path /** * INTERNAL: This module contains the fully generated definition of `PathPat` and should not @@ -15,6 +15,13 @@ import codeql.rust.elements.Unimplemented */ module Generated { /** + * A path pattern. For example: + * ``` + * match x { + * Foo::Bar => "ok", + * _ => "fail", + * } + * ``` * INTERNAL: Do not reference the `Generated::PathPat` class directly. * Use the subclass `PathPat`, where the following predicates are available. */ @@ -24,9 +31,8 @@ module Generated { /** * Gets the path of this path pat. */ - Unimplemented getPath() { - result = - Synth::convertUnimplementedFromRaw(Synth::convertPathPatToRaw(this).(Raw::PathPat).getPath()) + Path getPath() { + result = Synth::convertPathFromRaw(Synth::convertPathPatToRaw(this).(Raw::PathPat).getPath()) } } } diff --git a/rust/ql/lib/codeql/rust/generated/PrefixExpr.qll b/rust/ql/lib/codeql/rust/generated/PrefixExpr.qll new file mode 100644 index 000000000000..8d31aa2ffa8b --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/PrefixExpr.qll @@ -0,0 +1,42 @@ +// generated by codegen +/** + * This module provides the generated definition of `PrefixExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Expr + +/** + * INTERNAL: This module contains the fully generated definition of `PrefixExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A unary operation expression. For example: + * ``` + * let x = -42 + * let y = !true + * let z = *ptr + * ``` + * INTERNAL: Do not reference the `Generated::PrefixExpr` class directly. + * Use the subclass `PrefixExpr`, where the following predicates are available. + */ + class PrefixExpr extends Synth::TPrefixExpr, Expr { + override string getAPrimaryQlClass() { result = "PrefixExpr" } + + /** + * Gets the expression of this prefix expression. + */ + Expr getExpr() { + result = + Synth::convertExprFromRaw(Synth::convertPrefixExprToRaw(this).(Raw::PrefixExpr).getExpr()) + } + + /** + * Gets the op of this prefix expression. + */ + string getOp() { result = Synth::convertPrefixExprToRaw(this).(Raw::PrefixExpr).getOp() } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/RangeExpr.qll b/rust/ql/lib/codeql/rust/generated/RangeExpr.qll index d1d783e22880..5b038040f94e 100644 --- a/rust/ql/lib/codeql/rust/generated/RangeExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/RangeExpr.qll @@ -14,6 +14,15 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A range expression. For example: + * ``` + * let x = 1..=10; + * let x = 1..10; + * let x = 10..; + * let x = ..10; + * let x = ..=10; + * let x = ..; + * ``` * INTERNAL: Do not reference the `Generated::RangeExpr` class directly. * Use the subclass `RangeExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/RangePat.qll b/rust/ql/lib/codeql/rust/generated/RangePat.qll index f0cfa96e869a..d40d4b90358b 100644 --- a/rust/ql/lib/codeql/rust/generated/RangePat.qll +++ b/rust/ql/lib/codeql/rust/generated/RangePat.qll @@ -14,6 +14,14 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A range pattern. For example: + * ``` + * match x { + * ..15 => "too cold", + * 16..=25 => "just right", + * 26.. => "too hot", + * } + * ``` * INTERNAL: Do not reference the `Generated::RangePat` class directly. * Use the subclass `RangePat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Raw.qll b/rust/ql/lib/codeql/rust/generated/Raw.qll index df45ca063aec..7bd0d5058f57 100644 --- a/rust/ql/lib/codeql/rust/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/generated/Raw.qll @@ -15,6 +15,12 @@ module Raw { */ class Locatable extends @locatable, Element { } + /** + * INTERNAL: Do not use. + * The base class for unimplemented nodes. This is used to mark nodes that are not yet extracted. + */ + class Unimplemented extends @unimplemented, Element { } + /** * INTERNAL: Do not use. */ @@ -22,16 +28,36 @@ module Raw { /** * INTERNAL: Do not use. + * The base class for declarations. */ class Declaration extends @declaration, AstNode { } /** * INTERNAL: Do not use. + * The base class for expressions. */ class Expr extends @expr, AstNode { } /** * INTERNAL: Do not use. + * The base class for generic arguments. + * ``` + * x.foo::(42); + * ``` + */ + class GenericArgList extends @generic_arg_list, AstNode, Unimplemented { + override string toString() { result = "GenericArgList" } + } + + /** + * INTERNAL: Do not use. + * A label. For example: + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` */ class Label extends @label, AstNode { override string toString() { result = "Label" } @@ -44,6 +70,19 @@ module Raw { /** * INTERNAL: Do not use. + * A match arm. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * }; + * ``` */ class MatchArm extends @match_arm, AstNode { override string toString() { result = "MatchArm" } @@ -66,69 +105,119 @@ module Raw { /** * INTERNAL: Do not use. + * The base class for patterns. */ class Pat extends @pat, AstNode { } /** * INTERNAL: Do not use. + * A path. For example: + * ``` + * foo::bar; + * ``` */ - class RecordFieldPat extends @record_field_pat, AstNode { - override string toString() { result = "RecordFieldPat" } + class Path extends @path, AstNode, Unimplemented { + override string toString() { result = "Path" } + } + + /** + * INTERNAL: Do not use. + * A field in a record expression. For example `a: 1` in: + * ``` + * Foo { a: 1, b: 2 }; + * ``` + */ + class RecordExprField extends @record_expr_field, AstNode { + override string toString() { result = "RecordExprField" } /** - * Gets the name of this record field pat. + * Gets the name of this record expression field. */ - string getName() { record_field_pats(this, result, _) } + string getName() { record_expr_fields(this, result, _) } /** - * Gets the pat of this record field pat. + * Gets the expression of this record expression field. */ - Pat getPat() { record_field_pats(this, _, result) } + Expr getExpr() { record_expr_fields(this, _, result) } } /** * INTERNAL: Do not use. + * A field in a record pattern. For example `a: 1` in: + * ``` + * let Foo { a: 1, b: 2 } = foo; + * ``` */ - class RecordLitField extends @record_lit_field, AstNode { - override string toString() { result = "RecordLitField" } + class RecordPatField extends @record_pat_field, AstNode { + override string toString() { result = "RecordPatField" } /** - * Gets the name of this record lit field. + * Gets the name of this record pat field. */ - string getName() { record_lit_fields(this, result, _) } + string getName() { record_pat_fields(this, result, _) } /** - * Gets the expression of this record lit field. + * Gets the pat of this record pat field. */ - Expr getExpr() { record_lit_fields(this, _, result) } + Pat getPat() { record_pat_fields(this, _, result) } } /** * INTERNAL: Do not use. + * The base class for statements. */ class Stmt extends @stmt, AstNode { } /** * INTERNAL: Do not use. + * The base class for type references. + * ``` + * let x: i32; + * let y: Vec; + * let z: Option; + * ``` */ - class TypeRef extends @type_ref, AstNode { + class TypeRef extends @type_ref, AstNode, Unimplemented { override string toString() { result = "TypeRef" } } /** * INTERNAL: Do not use. + * An array expression. For example: + * ``` + * [1, 2, 3]; + * [1; 10]; + * ``` */ - class Unimplemented extends @unimplemented, AstNode { - override string toString() { result = "Unimplemented" } - } + class ArrayExpr extends @array_expr, Expr { } /** * INTERNAL: Do not use. + * An inline assembly expression. For example: + * ``` + * unsafe { + * builtin # asm(_); + * } + * ``` */ - class ArrayExpr extends @array_expr, Expr { } + class AsmExpr extends @asm_expr, Expr { + override string toString() { result = "AsmExpr" } + + /** + * Gets the expression of this asm expression. + */ + Expr getExpr() { asm_exprs(this, result) } + } /** * INTERNAL: Do not use. + * An `await` expression. For example: + * ``` + * async { + * let x = foo().await; + * x + * } + * ``` */ class AwaitExpr extends @await_expr, Expr { override string toString() { result = "AwaitExpr" } @@ -141,6 +230,15 @@ module Raw { /** * INTERNAL: Do not use. + * A `become` expression. For example: + * ``` + * fn fact_a(n: i32, a: i32) -> i32 { + * if n == 0 { + * a + * } else { + * become fact_a(n - 1, n * a) + * } + * } ``` */ class BecomeExpr extends @become_expr, Expr { override string toString() { result = "BecomeExpr" } @@ -153,41 +251,32 @@ module Raw { /** * INTERNAL: Do not use. + * A binary operation expression. For example: + * ``` + * x + y; + * x && y; + * x <= y; + * x = y; + * x += y; + * ``` */ - class BinaryOpExpr extends @binary_op_expr, Expr { - override string toString() { result = "BinaryOpExpr" } + class BinaryExpr extends @binary_expr, Expr { + override string toString() { result = "BinaryExpr" } /** - * Gets the lhs of this binary op expression. + * Gets the lhs of this binary expression. */ - Expr getLhs() { binary_op_exprs(this, result, _) } + Expr getLhs() { binary_exprs(this, result, _) } /** - * Gets the rhs of this binary op expression. + * Gets the rhs of this binary expression. */ - Expr getRhs() { binary_op_exprs(this, _, result) } + Expr getRhs() { binary_exprs(this, _, result) } /** - * Gets the op of this binary op expression, if it exists. + * Gets the op of this binary expression, if it exists. */ - string getOp() { binary_op_expr_ops(this, result) } - } - - /** - * INTERNAL: Do not use. - */ - class BindPat extends @bind_pat, Pat { - override string toString() { result = "BindPat" } - - /** - * Gets the binding of this bind pat. - */ - string getBindingId() { bind_pats(this, result) } - - /** - * Gets the subpat of this bind pat, if it exists. - */ - Pat getSubpat() { bind_pat_subpats(this, result) } + string getOp() { binary_expr_ops(this, result) } } /** @@ -207,6 +296,10 @@ module Raw { /** * INTERNAL: Do not use. + * A box expression. For example: + * ``` + * let x = #[rustc_box] Box::new(42); + * ``` */ class BoxExpr extends @box_expr, Expr { override string toString() { result = "BoxExpr" } @@ -219,6 +312,13 @@ module Raw { /** * INTERNAL: Do not use. + * A box pattern. For example: + * ``` + * match x { + * box Option::Some(y) => y, + * box Option::None => 0, + * }; + * ``` */ class BoxPat extends @box_pat, Pat { override string toString() { result = "BoxPat" } @@ -231,6 +331,21 @@ module Raw { /** * INTERNAL: Do not use. + * A break expression. For example: + * ``` + * loop { + * if not_ready() { + * break; + * } + * } + * ``` + * ``` + * let x = 'label: loop { + * if done() { + * break 'label 42; + * } + * }; + * ``` */ class BreakExpr extends @break_expr, Expr { override string toString() { result = "BreakExpr" } @@ -248,6 +363,13 @@ module Raw { /** * INTERNAL: Do not use. + * A function call expression. For example: + * ``` + * foo(42); + * foo::(42); + * foo[0](42); + * foo(1) = 4; + * ``` */ class CallExpr extends @call_expr, Expr { override string toString() { result = "CallExpr" } @@ -270,6 +392,10 @@ module Raw { /** * INTERNAL: Do not use. + * A cast expression. For example: + * ``` + * value as u64; + * ``` */ class CastExpr extends @cast_expr, Expr { override string toString() { result = "CastExpr" } @@ -280,13 +406,23 @@ module Raw { Expr getExpr() { cast_exprs(this, result, _) } /** - * Gets the type reference of this cast expression. + * Gets the type of this cast expression. */ - TypeRef getTypeRef() { cast_exprs(this, _, result) } + TypeRef getType() { cast_exprs(this, _, result) } } /** * INTERNAL: Do not use. + * A closure expression. For example: + * ``` + * |x| x + 1; + * move |x: i32| -> i32 { x + 1 }; + * async |x: i32, y| x + y; + * #[coroutine] + * |x| yield x; + * #[coroutine] + * static |x| yield x; + * ``` */ class ClosureExpr extends @closure_expr, Expr { override string toString() { result = "ClosureExpr" } @@ -324,6 +460,13 @@ module Raw { /** * INTERNAL: Do not use. + * A const block pattern. For example: + * ``` + * match x { + * const { 1 + 2 + 3 } => "ok", + * _ => "fail", + * }; + * ``` */ class ConstBlockPat extends @const_block_pat, Pat { override string toString() { result = "ConstBlockPat" } @@ -336,6 +479,12 @@ module Raw { /** * INTERNAL: Do not use. + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` */ class ConstExpr extends @const_expr, Expr { override string toString() { result = "ConstExpr" } @@ -348,6 +497,21 @@ module Raw { /** * INTERNAL: Do not use. + * A continue expression. For example: + * ``` + * loop { + * if not_ready() { + * continue; + * } + * } + * ``` + * ``` + * 'label: loop { + * if not_ready() { + * continue 'label; + * } + * } + * ``` */ class ContinueExpr extends @continue_expr, Expr { override string toString() { result = "ContinueExpr" } @@ -360,6 +524,12 @@ module Raw { /** * INTERNAL: Do not use. + * An expression statement. For example: + * ``` + * start(); + * finish() + * use std::env; + * ``` */ class ExprStmt extends @expr_stmt, Stmt { override string toString() { result = "ExprStmt" } @@ -377,6 +547,10 @@ module Raw { /** * INTERNAL: Do not use. + * A field access expression. For example: + * ``` + * x.foo + * ``` */ class FieldExpr extends @field_expr, Expr { override string toString() { result = "FieldExpr" } @@ -396,7 +570,7 @@ module Raw { * INTERNAL: Do not use. * A function declaration. For example * ``` - * fn foo(x: u32) -> u64 { (x + 1).into() } + * fn foo(x: u32) -> u64 {(x + 1).into()} * ``` * A function declaration within a trait might not have a body: * ``` @@ -421,6 +595,49 @@ module Raw { /** * INTERNAL: Do not use. + * A binding pattern. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * }; + * ``` + * ``` + * match x { + * y@Option::Some(_) => y, + * Option::None => 0, + * }; + * ``` + */ + class IdentPat extends @ident_pat, Pat { + override string toString() { result = "IdentPat" } + + /** + * Gets the binding of this ident pat. + */ + string getBindingId() { ident_pats(this, result) } + + /** + * Gets the subpat of this ident pat, if it exists. + */ + Pat getSubpat() { ident_pat_subpats(this, result) } + } + + /** + * INTERNAL: Do not use. + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 1 + * } else { + * 0 + * } + * ``` */ class IfExpr extends @if_expr, Expr { override string toString() { result = "IfExpr" } @@ -443,6 +660,11 @@ module Raw { /** * INTERNAL: Do not use. + * An index expression. For example: + * ``` + * list[42]; + * list[42] = 1; + * ``` */ class IndexExpr extends @index_expr, Expr { override string toString() { result = "IndexExpr" } @@ -465,18 +687,13 @@ module Raw { /** * INTERNAL: Do not use. - */ - class InlineAsmExpr extends @inline_asm_expr, Expr { - override string toString() { result = "InlineAsmExpr" } - - /** - * Gets the expression of this inline asm expression. - */ - Expr getExpr() { inline_asm_exprs(this, result) } - } - - /** - * INTERNAL: Do not use. + * An item statement. For example: + * ``` + * fn print_hello() { + * println!("Hello, world!"); + * } + * print_hello(); + * ``` */ class ItemStmt extends @item_stmt, Stmt { override string toString() { result = "ItemStmt" } @@ -484,6 +701,12 @@ module Raw { /** * INTERNAL: Do not use. + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` */ class LetExpr extends @let_expr, Expr { override string toString() { result = "LetExpr" } @@ -501,6 +724,16 @@ module Raw { /** * INTERNAL: Do not use. + * A let statement. For example: + * ``` + * let x = 42; + * let x: i32 = 42; + * let x: i32; + * let x; + * let (x, y) = (1, 2); + * let Some(x) = std::env::var("FOO") else { + * return; + * }; */ class LetStmt extends @let_stmt, Stmt { override string toString() { result = "LetStmt" } @@ -511,9 +744,9 @@ module Raw { Pat getPat() { let_stmts(this, result) } /** - * Gets the type reference of this let statement, if it exists. + * Gets the type of this let statement, if it exists. */ - TypeRef getTypeRef() { let_stmt_type_refs(this, result) } + TypeRef getType() { let_stmt_types(this, result) } /** * Gets the initializer of this let statement, if it exists. @@ -528,25 +761,64 @@ module Raw { /** * INTERNAL: Do not use. + * A literal expression. For example: + * ``` + * 42; + * 42.0; + * "Hello, world!"; + * b"Hello, world!"; + * 'x'; + * b'x'; + * r"Hello, world!"; + * true; */ - class LitPat extends @lit_pat, Pat { - override string toString() { result = "LitPat" } - - /** - * Gets the expression of this lit pat. - */ - Expr getExpr() { lit_pats(this, result) } + class LiteralExpr extends @literal_expr, Expr { + override string toString() { result = "LiteralExpr" } } /** * INTERNAL: Do not use. + * A literal pattern. For example: + * ``` + * match x { + * 42 => "ok", + * _ => "fail", + * } + * ``` */ - class LiteralExpr extends @literal_expr, Expr { - override string toString() { result = "LiteralExpr" } + class LiteralPat extends @literal_pat, Pat { + override string toString() { result = "LiteralPat" } + + /** + * Gets the expression of this literal pat. + */ + Expr getExpr() { literal_pats(this, result) } } /** * INTERNAL: Do not use. + * A loop expression. For example: + * ``` + * loop { + * println!("Hello, world (again)!"); + * }; + * ``` + * ``` + * 'label: loop { + * println!("Hello, world (once)!"); + * break 'label; + * }; + * ``` + * ``` + * let mut x = 0; + * loop { + * if x < 10 { + * x += 1; + * } else { + * break; + * } + * }; + * ``` */ class LoopExpr extends @loop_expr, Expr { override string toString() { result = "LoopExpr" } @@ -564,6 +836,19 @@ module Raw { /** * INTERNAL: Do not use. + * A match expression. For example: + * ``` + * match x { + * Option::Some(y) => y, + * Option::None => 0, + * } + * ``` + * ``` + * match x { + * Some(y) if y != 0 => 1 / y, + * _ => 0, + * } + * ``` */ class MatchExpr extends @match_expr, Expr { override string toString() { result = "MatchExpr" } @@ -581,6 +866,10 @@ module Raw { /** * INTERNAL: Do not use. + * A method call expression. For example: + * ``` + * x.foo(42); + * x.foo::(42); */ class MethodCallExpr extends @method_call_expr, Expr { override string toString() { result = "MethodCallExpr" } @@ -603,11 +892,16 @@ module Raw { /** * Gets the generic arguments of this method call expression, if it exists. */ - Unimplemented getGenericArgs() { method_call_expr_generic_args(this, result) } + GenericArgList getGenericArgs() { method_call_expr_generic_args(this, result) } } /** * INTERNAL: Do not use. + * A missing expression, used as a placeholder for incomplete syntax. + * + * ``` + * let x = non_existing_macro!(); + * ``` */ class MissingExpr extends @missing_expr, Expr { override string toString() { result = "MissingExpr" } @@ -615,6 +909,12 @@ module Raw { /** * INTERNAL: Do not use. + * A missing pattern, used as a place holder for incomplete syntax. + * ``` + * match Some(42) { + * .. => "bad use of .. syntax", + * }; + * ``` */ class MissingPat extends @missing_pat, Pat { override string toString() { result = "MissingPat" } @@ -622,6 +922,15 @@ module Raw { /** * INTERNAL: Do not use. + * A module declaration. For example: + * ``` + * mod foo; + * ``` + * ``` + * mod bar { + * pub fn baz() {} + * } + * ``` */ class Module extends @module, Declaration { override string toString() { result = "Module" } @@ -634,6 +943,10 @@ module Raw { /** * INTERNAL: Do not use. + * An `offset_of` expression. For example: + * ``` + * builtin # offset_of(Struct, field); + * ``` */ class OffsetOfExpr extends @offset_of_expr, Expr { override string toString() { result = "OffsetOfExpr" } @@ -651,6 +964,12 @@ module Raw { /** * INTERNAL: Do not use. + * An or pattern. For example: + * ``` + * match x { + * Option::Some(y) | Option::None => 0, + * } + * ``` */ class OrPat extends @or_pat, Pat { override string toString() { result = "OrPat" } @@ -663,6 +982,13 @@ module Raw { /** * INTERNAL: Do not use. + * A path expression. For example: + * ``` + * let x = variable; + * let x = foo::bar; + * let y = ::foo; + * let z = ::foo; + * ``` */ class PathExpr extends @path_expr, Expr { override string toString() { result = "PathExpr" } @@ -670,11 +996,18 @@ module Raw { /** * Gets the path of this path expression. */ - Unimplemented getPath() { path_exprs(this, result) } + Path getPath() { path_exprs(this, result) } } /** * INTERNAL: Do not use. + * A path pattern. For example: + * ``` + * match x { + * Foo::Bar => "ok", + * _ => "fail", + * } + * ``` */ class PathPat extends @path_pat, Pat { override string toString() { result = "PathPat" } @@ -682,11 +1015,43 @@ module Raw { /** * Gets the path of this path pat. */ - Unimplemented getPath() { path_pats(this, result) } + Path getPath() { path_pats(this, result) } } /** * INTERNAL: Do not use. + * A unary operation expression. For example: + * ``` + * let x = -42 + * let y = !true + * let z = *ptr + * ``` + */ + class PrefixExpr extends @prefix_expr, Expr { + override string toString() { result = "PrefixExpr" } + + /** + * Gets the expression of this prefix expression. + */ + Expr getExpr() { prefix_exprs(this, result, _) } + + /** + * Gets the op of this prefix expression. + */ + string getOp() { prefix_exprs(this, _, result) } + } + + /** + * INTERNAL: Do not use. + * A range expression. For example: + * ``` + * let x = 1..=10; + * let x = 1..10; + * let x = 10..; + * let x = ..10; + * let x = ..=10; + * let x = ..; + * ``` */ class RangeExpr extends @range_expr, Expr { override string toString() { result = "RangeExpr" } @@ -709,6 +1074,14 @@ module Raw { /** * INTERNAL: Do not use. + * A range pattern. For example: + * ``` + * match x { + * ..15 => "too cold", + * 16..=25 => "just right", + * 26.. => "too hot", + * } + * ``` */ class RangePat extends @range_pat, Pat { override string toString() { result = "RangePat" } @@ -726,38 +1099,52 @@ module Raw { /** * INTERNAL: Do not use. + * A record expression. For example: + * ``` + * let first = Foo { a: 1, b: 2 }; + * let second = Foo { a: 2, ..first }; + * Foo { a: 1, b: 2 }[2] = 10; + * Foo { .. } = second; + * ``` */ - class RecordLitExpr extends @record_lit_expr, Expr { - override string toString() { result = "RecordLitExpr" } + class RecordExpr extends @record_expr, Expr { + override string toString() { result = "RecordExpr" } /** - * Gets the path of this record lit expression, if it exists. + * Gets the path of this record expression, if it exists. */ - Unimplemented getPath() { record_lit_expr_paths(this, result) } + Path getPath() { record_expr_paths(this, result) } /** - * Gets the `index`th field of this record lit expression (0-based). + * Gets the `index`th fld of this record expression (0-based). */ - RecordLitField getField(int index) { record_lit_expr_fields(this, index, result) } + RecordExprField getFld(int index) { record_expr_flds(this, index, result) } /** - * Gets the spread of this record lit expression, if it exists. + * Gets the spread of this record expression, if it exists. */ - Expr getSpread() { record_lit_expr_spreads(this, result) } + Expr getSpread() { record_expr_spreads(this, result) } /** - * Holds if this record lit expression has ellipsis. + * Holds if this record expression has ellipsis. */ - predicate hasEllipsis() { record_lit_expr_has_ellipsis(this) } + predicate hasEllipsis() { record_expr_has_ellipsis(this) } /** - * Holds if this record lit expression is assignee expression. + * Holds if this record expression is assignee expression. */ - predicate isAssigneeExpr() { record_lit_expr_is_assignee_expr(this) } + predicate isAssigneeExpr() { record_expr_is_assignee_expr(this) } } /** * INTERNAL: Do not use. + * A record pattern. For example: + * ``` + * match x { + * Foo { a: 1, b: 2 } => "ok", + * Foo { .. } => "fail", + * } + * ``` */ class RecordPat extends @record_pat, Pat { override string toString() { result = "RecordPat" } @@ -765,12 +1152,12 @@ module Raw { /** * Gets the path of this record pat, if it exists. */ - Unimplemented getPath() { record_pat_paths(this, result) } + Path getPath() { record_pat_paths(this, result) } /** - * Gets the `index`th argument of this record pat (0-based). + * Gets the `index`th fld of this record pat (0-based). */ - RecordFieldPat getArg(int index) { record_pat_args(this, index, result) } + RecordPatField getFld(int index) { record_pat_flds(this, index, result) } /** * Holds if this record pat has ellipsis. @@ -780,6 +1167,13 @@ module Raw { /** * INTERNAL: Do not use. + * A reference expression. For example: + * ``` + * let ref_const = &foo; + * let ref_mut = &mut foo; + * let raw_const: &mut i32 = &raw const foo; + * let raw_mut: &mut i32 = &raw mut foo; + * ``` */ class RefExpr extends @ref_expr, Expr { override string toString() { result = "RefExpr" } @@ -802,6 +1196,13 @@ module Raw { /** * INTERNAL: Do not use. + * A reference pattern. For example: + * ``` + * match x { + * &mut Option::Some(y) => y, + * &Option::None => 0, + * }; + * ``` */ class RefPat extends @ref_pat, Pat { override string toString() { result = "RefPat" } @@ -819,6 +1220,17 @@ module Raw { /** * INTERNAL: Do not use. + * A return expression. For example: + * ``` + * fn some_value() -> i32 { + * return 42; + * } + * ``` + * ``` + * fn no_value() -> () { + * return; + * } + * ``` */ class ReturnExpr extends @return_expr, Expr { override string toString() { result = "ReturnExpr" } @@ -831,6 +1243,13 @@ module Raw { /** * INTERNAL: Do not use. + * A slice pattern. For example: + * ``` + * match x { + * [1, 2, 3, 4, 5] => "ok", + * [1, 2, ..] => "fail", + * [x, y, .., z, 7] => "fail", + * } */ class SlicePat extends @slice_pat, Pat { override string toString() { result = "SlicePat" } @@ -853,6 +1272,11 @@ module Raw { /** * INTERNAL: Do not use. + * A tuple expression. For example: + * ``` + * (1, "one"); + * (2, "two")[0] = 3; + * ``` */ class TupleExpr extends @tuple_expr, Expr { override string toString() { result = "TupleExpr" } @@ -870,6 +1294,11 @@ module Raw { /** * INTERNAL: Do not use. + * A tuple pattern. For example: + * ``` + * let (x, y) = (1, 2); + * let (a, b, .., z) = (1, 2, 3, 4, 5); + * ``` */ class TuplePat extends @tuple_pat, Pat { override string toString() { result = "TuplePat" } @@ -887,6 +1316,14 @@ module Raw { /** * INTERNAL: Do not use. + * A tuple struct pattern. For example: + * ``` + * match x { + * Tuple("a", 1, 2, 3) => "great", + * Tuple(.., 3) => "fine", + * Tuple(..) => "fail", + * }; + * ``` */ class TupleStructPat extends @tuple_struct_pat, Pat { override string toString() { result = "TupleStructPat" } @@ -894,7 +1331,7 @@ module Raw { /** * Gets the path of this tuple struct pat, if it exists. */ - Unimplemented getPath() { tuple_struct_pat_paths(this, result) } + Path getPath() { tuple_struct_pat_paths(this, result) } /** * Gets the `index`th argument of this tuple struct pat (0-based). @@ -909,37 +1346,42 @@ module Raw { /** * INTERNAL: Do not use. + * An underscore expression. For example: + * ``` + * _ = 42; + * ``` */ - class UnaryOpExpr extends @unary_op_expr, Expr { - override string toString() { result = "UnaryOpExpr" } - - /** - * Gets the expression of this unary op expression. - */ - Expr getExpr() { unary_op_exprs(this, result, _) } - - /** - * Gets the op of this unary op expression. - */ - string getOp() { unary_op_exprs(this, _, result) } + class UnderscoreExpr extends @underscore_expr, Expr { + override string toString() { result = "UnderscoreExpr" } } /** * INTERNAL: Do not use. + * A declaration that is not yet extracted. */ - class UnderscoreExpr extends @underscore_expr, Expr { - override string toString() { result = "UnderscoreExpr" } + class UnimplementedDeclaration extends @unimplemented_declaration, Declaration, Unimplemented { + override string toString() { result = "UnimplementedDeclaration" } } /** * INTERNAL: Do not use. + * A wildcard pattern. For example: + * ``` + * let _ = 42; + * ``` */ - class WildPat extends @wild_pat, Pat { - override string toString() { result = "WildPat" } + class WildcardPat extends @wildcard_pat, Pat { + override string toString() { result = "WildcardPat" } } /** * INTERNAL: Do not use. + * A `yeet` expression. For example: + * ``` + * if x < size { + * do yeet "index out of bounds"; + * } + * ``` */ class YeetExpr extends @yeet_expr, Expr { override string toString() { result = "YeetExpr" } @@ -952,6 +1394,13 @@ module Raw { /** * INTERNAL: Do not use. + * A `yield` expression. For example: + * ``` + * let one = #[coroutine] + * || { + * yield 1; + * }; + * ``` */ class YieldExpr extends @yield_expr, Expr { override string toString() { result = "YieldExpr" } @@ -964,6 +1413,13 @@ module Raw { /** * INTERNAL: Do not use. + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` */ class AsyncBlockExpr extends @async_block_expr, BlockExprBase { override string toString() { result = "AsyncBlockExpr" } @@ -971,6 +1427,18 @@ module Raw { /** * INTERNAL: Do not use. + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` */ class BlockExpr extends @block_expr, BlockExprBase { override string toString() { result = "BlockExpr" } @@ -983,6 +1451,11 @@ module Raw { /** * INTERNAL: Do not use. + * An element list expression. For example: + * ``` + * [1, 2, 3, 4, 5]; + * [1, 2, 3, 4, 5][0] = 6; + * ``` */ class ElementListExpr extends @element_list_expr, ArrayExpr { override string toString() { result = "ElementListExpr" } @@ -1000,6 +1473,9 @@ module Raw { /** * INTERNAL: Do not use. + * A repeat expression. For example: + * ``` + * [1; 10]; */ class RepeatExpr extends @repeat_expr, ArrayExpr { override string toString() { result = "RepeatExpr" } @@ -1017,6 +1493,13 @@ module Raw { /** * INTERNAL: Do not use. + * An unsafe block expression. For example: + * ``` + * let layout = unsafe { + * let x = 42; + * Layout::from_size_align_unchecked(size, align) + * }; + * ``` */ class UnsafeBlockExpr extends @unsafe_block_expr, BlockExprBase { override string toString() { result = "UnsafeBlockExpr" } diff --git a/rust/ql/lib/codeql/rust/generated/RecordExpr.qll b/rust/ql/lib/codeql/rust/generated/RecordExpr.qll new file mode 100644 index 000000000000..69724c31c721 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/RecordExpr.qll @@ -0,0 +1,90 @@ +// generated by codegen +/** + * This module provides the generated definition of `RecordExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Expr +import codeql.rust.elements.Path +import codeql.rust.elements.RecordExprField + +/** + * INTERNAL: This module contains the fully generated definition of `RecordExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A record expression. For example: + * ``` + * let first = Foo { a: 1, b: 2 }; + * let second = Foo { a: 2, ..first }; + * Foo { a: 1, b: 2 }[2] = 10; + * Foo { .. } = second; + * ``` + * INTERNAL: Do not reference the `Generated::RecordExpr` class directly. + * Use the subclass `RecordExpr`, where the following predicates are available. + */ + class RecordExpr extends Synth::TRecordExpr, Expr { + override string getAPrimaryQlClass() { result = "RecordExpr" } + + /** + * Gets the path of this record expression, if it exists. + */ + Path getPath() { + result = + Synth::convertPathFromRaw(Synth::convertRecordExprToRaw(this).(Raw::RecordExpr).getPath()) + } + + /** + * Holds if `getPath()` exists. + */ + final predicate hasPath() { exists(this.getPath()) } + + /** + * Gets the `index`th fld of this record expression (0-based). + */ + RecordExprField getFld(int index) { + result = + Synth::convertRecordExprFieldFromRaw(Synth::convertRecordExprToRaw(this) + .(Raw::RecordExpr) + .getFld(index)) + } + + /** + * Gets any of the flds of this record expression. + */ + final RecordExprField getAFld() { result = this.getFld(_) } + + /** + * Gets the number of flds of this record expression. + */ + final int getNumberOfFlds() { result = count(int i | exists(this.getFld(i))) } + + /** + * Gets the spread of this record expression, if it exists. + */ + Expr getSpread() { + result = + Synth::convertExprFromRaw(Synth::convertRecordExprToRaw(this).(Raw::RecordExpr).getSpread()) + } + + /** + * Holds if `getSpread()` exists. + */ + final predicate hasSpread() { exists(this.getSpread()) } + + /** + * Holds if this record expression has ellipsis. + */ + predicate hasEllipsis() { Synth::convertRecordExprToRaw(this).(Raw::RecordExpr).hasEllipsis() } + + /** + * Holds if this record expression is assignee expression. + */ + predicate isAssigneeExpr() { + Synth::convertRecordExprToRaw(this).(Raw::RecordExpr).isAssigneeExpr() + } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/RecordExprField.qll b/rust/ql/lib/codeql/rust/generated/RecordExprField.qll new file mode 100644 index 000000000000..23b741b14621 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/RecordExprField.qll @@ -0,0 +1,45 @@ +// generated by codegen +/** + * This module provides the generated definition of `RecordExprField`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.AstNode +import codeql.rust.elements.Expr + +/** + * INTERNAL: This module contains the fully generated definition of `RecordExprField` and should not + * be referenced directly. + */ +module Generated { + /** + * A field in a record expression. For example `a: 1` in: + * ``` + * Foo { a: 1, b: 2 }; + * ``` + * INTERNAL: Do not reference the `Generated::RecordExprField` class directly. + * Use the subclass `RecordExprField`, where the following predicates are available. + */ + class RecordExprField extends Synth::TRecordExprField, AstNode { + override string getAPrimaryQlClass() { result = "RecordExprField" } + + /** + * Gets the name of this record expression field. + */ + string getName() { + result = Synth::convertRecordExprFieldToRaw(this).(Raw::RecordExprField).getName() + } + + /** + * Gets the expression of this record expression field. + */ + Expr getExpr() { + result = + Synth::convertExprFromRaw(Synth::convertRecordExprFieldToRaw(this) + .(Raw::RecordExprField) + .getExpr()) + } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/RecordFieldPat.qll b/rust/ql/lib/codeql/rust/generated/RecordFieldPat.qll deleted file mode 100644 index d2924880931a..000000000000 --- a/rust/ql/lib/codeql/rust/generated/RecordFieldPat.qll +++ /dev/null @@ -1,41 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `RecordFieldPat`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.AstNode -import codeql.rust.elements.Pat - -/** - * INTERNAL: This module contains the fully generated definition of `RecordFieldPat` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::RecordFieldPat` class directly. - * Use the subclass `RecordFieldPat`, where the following predicates are available. - */ - class RecordFieldPat extends Synth::TRecordFieldPat, AstNode { - override string getAPrimaryQlClass() { result = "RecordFieldPat" } - - /** - * Gets the name of this record field pat. - */ - string getName() { - result = Synth::convertRecordFieldPatToRaw(this).(Raw::RecordFieldPat).getName() - } - - /** - * Gets the pat of this record field pat. - */ - Pat getPat() { - result = - Synth::convertPatFromRaw(Synth::convertRecordFieldPatToRaw(this) - .(Raw::RecordFieldPat) - .getPat()) - } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/RecordLitExpr.qll b/rust/ql/lib/codeql/rust/generated/RecordLitExpr.qll deleted file mode 100644 index 71318e79a6f3..000000000000 --- a/rust/ql/lib/codeql/rust/generated/RecordLitExpr.qll +++ /dev/null @@ -1,89 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `RecordLitExpr`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Expr -import codeql.rust.elements.RecordLitField -import codeql.rust.elements.Unimplemented - -/** - * INTERNAL: This module contains the fully generated definition of `RecordLitExpr` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::RecordLitExpr` class directly. - * Use the subclass `RecordLitExpr`, where the following predicates are available. - */ - class RecordLitExpr extends Synth::TRecordLitExpr, Expr { - override string getAPrimaryQlClass() { result = "RecordLitExpr" } - - /** - * Gets the path of this record lit expression, if it exists. - */ - Unimplemented getPath() { - result = - Synth::convertUnimplementedFromRaw(Synth::convertRecordLitExprToRaw(this) - .(Raw::RecordLitExpr) - .getPath()) - } - - /** - * Holds if `getPath()` exists. - */ - final predicate hasPath() { exists(this.getPath()) } - - /** - * Gets the `index`th field of this record lit expression (0-based). - */ - RecordLitField getField(int index) { - result = - Synth::convertRecordLitFieldFromRaw(Synth::convertRecordLitExprToRaw(this) - .(Raw::RecordLitExpr) - .getField(index)) - } - - /** - * Gets any of the fields of this record lit expression. - */ - final RecordLitField getAField() { result = this.getField(_) } - - /** - * Gets the number of fields of this record lit expression. - */ - final int getNumberOfFields() { result = count(int i | exists(this.getField(i))) } - - /** - * Gets the spread of this record lit expression, if it exists. - */ - Expr getSpread() { - result = - Synth::convertExprFromRaw(Synth::convertRecordLitExprToRaw(this) - .(Raw::RecordLitExpr) - .getSpread()) - } - - /** - * Holds if `getSpread()` exists. - */ - final predicate hasSpread() { exists(this.getSpread()) } - - /** - * Holds if this record lit expression has ellipsis. - */ - predicate hasEllipsis() { - Synth::convertRecordLitExprToRaw(this).(Raw::RecordLitExpr).hasEllipsis() - } - - /** - * Holds if this record lit expression is assignee expression. - */ - predicate isAssigneeExpr() { - Synth::convertRecordLitExprToRaw(this).(Raw::RecordLitExpr).isAssigneeExpr() - } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/RecordLitField.qll b/rust/ql/lib/codeql/rust/generated/RecordLitField.qll deleted file mode 100644 index 55a488e2ff6d..000000000000 --- a/rust/ql/lib/codeql/rust/generated/RecordLitField.qll +++ /dev/null @@ -1,41 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `RecordLitField`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.AstNode -import codeql.rust.elements.Expr - -/** - * INTERNAL: This module contains the fully generated definition of `RecordLitField` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::RecordLitField` class directly. - * Use the subclass `RecordLitField`, where the following predicates are available. - */ - class RecordLitField extends Synth::TRecordLitField, AstNode { - override string getAPrimaryQlClass() { result = "RecordLitField" } - - /** - * Gets the name of this record lit field. - */ - string getName() { - result = Synth::convertRecordLitFieldToRaw(this).(Raw::RecordLitField).getName() - } - - /** - * Gets the expression of this record lit field. - */ - Expr getExpr() { - result = - Synth::convertExprFromRaw(Synth::convertRecordLitFieldToRaw(this) - .(Raw::RecordLitField) - .getExpr()) - } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/RecordPat.qll b/rust/ql/lib/codeql/rust/generated/RecordPat.qll index dca4cbb93822..84d51a1da378 100644 --- a/rust/ql/lib/codeql/rust/generated/RecordPat.qll +++ b/rust/ql/lib/codeql/rust/generated/RecordPat.qll @@ -7,8 +7,8 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.Pat -import codeql.rust.elements.RecordFieldPat -import codeql.rust.elements.Unimplemented +import codeql.rust.elements.Path +import codeql.rust.elements.RecordPatField /** * INTERNAL: This module contains the fully generated definition of `RecordPat` and should not @@ -16,6 +16,13 @@ import codeql.rust.elements.Unimplemented */ module Generated { /** + * A record pattern. For example: + * ``` + * match x { + * Foo { a: 1, b: 2 } => "ok", + * Foo { .. } => "fail", + * } + * ``` * INTERNAL: Do not reference the `Generated::RecordPat` class directly. * Use the subclass `RecordPat`, where the following predicates are available. */ @@ -25,11 +32,9 @@ module Generated { /** * Gets the path of this record pat, if it exists. */ - Unimplemented getPath() { + Path getPath() { result = - Synth::convertUnimplementedFromRaw(Synth::convertRecordPatToRaw(this) - .(Raw::RecordPat) - .getPath()) + Synth::convertPathFromRaw(Synth::convertRecordPatToRaw(this).(Raw::RecordPat).getPath()) } /** @@ -38,24 +43,24 @@ module Generated { final predicate hasPath() { exists(this.getPath()) } /** - * Gets the `index`th argument of this record pat (0-based). + * Gets the `index`th fld of this record pat (0-based). */ - RecordFieldPat getArg(int index) { + RecordPatField getFld(int index) { result = - Synth::convertRecordFieldPatFromRaw(Synth::convertRecordPatToRaw(this) + Synth::convertRecordPatFieldFromRaw(Synth::convertRecordPatToRaw(this) .(Raw::RecordPat) - .getArg(index)) + .getFld(index)) } /** - * Gets any of the arguments of this record pat. + * Gets any of the flds of this record pat. */ - final RecordFieldPat getAnArg() { result = this.getArg(_) } + final RecordPatField getAFld() { result = this.getFld(_) } /** - * Gets the number of arguments of this record pat. + * Gets the number of flds of this record pat. */ - final int getNumberOfArgs() { result = count(int i | exists(this.getArg(i))) } + final int getNumberOfFlds() { result = count(int i | exists(this.getFld(i))) } /** * Holds if this record pat has ellipsis. diff --git a/rust/ql/lib/codeql/rust/generated/RecordPatField.qll b/rust/ql/lib/codeql/rust/generated/RecordPatField.qll new file mode 100644 index 000000000000..01d349c11881 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/RecordPatField.qll @@ -0,0 +1,45 @@ +// generated by codegen +/** + * This module provides the generated definition of `RecordPatField`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.AstNode +import codeql.rust.elements.Pat + +/** + * INTERNAL: This module contains the fully generated definition of `RecordPatField` and should not + * be referenced directly. + */ +module Generated { + /** + * A field in a record pattern. For example `a: 1` in: + * ``` + * let Foo { a: 1, b: 2 } = foo; + * ``` + * INTERNAL: Do not reference the `Generated::RecordPatField` class directly. + * Use the subclass `RecordPatField`, where the following predicates are available. + */ + class RecordPatField extends Synth::TRecordPatField, AstNode { + override string getAPrimaryQlClass() { result = "RecordPatField" } + + /** + * Gets the name of this record pat field. + */ + string getName() { + result = Synth::convertRecordPatFieldToRaw(this).(Raw::RecordPatField).getName() + } + + /** + * Gets the pat of this record pat field. + */ + Pat getPat() { + result = + Synth::convertPatFromRaw(Synth::convertRecordPatFieldToRaw(this) + .(Raw::RecordPatField) + .getPat()) + } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/RefExpr.qll b/rust/ql/lib/codeql/rust/generated/RefExpr.qll index 6fce583db98e..43886e0ad410 100644 --- a/rust/ql/lib/codeql/rust/generated/RefExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/RefExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A reference expression. For example: + * ``` + * let ref_const = &foo; + * let ref_mut = &mut foo; + * let raw_const: &mut i32 = &raw const foo; + * let raw_mut: &mut i32 = &raw mut foo; + * ``` * INTERNAL: Do not reference the `Generated::RefExpr` class directly. * Use the subclass `RefExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/RefPat.qll b/rust/ql/lib/codeql/rust/generated/RefPat.qll index 33674b00330b..a13e517a3c87 100644 --- a/rust/ql/lib/codeql/rust/generated/RefPat.qll +++ b/rust/ql/lib/codeql/rust/generated/RefPat.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A reference pattern. For example: + * ``` + * match x { + * &mut Option::Some(y) => y, + * &Option::None => 0, + * }; + * ``` * INTERNAL: Do not reference the `Generated::RefPat` class directly. * Use the subclass `RefPat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/RepeatExpr.qll b/rust/ql/lib/codeql/rust/generated/RepeatExpr.qll index 17df2bb4db1a..fab7491ceeda 100644 --- a/rust/ql/lib/codeql/rust/generated/RepeatExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/RepeatExpr.qll @@ -15,6 +15,9 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A repeat expression. For example: + * ``` + * [1; 10]; * INTERNAL: Do not reference the `Generated::RepeatExpr` class directly. * Use the subclass `RepeatExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ReturnExpr.qll b/rust/ql/lib/codeql/rust/generated/ReturnExpr.qll index 1d9ee4be7ac6..9bb35923999d 100644 --- a/rust/ql/lib/codeql/rust/generated/ReturnExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ReturnExpr.qll @@ -14,6 +14,17 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A return expression. For example: + * ``` + * fn some_value() -> i32 { + * return 42; + * } + * ``` + * ``` + * fn no_value() -> () { + * return; + * } + * ``` * INTERNAL: Do not reference the `Generated::ReturnExpr` class directly. * Use the subclass `ReturnExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/SlicePat.qll b/rust/ql/lib/codeql/rust/generated/SlicePat.qll index 272be5951670..106f0849dc78 100644 --- a/rust/ql/lib/codeql/rust/generated/SlicePat.qll +++ b/rust/ql/lib/codeql/rust/generated/SlicePat.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A slice pattern. For example: + * ``` + * match x { + * [1, 2, 3, 4, 5] => "ok", + * [1, 2, ..] => "fail", + * [x, y, .., z, 7] => "fail", + * } * INTERNAL: Do not reference the `Generated::SlicePat` class directly. * Use the subclass `SlicePat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Stmt.qll b/rust/ql/lib/codeql/rust/generated/Stmt.qll index d1536f06e7cd..66cb42bee598 100644 --- a/rust/ql/lib/codeql/rust/generated/Stmt.qll +++ b/rust/ql/lib/codeql/rust/generated/Stmt.qll @@ -14,6 +14,7 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for statements. * INTERNAL: Do not reference the `Generated::Stmt` class directly. * Use the subclass `Stmt`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Synth.qll b/rust/ql/lib/codeql/rust/generated/Synth.qll index fa4b015ef44f..d3599fc21461 100644 --- a/rust/ql/lib/codeql/rust/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/generated/Synth.qll @@ -18,23 +18,23 @@ module Synth { /** * INTERNAL: Do not use. */ - TAsyncBlockExpr(Raw::AsyncBlockExpr id) { constructAsyncBlockExpr(id) } or + TAsmExpr(Raw::AsmExpr id) { constructAsmExpr(id) } or /** * INTERNAL: Do not use. */ - TAwaitExpr(Raw::AwaitExpr id) { constructAwaitExpr(id) } or + TAsyncBlockExpr(Raw::AsyncBlockExpr id) { constructAsyncBlockExpr(id) } or /** * INTERNAL: Do not use. */ - TBecomeExpr(Raw::BecomeExpr id) { constructBecomeExpr(id) } or + TAwaitExpr(Raw::AwaitExpr id) { constructAwaitExpr(id) } or /** * INTERNAL: Do not use. */ - TBinaryOpExpr(Raw::BinaryOpExpr id) { constructBinaryOpExpr(id) } or + TBecomeExpr(Raw::BecomeExpr id) { constructBecomeExpr(id) } or /** * INTERNAL: Do not use. */ - TBindPat(Raw::BindPat id) { constructBindPat(id) } or + TBinaryExpr(Raw::BinaryExpr id) { constructBinaryExpr(id) } or /** * INTERNAL: Do not use. */ @@ -94,15 +94,19 @@ module Synth { /** * INTERNAL: Do not use. */ - TIfExpr(Raw::IfExpr id) { constructIfExpr(id) } or + TGenericArgList(Raw::GenericArgList id) { constructGenericArgList(id) } or /** * INTERNAL: Do not use. */ - TIndexExpr(Raw::IndexExpr id) { constructIndexExpr(id) } or + TIdentPat(Raw::IdentPat id) { constructIdentPat(id) } or + /** + * INTERNAL: Do not use. + */ + TIfExpr(Raw::IfExpr id) { constructIfExpr(id) } or /** * INTERNAL: Do not use. */ - TInlineAsmExpr(Raw::InlineAsmExpr id) { constructInlineAsmExpr(id) } or + TIndexExpr(Raw::IndexExpr id) { constructIndexExpr(id) } or /** * INTERNAL: Do not use. */ @@ -122,11 +126,11 @@ module Synth { /** * INTERNAL: Do not use. */ - TLitPat(Raw::LitPat id) { constructLitPat(id) } or + TLiteralExpr(Raw::LiteralExpr id) { constructLiteralExpr(id) } or /** * INTERNAL: Do not use. */ - TLiteralExpr(Raw::LiteralExpr id) { constructLiteralExpr(id) } or + TLiteralPat(Raw::LiteralPat id) { constructLiteralPat(id) } or /** * INTERNAL: Do not use. */ @@ -163,6 +167,10 @@ module Synth { * INTERNAL: Do not use. */ TOrPat(Raw::OrPat id) { constructOrPat(id) } or + /** + * INTERNAL: Do not use. + */ + TPath(Raw::Path id) { constructPath(id) } or /** * INTERNAL: Do not use. */ @@ -171,6 +179,10 @@ module Synth { * INTERNAL: Do not use. */ TPathPat(Raw::PathPat id) { constructPathPat(id) } or + /** + * INTERNAL: Do not use. + */ + TPrefixExpr(Raw::PrefixExpr id) { constructPrefixExpr(id) } or /** * INTERNAL: Do not use. */ @@ -182,19 +194,19 @@ module Synth { /** * INTERNAL: Do not use. */ - TRecordFieldPat(Raw::RecordFieldPat id) { constructRecordFieldPat(id) } or + TRecordExpr(Raw::RecordExpr id) { constructRecordExpr(id) } or /** * INTERNAL: Do not use. */ - TRecordLitExpr(Raw::RecordLitExpr id) { constructRecordLitExpr(id) } or + TRecordExprField(Raw::RecordExprField id) { constructRecordExprField(id) } or /** * INTERNAL: Do not use. */ - TRecordLitField(Raw::RecordLitField id) { constructRecordLitField(id) } or + TRecordPat(Raw::RecordPat id) { constructRecordPat(id) } or /** * INTERNAL: Do not use. */ - TRecordPat(Raw::RecordPat id) { constructRecordPat(id) } or + TRecordPatField(Raw::RecordPatField id) { constructRecordPatField(id) } or /** * INTERNAL: Do not use. */ @@ -231,10 +243,6 @@ module Synth { * INTERNAL: Do not use. */ TTypeRef(Raw::TypeRef id) { constructTypeRef(id) } or - /** - * INTERNAL: Do not use. - */ - TUnaryOpExpr(Raw::UnaryOpExpr id) { constructUnaryOpExpr(id) } or /** * INTERNAL: Do not use. */ @@ -242,7 +250,9 @@ module Synth { /** * INTERNAL: Do not use. */ - TUnimplemented(Raw::Unimplemented id) { constructUnimplemented(id) } or + TUnimplementedDeclaration(Raw::UnimplementedDeclaration id) { + constructUnimplementedDeclaration(id) + } or /** * INTERNAL: Do not use. */ @@ -250,7 +260,7 @@ module Synth { /** * INTERNAL: Do not use. */ - TWildPat(Raw::WildPat id) { constructWildPat(id) } or + TWildcardPat(Raw::WildcardPat id) { constructWildcardPat(id) } or /** * INTERNAL: Do not use. */ @@ -269,8 +279,8 @@ module Synth { * INTERNAL: Do not use. */ class TAstNode = - TDeclaration or TExpr or TLabel or TMatchArm or TPat or TRecordFieldPat or TRecordLitField or - TStmt or TTypeRef or TUnimplemented; + TDeclaration or TExpr or TGenericArgList or TLabel or TMatchArm or TPat or TPath or + TRecordExprField or TRecordPatField or TStmt or TTypeRef; /** * INTERNAL: Do not use. @@ -280,17 +290,17 @@ module Synth { /** * INTERNAL: Do not use. */ - class TDeclaration = TFunction or TModule; + class TDeclaration = TFunction or TModule or TUnimplementedDeclaration; /** * INTERNAL: Do not use. */ class TExpr = - TArrayExpr or TAwaitExpr or TBecomeExpr or TBinaryOpExpr or TBlockExprBase or TBoxExpr or - TBreakExpr or TCallExpr or TCastExpr or TClosureExpr or TConstExpr or TContinueExpr or - TFieldExpr or TIfExpr or TIndexExpr or TInlineAsmExpr or TLetExpr or TLiteralExpr or + TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBlockExprBase or + TBoxExpr or TBreakExpr or TCallExpr or TCastExpr or TClosureExpr or TConstExpr or + TContinueExpr or TFieldExpr or TIfExpr or TIndexExpr or TLetExpr or TLiteralExpr or TLoopExpr or TMatchExpr or TMethodCallExpr or TMissingExpr or TOffsetOfExpr or TPathExpr or - TRangeExpr or TRecordLitExpr or TRefExpr or TReturnExpr or TTupleExpr or TUnaryOpExpr or + TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTupleExpr or TUnderscoreExpr or TYeetExpr or TYieldExpr; /** @@ -302,14 +312,27 @@ module Synth { * INTERNAL: Do not use. */ class TPat = - TBindPat or TBoxPat or TConstBlockPat or TLitPat or TMissingPat or TOrPat or TPathPat or - TRangePat or TRecordPat or TRefPat or TSlicePat or TTuplePat or TTupleStructPat or TWildPat; + TBoxPat or TConstBlockPat or TIdentPat or TLiteralPat or TMissingPat or TOrPat or TPathPat or + TRangePat or TRecordPat or TRefPat or TSlicePat or TTuplePat or TTupleStructPat or + TWildcardPat; /** * INTERNAL: Do not use. */ class TStmt = TExprStmt or TItemStmt or TLetStmt; + /** + * INTERNAL: Do not use. + */ + class TUnimplemented = TGenericArgList or TPath or TTypeRef or TUnimplementedDeclaration; + + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TAsmExpr`, if possible. + */ + cached + TAsmExpr convertAsmExprFromRaw(Raw::Element e) { result = TAsmExpr(e) } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TAsyncBlockExpr`, if possible. @@ -333,17 +356,10 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TBinaryOpExpr`, if possible. + * Converts a raw element to a synthesized `TBinaryExpr`, if possible. */ cached - TBinaryOpExpr convertBinaryOpExprFromRaw(Raw::Element e) { result = TBinaryOpExpr(e) } - - /** - * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TBindPat`, if possible. - */ - cached - TBindPat convertBindPatFromRaw(Raw::Element e) { result = TBindPat(e) } + TBinaryExpr convertBinaryExprFromRaw(Raw::Element e) { result = TBinaryExpr(e) } /** * INTERNAL: Do not use. @@ -445,24 +461,31 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TIfExpr`, if possible. + * Converts a raw element to a synthesized `TGenericArgList`, if possible. */ cached - TIfExpr convertIfExprFromRaw(Raw::Element e) { result = TIfExpr(e) } + TGenericArgList convertGenericArgListFromRaw(Raw::Element e) { result = TGenericArgList(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TIndexExpr`, if possible. + * Converts a raw element to a synthesized `TIdentPat`, if possible. */ cached - TIndexExpr convertIndexExprFromRaw(Raw::Element e) { result = TIndexExpr(e) } + TIdentPat convertIdentPatFromRaw(Raw::Element e) { result = TIdentPat(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TInlineAsmExpr`, if possible. + * Converts a raw element to a synthesized `TIfExpr`, if possible. */ cached - TInlineAsmExpr convertInlineAsmExprFromRaw(Raw::Element e) { result = TInlineAsmExpr(e) } + TIfExpr convertIfExprFromRaw(Raw::Element e) { result = TIfExpr(e) } + + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TIndexExpr`, if possible. + */ + cached + TIndexExpr convertIndexExprFromRaw(Raw::Element e) { result = TIndexExpr(e) } /** * INTERNAL: Do not use. @@ -494,17 +517,17 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TLitPat`, if possible. + * Converts a raw element to a synthesized `TLiteralExpr`, if possible. */ cached - TLitPat convertLitPatFromRaw(Raw::Element e) { result = TLitPat(e) } + TLiteralExpr convertLiteralExprFromRaw(Raw::Element e) { result = TLiteralExpr(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TLiteralExpr`, if possible. + * Converts a raw element to a synthesized `TLiteralPat`, if possible. */ cached - TLiteralExpr convertLiteralExprFromRaw(Raw::Element e) { result = TLiteralExpr(e) } + TLiteralPat convertLiteralPatFromRaw(Raw::Element e) { result = TLiteralPat(e) } /** * INTERNAL: Do not use. @@ -569,6 +592,13 @@ module Synth { cached TOrPat convertOrPatFromRaw(Raw::Element e) { result = TOrPat(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TPath`, if possible. + */ + cached + TPath convertPathFromRaw(Raw::Element e) { result = TPath(e) } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TPathExpr`, if possible. @@ -583,6 +613,13 @@ module Synth { cached TPathPat convertPathPatFromRaw(Raw::Element e) { result = TPathPat(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TPrefixExpr`, if possible. + */ + cached + TPrefixExpr convertPrefixExprFromRaw(Raw::Element e) { result = TPrefixExpr(e) } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TRangeExpr`, if possible. @@ -599,31 +636,31 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TRecordFieldPat`, if possible. + * Converts a raw element to a synthesized `TRecordExpr`, if possible. */ cached - TRecordFieldPat convertRecordFieldPatFromRaw(Raw::Element e) { result = TRecordFieldPat(e) } + TRecordExpr convertRecordExprFromRaw(Raw::Element e) { result = TRecordExpr(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TRecordLitExpr`, if possible. + * Converts a raw element to a synthesized `TRecordExprField`, if possible. */ cached - TRecordLitExpr convertRecordLitExprFromRaw(Raw::Element e) { result = TRecordLitExpr(e) } + TRecordExprField convertRecordExprFieldFromRaw(Raw::Element e) { result = TRecordExprField(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TRecordLitField`, if possible. + * Converts a raw element to a synthesized `TRecordPat`, if possible. */ cached - TRecordLitField convertRecordLitFieldFromRaw(Raw::Element e) { result = TRecordLitField(e) } + TRecordPat convertRecordPatFromRaw(Raw::Element e) { result = TRecordPat(e) } /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TRecordPat`, if possible. + * Converts a raw element to a synthesized `TRecordPatField`, if possible. */ cached - TRecordPat convertRecordPatFromRaw(Raw::Element e) { result = TRecordPat(e) } + TRecordPatField convertRecordPatFieldFromRaw(Raw::Element e) { result = TRecordPatField(e) } /** * INTERNAL: Do not use. @@ -688,13 +725,6 @@ module Synth { cached TTypeRef convertTypeRefFromRaw(Raw::Element e) { result = TTypeRef(e) } - /** - * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TUnaryOpExpr`, if possible. - */ - cached - TUnaryOpExpr convertUnaryOpExprFromRaw(Raw::Element e) { result = TUnaryOpExpr(e) } - /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TUnderscoreExpr`, if possible. @@ -704,10 +734,12 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TUnimplemented`, if possible. + * Converts a raw element to a synthesized `TUnimplementedDeclaration`, if possible. */ cached - TUnimplemented convertUnimplementedFromRaw(Raw::Element e) { result = TUnimplemented(e) } + TUnimplementedDeclaration convertUnimplementedDeclarationFromRaw(Raw::Element e) { + result = TUnimplementedDeclaration(e) + } /** * INTERNAL: Do not use. @@ -718,10 +750,10 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a raw element to a synthesized `TWildPat`, if possible. + * Converts a raw element to a synthesized `TWildcardPat`, if possible. */ cached - TWildPat convertWildPatFromRaw(Raw::Element e) { result = TWildPat(e) } + TWildcardPat convertWildcardPatFromRaw(Raw::Element e) { result = TWildcardPat(e) } /** * INTERNAL: Do not use. @@ -758,21 +790,23 @@ module Synth { or result = convertExprFromRaw(e) or + result = convertGenericArgListFromRaw(e) + or result = convertLabelFromRaw(e) or result = convertMatchArmFromRaw(e) or result = convertPatFromRaw(e) or - result = convertRecordFieldPatFromRaw(e) + result = convertPathFromRaw(e) + or + result = convertRecordExprFieldFromRaw(e) or - result = convertRecordLitFieldFromRaw(e) + result = convertRecordPatFieldFromRaw(e) or result = convertStmtFromRaw(e) or result = convertTypeRefFromRaw(e) - or - result = convertUnimplementedFromRaw(e) } /** @@ -797,6 +831,8 @@ module Synth { result = convertFunctionFromRaw(e) or result = convertModuleFromRaw(e) + or + result = convertUnimplementedDeclarationFromRaw(e) } /** @@ -804,7 +840,11 @@ module Synth { * Converts a raw DB element to a synthesized `TElement`, if possible. */ cached - TElement convertElementFromRaw(Raw::Element e) { result = convertLocatableFromRaw(e) } + TElement convertElementFromRaw(Raw::Element e) { + result = convertLocatableFromRaw(e) + or + result = convertUnimplementedFromRaw(e) + } /** * INTERNAL: Do not use. @@ -814,11 +854,13 @@ module Synth { TExpr convertExprFromRaw(Raw::Element e) { result = convertArrayExprFromRaw(e) or + result = convertAsmExprFromRaw(e) + or result = convertAwaitExprFromRaw(e) or result = convertBecomeExprFromRaw(e) or - result = convertBinaryOpExprFromRaw(e) + result = convertBinaryExprFromRaw(e) or result = convertBlockExprBaseFromRaw(e) or @@ -842,8 +884,6 @@ module Synth { or result = convertIndexExprFromRaw(e) or - result = convertInlineAsmExprFromRaw(e) - or result = convertLetExprFromRaw(e) or result = convertLiteralExprFromRaw(e) @@ -860,9 +900,11 @@ module Synth { or result = convertPathExprFromRaw(e) or + result = convertPrefixExprFromRaw(e) + or result = convertRangeExprFromRaw(e) or - result = convertRecordLitExprFromRaw(e) + result = convertRecordExprFromRaw(e) or result = convertRefExprFromRaw(e) or @@ -870,8 +912,6 @@ module Synth { or result = convertTupleExprFromRaw(e) or - result = convertUnaryOpExprFromRaw(e) - or result = convertUnderscoreExprFromRaw(e) or result = convertYeetExprFromRaw(e) @@ -892,13 +932,13 @@ module Synth { */ cached TPat convertPatFromRaw(Raw::Element e) { - result = convertBindPatFromRaw(e) - or result = convertBoxPatFromRaw(e) or result = convertConstBlockPatFromRaw(e) or - result = convertLitPatFromRaw(e) + result = convertIdentPatFromRaw(e) + or + result = convertLiteralPatFromRaw(e) or result = convertMissingPatFromRaw(e) or @@ -918,7 +958,7 @@ module Synth { or result = convertTupleStructPatFromRaw(e) or - result = convertWildPatFromRaw(e) + result = convertWildcardPatFromRaw(e) } /** @@ -934,6 +974,28 @@ module Synth { result = convertLetStmtFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TUnimplemented`, if possible. + */ + cached + TUnimplemented convertUnimplementedFromRaw(Raw::Element e) { + result = convertGenericArgListFromRaw(e) + or + result = convertPathFromRaw(e) + or + result = convertTypeRefFromRaw(e) + or + result = convertUnimplementedDeclarationFromRaw(e) + } + + /** + * INTERNAL: Do not use. + * Converts a synthesized `TAsmExpr` to a raw DB element, if possible. + */ + cached + Raw::Element convertAsmExprToRaw(TAsmExpr e) { e = TAsmExpr(result) } + /** * INTERNAL: Do not use. * Converts a synthesized `TAsyncBlockExpr` to a raw DB element, if possible. @@ -957,17 +1019,10 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TBinaryOpExpr` to a raw DB element, if possible. - */ - cached - Raw::Element convertBinaryOpExprToRaw(TBinaryOpExpr e) { e = TBinaryOpExpr(result) } - - /** - * INTERNAL: Do not use. - * Converts a synthesized `TBindPat` to a raw DB element, if possible. + * Converts a synthesized `TBinaryExpr` to a raw DB element, if possible. */ cached - Raw::Element convertBindPatToRaw(TBindPat e) { e = TBindPat(result) } + Raw::Element convertBinaryExprToRaw(TBinaryExpr e) { e = TBinaryExpr(result) } /** * INTERNAL: Do not use. @@ -1069,24 +1124,31 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TIfExpr` to a raw DB element, if possible. + * Converts a synthesized `TGenericArgList` to a raw DB element, if possible. */ cached - Raw::Element convertIfExprToRaw(TIfExpr e) { e = TIfExpr(result) } + Raw::Element convertGenericArgListToRaw(TGenericArgList e) { e = TGenericArgList(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TIndexExpr` to a raw DB element, if possible. + * Converts a synthesized `TIdentPat` to a raw DB element, if possible. */ cached - Raw::Element convertIndexExprToRaw(TIndexExpr e) { e = TIndexExpr(result) } + Raw::Element convertIdentPatToRaw(TIdentPat e) { e = TIdentPat(result) } + + /** + * INTERNAL: Do not use. + * Converts a synthesized `TIfExpr` to a raw DB element, if possible. + */ + cached + Raw::Element convertIfExprToRaw(TIfExpr e) { e = TIfExpr(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TInlineAsmExpr` to a raw DB element, if possible. + * Converts a synthesized `TIndexExpr` to a raw DB element, if possible. */ cached - Raw::Element convertInlineAsmExprToRaw(TInlineAsmExpr e) { e = TInlineAsmExpr(result) } + Raw::Element convertIndexExprToRaw(TIndexExpr e) { e = TIndexExpr(result) } /** * INTERNAL: Do not use. @@ -1118,17 +1180,17 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TLitPat` to a raw DB element, if possible. + * Converts a synthesized `TLiteralExpr` to a raw DB element, if possible. */ cached - Raw::Element convertLitPatToRaw(TLitPat e) { e = TLitPat(result) } + Raw::Element convertLiteralExprToRaw(TLiteralExpr e) { e = TLiteralExpr(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TLiteralExpr` to a raw DB element, if possible. + * Converts a synthesized `TLiteralPat` to a raw DB element, if possible. */ cached - Raw::Element convertLiteralExprToRaw(TLiteralExpr e) { e = TLiteralExpr(result) } + Raw::Element convertLiteralPatToRaw(TLiteralPat e) { e = TLiteralPat(result) } /** * INTERNAL: Do not use. @@ -1193,6 +1255,13 @@ module Synth { cached Raw::Element convertOrPatToRaw(TOrPat e) { e = TOrPat(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TPath` to a raw DB element, if possible. + */ + cached + Raw::Element convertPathToRaw(TPath e) { e = TPath(result) } + /** * INTERNAL: Do not use. * Converts a synthesized `TPathExpr` to a raw DB element, if possible. @@ -1207,6 +1276,13 @@ module Synth { cached Raw::Element convertPathPatToRaw(TPathPat e) { e = TPathPat(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TPrefixExpr` to a raw DB element, if possible. + */ + cached + Raw::Element convertPrefixExprToRaw(TPrefixExpr e) { e = TPrefixExpr(result) } + /** * INTERNAL: Do not use. * Converts a synthesized `TRangeExpr` to a raw DB element, if possible. @@ -1223,31 +1299,31 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TRecordFieldPat` to a raw DB element, if possible. + * Converts a synthesized `TRecordExpr` to a raw DB element, if possible. */ cached - Raw::Element convertRecordFieldPatToRaw(TRecordFieldPat e) { e = TRecordFieldPat(result) } + Raw::Element convertRecordExprToRaw(TRecordExpr e) { e = TRecordExpr(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TRecordLitExpr` to a raw DB element, if possible. + * Converts a synthesized `TRecordExprField` to a raw DB element, if possible. */ cached - Raw::Element convertRecordLitExprToRaw(TRecordLitExpr e) { e = TRecordLitExpr(result) } + Raw::Element convertRecordExprFieldToRaw(TRecordExprField e) { e = TRecordExprField(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TRecordLitField` to a raw DB element, if possible. + * Converts a synthesized `TRecordPat` to a raw DB element, if possible. */ cached - Raw::Element convertRecordLitFieldToRaw(TRecordLitField e) { e = TRecordLitField(result) } + Raw::Element convertRecordPatToRaw(TRecordPat e) { e = TRecordPat(result) } /** * INTERNAL: Do not use. - * Converts a synthesized `TRecordPat` to a raw DB element, if possible. + * Converts a synthesized `TRecordPatField` to a raw DB element, if possible. */ cached - Raw::Element convertRecordPatToRaw(TRecordPat e) { e = TRecordPat(result) } + Raw::Element convertRecordPatFieldToRaw(TRecordPatField e) { e = TRecordPatField(result) } /** * INTERNAL: Do not use. @@ -1312,13 +1388,6 @@ module Synth { cached Raw::Element convertTypeRefToRaw(TTypeRef e) { e = TTypeRef(result) } - /** - * INTERNAL: Do not use. - * Converts a synthesized `TUnaryOpExpr` to a raw DB element, if possible. - */ - cached - Raw::Element convertUnaryOpExprToRaw(TUnaryOpExpr e) { e = TUnaryOpExpr(result) } - /** * INTERNAL: Do not use. * Converts a synthesized `TUnderscoreExpr` to a raw DB element, if possible. @@ -1328,10 +1397,12 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TUnimplemented` to a raw DB element, if possible. + * Converts a synthesized `TUnimplementedDeclaration` to a raw DB element, if possible. */ cached - Raw::Element convertUnimplementedToRaw(TUnimplemented e) { e = TUnimplemented(result) } + Raw::Element convertUnimplementedDeclarationToRaw(TUnimplementedDeclaration e) { + e = TUnimplementedDeclaration(result) + } /** * INTERNAL: Do not use. @@ -1342,10 +1413,10 @@ module Synth { /** * INTERNAL: Do not use. - * Converts a synthesized `TWildPat` to a raw DB element, if possible. + * Converts a synthesized `TWildcardPat` to a raw DB element, if possible. */ cached - Raw::Element convertWildPatToRaw(TWildPat e) { e = TWildPat(result) } + Raw::Element convertWildcardPatToRaw(TWildcardPat e) { e = TWildcardPat(result) } /** * INTERNAL: Do not use. @@ -1382,21 +1453,23 @@ module Synth { or result = convertExprToRaw(e) or + result = convertGenericArgListToRaw(e) + or result = convertLabelToRaw(e) or result = convertMatchArmToRaw(e) or result = convertPatToRaw(e) or - result = convertRecordFieldPatToRaw(e) + result = convertPathToRaw(e) + or + result = convertRecordExprFieldToRaw(e) or - result = convertRecordLitFieldToRaw(e) + result = convertRecordPatFieldToRaw(e) or result = convertStmtToRaw(e) or result = convertTypeRefToRaw(e) - or - result = convertUnimplementedToRaw(e) } /** @@ -1421,6 +1494,8 @@ module Synth { result = convertFunctionToRaw(e) or result = convertModuleToRaw(e) + or + result = convertUnimplementedDeclarationToRaw(e) } /** @@ -1428,7 +1503,11 @@ module Synth { * Converts a synthesized `TElement` to a raw DB element, if possible. */ cached - Raw::Element convertElementToRaw(TElement e) { result = convertLocatableToRaw(e) } + Raw::Element convertElementToRaw(TElement e) { + result = convertLocatableToRaw(e) + or + result = convertUnimplementedToRaw(e) + } /** * INTERNAL: Do not use. @@ -1438,11 +1517,13 @@ module Synth { Raw::Element convertExprToRaw(TExpr e) { result = convertArrayExprToRaw(e) or + result = convertAsmExprToRaw(e) + or result = convertAwaitExprToRaw(e) or result = convertBecomeExprToRaw(e) or - result = convertBinaryOpExprToRaw(e) + result = convertBinaryExprToRaw(e) or result = convertBlockExprBaseToRaw(e) or @@ -1466,8 +1547,6 @@ module Synth { or result = convertIndexExprToRaw(e) or - result = convertInlineAsmExprToRaw(e) - or result = convertLetExprToRaw(e) or result = convertLiteralExprToRaw(e) @@ -1484,9 +1563,11 @@ module Synth { or result = convertPathExprToRaw(e) or + result = convertPrefixExprToRaw(e) + or result = convertRangeExprToRaw(e) or - result = convertRecordLitExprToRaw(e) + result = convertRecordExprToRaw(e) or result = convertRefExprToRaw(e) or @@ -1494,8 +1575,6 @@ module Synth { or result = convertTupleExprToRaw(e) or - result = convertUnaryOpExprToRaw(e) - or result = convertUnderscoreExprToRaw(e) or result = convertYeetExprToRaw(e) @@ -1516,13 +1595,13 @@ module Synth { */ cached Raw::Element convertPatToRaw(TPat e) { - result = convertBindPatToRaw(e) - or result = convertBoxPatToRaw(e) or result = convertConstBlockPatToRaw(e) or - result = convertLitPatToRaw(e) + result = convertIdentPatToRaw(e) + or + result = convertLiteralPatToRaw(e) or result = convertMissingPatToRaw(e) or @@ -1542,7 +1621,7 @@ module Synth { or result = convertTupleStructPatToRaw(e) or - result = convertWildPatToRaw(e) + result = convertWildcardPatToRaw(e) } /** @@ -1557,4 +1636,19 @@ module Synth { or result = convertLetStmtToRaw(e) } + + /** + * INTERNAL: Do not use. + * Converts a synthesized `TUnimplemented` to a raw DB element, if possible. + */ + cached + Raw::Element convertUnimplementedToRaw(TUnimplemented e) { + result = convertGenericArgListToRaw(e) + or + result = convertPathToRaw(e) + or + result = convertTypeRefToRaw(e) + or + result = convertUnimplementedDeclarationToRaw(e) + } } diff --git a/rust/ql/lib/codeql/rust/generated/SynthConstructors.qll b/rust/ql/lib/codeql/rust/generated/SynthConstructors.qll index e5a7b47c5765..ef7922f1af88 100644 --- a/rust/ql/lib/codeql/rust/generated/SynthConstructors.qll +++ b/rust/ql/lib/codeql/rust/generated/SynthConstructors.qll @@ -3,11 +3,11 @@ * This module exports all modules providing `Element` subclasses. */ +import codeql.rust.elements.AsmExprConstructor import codeql.rust.elements.AsyncBlockExprConstructor import codeql.rust.elements.AwaitExprConstructor import codeql.rust.elements.BecomeExprConstructor -import codeql.rust.elements.BinaryOpExprConstructor -import codeql.rust.elements.BindPatConstructor +import codeql.rust.elements.BinaryExprConstructor import codeql.rust.elements.BlockExprConstructor import codeql.rust.elements.BoxExprConstructor import codeql.rust.elements.BoxPatConstructor @@ -22,15 +22,16 @@ import codeql.rust.elements.ElementListExprConstructor import codeql.rust.elements.ExprStmtConstructor import codeql.rust.elements.FieldExprConstructor import codeql.rust.elements.FunctionConstructor +import codeql.rust.elements.GenericArgListConstructor +import codeql.rust.elements.IdentPatConstructor import codeql.rust.elements.IfExprConstructor import codeql.rust.elements.IndexExprConstructor -import codeql.rust.elements.InlineAsmExprConstructor import codeql.rust.elements.ItemStmtConstructor import codeql.rust.elements.LabelConstructor import codeql.rust.elements.LetExprConstructor import codeql.rust.elements.LetStmtConstructor -import codeql.rust.elements.LitPatConstructor import codeql.rust.elements.LiteralExprConstructor +import codeql.rust.elements.LiteralPatConstructor import codeql.rust.elements.LoopExprConstructor import codeql.rust.elements.MatchArmConstructor import codeql.rust.elements.MatchExprConstructor @@ -40,14 +41,16 @@ import codeql.rust.elements.MissingPatConstructor import codeql.rust.elements.ModuleConstructor import codeql.rust.elements.OffsetOfExprConstructor import codeql.rust.elements.OrPatConstructor +import codeql.rust.elements.PathConstructor import codeql.rust.elements.PathExprConstructor import codeql.rust.elements.PathPatConstructor +import codeql.rust.elements.PrefixExprConstructor import codeql.rust.elements.RangeExprConstructor import codeql.rust.elements.RangePatConstructor -import codeql.rust.elements.RecordFieldPatConstructor -import codeql.rust.elements.RecordLitExprConstructor -import codeql.rust.elements.RecordLitFieldConstructor +import codeql.rust.elements.RecordExprConstructor +import codeql.rust.elements.RecordExprFieldConstructor import codeql.rust.elements.RecordPatConstructor +import codeql.rust.elements.RecordPatFieldConstructor import codeql.rust.elements.RefExprConstructor import codeql.rust.elements.RefPatConstructor import codeql.rust.elements.RepeatExprConstructor @@ -57,10 +60,9 @@ import codeql.rust.elements.TupleExprConstructor import codeql.rust.elements.TuplePatConstructor import codeql.rust.elements.TupleStructPatConstructor import codeql.rust.elements.TypeRefConstructor -import codeql.rust.elements.UnaryOpExprConstructor import codeql.rust.elements.UnderscoreExprConstructor -import codeql.rust.elements.UnimplementedConstructor +import codeql.rust.elements.UnimplementedDeclarationConstructor import codeql.rust.elements.UnsafeBlockExprConstructor -import codeql.rust.elements.WildPatConstructor +import codeql.rust.elements.WildcardPatConstructor import codeql.rust.elements.YeetExprConstructor import codeql.rust.elements.YieldExprConstructor diff --git a/rust/ql/lib/codeql/rust/generated/TupleExpr.qll b/rust/ql/lib/codeql/rust/generated/TupleExpr.qll index 730550be4569..7bab8f23450d 100644 --- a/rust/ql/lib/codeql/rust/generated/TupleExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/TupleExpr.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A tuple expression. For example: + * ``` + * (1, "one"); + * (2, "two")[0] = 3; + * ``` * INTERNAL: Do not reference the `Generated::TupleExpr` class directly. * Use the subclass `TupleExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/TuplePat.qll b/rust/ql/lib/codeql/rust/generated/TuplePat.qll index 8ed7f0b15ecd..4a5b4499e666 100644 --- a/rust/ql/lib/codeql/rust/generated/TuplePat.qll +++ b/rust/ql/lib/codeql/rust/generated/TuplePat.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A tuple pattern. For example: + * ``` + * let (x, y) = (1, 2); + * let (a, b, .., z) = (1, 2, 3, 4, 5); + * ``` * INTERNAL: Do not reference the `Generated::TuplePat` class directly. * Use the subclass `TuplePat`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/TupleStructPat.qll b/rust/ql/lib/codeql/rust/generated/TupleStructPat.qll index 606ceb90375c..9b03c2584ad6 100644 --- a/rust/ql/lib/codeql/rust/generated/TupleStructPat.qll +++ b/rust/ql/lib/codeql/rust/generated/TupleStructPat.qll @@ -7,7 +7,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.Pat -import codeql.rust.elements.Unimplemented +import codeql.rust.elements.Path /** * INTERNAL: This module contains the fully generated definition of `TupleStructPat` and should not @@ -15,6 +15,14 @@ import codeql.rust.elements.Unimplemented */ module Generated { /** + * A tuple struct pattern. For example: + * ``` + * match x { + * Tuple("a", 1, 2, 3) => "great", + * Tuple(.., 3) => "fine", + * Tuple(..) => "fail", + * }; + * ``` * INTERNAL: Do not reference the `Generated::TupleStructPat` class directly. * Use the subclass `TupleStructPat`, where the following predicates are available. */ @@ -24,9 +32,9 @@ module Generated { /** * Gets the path of this tuple struct pat, if it exists. */ - Unimplemented getPath() { + Path getPath() { result = - Synth::convertUnimplementedFromRaw(Synth::convertTupleStructPatToRaw(this) + Synth::convertPathFromRaw(Synth::convertTupleStructPatToRaw(this) .(Raw::TupleStructPat) .getPath()) } diff --git a/rust/ql/lib/codeql/rust/generated/TypeRef.qll b/rust/ql/lib/codeql/rust/generated/TypeRef.qll index b75359dbbec7..f6c45fcbad5f 100644 --- a/rust/ql/lib/codeql/rust/generated/TypeRef.qll +++ b/rust/ql/lib/codeql/rust/generated/TypeRef.qll @@ -7,6 +7,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw import codeql.rust.elements.AstNode +import codeql.rust.elements.Unimplemented /** * INTERNAL: This module contains the fully generated definition of `TypeRef` and should not @@ -14,10 +15,16 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for type references. + * ``` + * let x: i32; + * let y: Vec; + * let z: Option; + * ``` * INTERNAL: Do not reference the `Generated::TypeRef` class directly. * Use the subclass `TypeRef`, where the following predicates are available. */ - class TypeRef extends Synth::TTypeRef, AstNode { + class TypeRef extends Synth::TTypeRef, AstNode, Unimplemented { override string getAPrimaryQlClass() { result = "TypeRef" } } } diff --git a/rust/ql/lib/codeql/rust/generated/UnaryOpExpr.qll b/rust/ql/lib/codeql/rust/generated/UnaryOpExpr.qll deleted file mode 100644 index 283b8f8eae1f..000000000000 --- a/rust/ql/lib/codeql/rust/generated/UnaryOpExpr.qll +++ /dev/null @@ -1,36 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `UnaryOpExpr`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Expr - -/** - * INTERNAL: This module contains the fully generated definition of `UnaryOpExpr` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::UnaryOpExpr` class directly. - * Use the subclass `UnaryOpExpr`, where the following predicates are available. - */ - class UnaryOpExpr extends Synth::TUnaryOpExpr, Expr { - override string getAPrimaryQlClass() { result = "UnaryOpExpr" } - - /** - * Gets the expression of this unary op expression. - */ - Expr getExpr() { - result = - Synth::convertExprFromRaw(Synth::convertUnaryOpExprToRaw(this).(Raw::UnaryOpExpr).getExpr()) - } - - /** - * Gets the op of this unary op expression. - */ - string getOp() { result = Synth::convertUnaryOpExprToRaw(this).(Raw::UnaryOpExpr).getOp() } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/UnderscoreExpr.qll b/rust/ql/lib/codeql/rust/generated/UnderscoreExpr.qll index 5ba5bd771557..d4f352318025 100644 --- a/rust/ql/lib/codeql/rust/generated/UnderscoreExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/UnderscoreExpr.qll @@ -14,6 +14,10 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An underscore expression. For example: + * ``` + * _ = 42; + * ``` * INTERNAL: Do not reference the `Generated::UnderscoreExpr` class directly. * Use the subclass `UnderscoreExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Unimplemented.qll b/rust/ql/lib/codeql/rust/generated/Unimplemented.qll index 749c88b8acae..03c367cbcd5b 100644 --- a/rust/ql/lib/codeql/rust/generated/Unimplemented.qll +++ b/rust/ql/lib/codeql/rust/generated/Unimplemented.qll @@ -6,7 +6,7 @@ private import codeql.rust.generated.Synth private import codeql.rust.generated.Raw -import codeql.rust.elements.AstNode +import codeql.rust.elements.Element /** * INTERNAL: This module contains the fully generated definition of `Unimplemented` and should not @@ -14,10 +14,9 @@ import codeql.rust.elements.AstNode */ module Generated { /** + * The base class for unimplemented nodes. This is used to mark nodes that are not yet extracted. * INTERNAL: Do not reference the `Generated::Unimplemented` class directly. * Use the subclass `Unimplemented`, where the following predicates are available. */ - class Unimplemented extends Synth::TUnimplemented, AstNode { - override string getAPrimaryQlClass() { result = "Unimplemented" } - } + class Unimplemented extends Synth::TUnimplemented, Element { } } diff --git a/rust/ql/lib/codeql/rust/generated/UnimplementedDeclaration.qll b/rust/ql/lib/codeql/rust/generated/UnimplementedDeclaration.qll new file mode 100644 index 000000000000..31b2301830d7 --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/UnimplementedDeclaration.qll @@ -0,0 +1,27 @@ +// generated by codegen +/** + * This module provides the generated definition of `UnimplementedDeclaration`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Declaration +import codeql.rust.elements.Unimplemented + +/** + * INTERNAL: This module contains the fully generated definition of `UnimplementedDeclaration` and should not + * be referenced directly. + */ +module Generated { + /** + * A declaration that is not yet extracted. + * INTERNAL: Do not reference the `Generated::UnimplementedDeclaration` class directly. + * Use the subclass `UnimplementedDeclaration`, where the following predicates are available. + */ + class UnimplementedDeclaration extends Synth::TUnimplementedDeclaration, Declaration, + Unimplemented + { + override string getAPrimaryQlClass() { result = "UnimplementedDeclaration" } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/UnsafeBlockExpr.qll b/rust/ql/lib/codeql/rust/generated/UnsafeBlockExpr.qll index e53ce046fa66..0cdfee165cad 100644 --- a/rust/ql/lib/codeql/rust/generated/UnsafeBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/UnsafeBlockExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.BlockExprBase */ module Generated { /** + * An unsafe block expression. For example: + * ``` + * let layout = unsafe { + * let x = 42; + * Layout::from_size_align_unchecked(size, align) + * }; + * ``` * INTERNAL: Do not reference the `Generated::UnsafeBlockExpr` class directly. * Use the subclass `UnsafeBlockExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/WildPat.qll b/rust/ql/lib/codeql/rust/generated/WildPat.qll deleted file mode 100644 index 05db09c16e0c..000000000000 --- a/rust/ql/lib/codeql/rust/generated/WildPat.qll +++ /dev/null @@ -1,23 +0,0 @@ -// generated by codegen -/** - * This module provides the generated definition of `WildPat`. - * INTERNAL: Do not import directly. - */ - -private import codeql.rust.generated.Synth -private import codeql.rust.generated.Raw -import codeql.rust.elements.Pat - -/** - * INTERNAL: This module contains the fully generated definition of `WildPat` and should not - * be referenced directly. - */ -module Generated { - /** - * INTERNAL: Do not reference the `Generated::WildPat` class directly. - * Use the subclass `WildPat`, where the following predicates are available. - */ - class WildPat extends Synth::TWildPat, Pat { - override string getAPrimaryQlClass() { result = "WildPat" } - } -} diff --git a/rust/ql/lib/codeql/rust/generated/WildcardPat.qll b/rust/ql/lib/codeql/rust/generated/WildcardPat.qll new file mode 100644 index 000000000000..50bca3150bac --- /dev/null +++ b/rust/ql/lib/codeql/rust/generated/WildcardPat.qll @@ -0,0 +1,27 @@ +// generated by codegen +/** + * This module provides the generated definition of `WildcardPat`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.generated.Synth +private import codeql.rust.generated.Raw +import codeql.rust.elements.Pat + +/** + * INTERNAL: This module contains the fully generated definition of `WildcardPat` and should not + * be referenced directly. + */ +module Generated { + /** + * A wildcard pattern. For example: + * ``` + * let _ = 42; + * ``` + * INTERNAL: Do not reference the `Generated::WildcardPat` class directly. + * Use the subclass `WildcardPat`, where the following predicates are available. + */ + class WildcardPat extends Synth::TWildcardPat, Pat { + override string getAPrimaryQlClass() { result = "WildcardPat" } + } +} diff --git a/rust/ql/lib/codeql/rust/generated/YeetExpr.qll b/rust/ql/lib/codeql/rust/generated/YeetExpr.qll index 3599779650d2..483af5adcb3b 100644 --- a/rust/ql/lib/codeql/rust/generated/YeetExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/YeetExpr.qll @@ -14,6 +14,12 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A `yeet` expression. For example: + * ``` + * if x < size { + * do yeet "index out of bounds"; + * } + * ``` * INTERNAL: Do not reference the `Generated::YeetExpr` class directly. * Use the subclass `YeetExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/YieldExpr.qll b/rust/ql/lib/codeql/rust/generated/YieldExpr.qll index 6abe7de7fba6..9e5023bc55fd 100644 --- a/rust/ql/lib/codeql/rust/generated/YieldExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/YieldExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A `yield` expression. For example: + * ``` + * let one = #[coroutine] + * || { + * yield 1; + * }; + * ``` * INTERNAL: Do not reference the `Generated::YieldExpr` class directly. * Use the subclass `YieldExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 2aaadbba9909..10a0c4c37922 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -121,35 +121,46 @@ locatable_locations( @element = @locatable +| @unimplemented ; @locatable = @ast_node ; +@unimplemented = + @generic_arg_list +| @path +| @type_ref +| @unimplemented_declaration +; + @ast_node = @declaration | @expr +| @generic_arg_list | @label | @match_arm | @pat -| @record_field_pat -| @record_lit_field +| @path +| @record_expr_field +| @record_pat_field | @stmt | @type_ref -| @unimplemented ; @declaration = @function | @module +| @unimplemented_declaration ; @expr = @array_expr +| @asm_expr | @await_expr | @become_expr -| @binary_op_expr +| @binary_expr | @block_expr_base | @box_expr | @break_expr @@ -161,7 +172,6 @@ locatable_locations( | @field_expr | @if_expr | @index_expr -| @inline_asm_expr | @let_expr | @literal_expr | @loop_expr @@ -170,17 +180,21 @@ locatable_locations( | @missing_expr | @offset_of_expr | @path_expr +| @prefix_expr | @range_expr -| @record_lit_expr +| @record_expr | @ref_expr | @return_expr | @tuple_expr -| @unary_op_expr | @underscore_expr | @yeet_expr | @yield_expr ; +generic_arg_lists( + unique int id: @generic_arg_list +); + labels( unique int id: @label, string name: string ref @@ -199,10 +213,10 @@ match_arm_guards( ); @pat = - @bind_pat -| @box_pat + @box_pat | @const_block_pat -| @lit_pat +| @ident_pat +| @literal_pat | @missing_pat | @or_pat | @path_pat @@ -212,21 +226,25 @@ match_arm_guards( | @slice_pat | @tuple_pat | @tuple_struct_pat -| @wild_pat +| @wildcard_pat ; -record_field_pats( - unique int id: @record_field_pat, - string name: string ref, - int pat: @pat ref +paths( + unique int id: @path ); -record_lit_fields( - unique int id: @record_lit_field, +record_expr_fields( + unique int id: @record_expr_field, string name: string ref, int expr: @expr ref ); +record_pat_fields( + unique int id: @record_pat_field, + string name: string ref, + int pat: @pat ref +); + @stmt = @expr_stmt | @item_stmt @@ -237,15 +255,16 @@ type_refs( unique int id: @type_ref ); -unimplementeds( - unique int id: @unimplemented -); - @array_expr = @element_list_expr | @repeat_expr ; +asm_exprs( + unique int id: @asm_expr, + int expr: @expr ref +); + await_exprs( unique int id: @await_expr, int expr: @expr ref @@ -256,29 +275,18 @@ become_exprs( int expr: @expr ref ); -binary_op_exprs( - unique int id: @binary_op_expr, +binary_exprs( + unique int id: @binary_expr, int lhs: @expr ref, int rhs: @expr ref ); #keyset[id] -binary_op_expr_ops( - int id: @binary_op_expr ref, +binary_expr_ops( + int id: @binary_expr ref, string op: string ref ); -bind_pats( - unique int id: @bind_pat, - string binding_id: string ref -); - -#keyset[id] -bind_pat_subpats( - int id: @bind_pat ref, - int subpat: @pat ref -); - @block_expr_base = @async_block_expr | @block_expr @@ -344,7 +352,7 @@ call_expr_is_assignee_expr( cast_exprs( unique int id: @cast_expr, int expr: @expr ref, - int type_ref: @type_ref ref + int type_: @type_ref ref ); closure_exprs( @@ -420,6 +428,17 @@ functions( int body: @expr ref ); +ident_pats( + unique int id: @ident_pat, + string binding_id: string ref +); + +#keyset[id] +ident_pat_subpats( + int id: @ident_pat ref, + int subpat: @pat ref +); + if_exprs( unique int id: @if_expr, int condition: @expr ref, @@ -443,11 +462,6 @@ index_expr_is_assignee_expr( int id: @index_expr ref ); -inline_asm_exprs( - unique int id: @inline_asm_expr, - int expr: @expr ref -); - item_stmts( unique int id: @item_stmt ); @@ -464,9 +478,9 @@ let_stmts( ); #keyset[id] -let_stmt_type_refs( +let_stmt_types( int id: @let_stmt ref, - int type_ref: @type_ref ref + int type_: @type_ref ref ); #keyset[id] @@ -481,15 +495,15 @@ let_stmt_elses( int else: @expr ref ); -lit_pats( - unique int id: @lit_pat, - int expr: @expr ref -); - literal_exprs( unique int id: @literal_expr ); +literal_pats( + unique int id: @literal_pat, + int expr: @expr ref +); + loop_exprs( unique int id: @loop_expr, int body: @expr ref @@ -529,7 +543,7 @@ method_call_expr_args( #keyset[id] method_call_expr_generic_args( int id: @method_call_expr ref, - int generic_args: @unimplemented ref + int generic_args: @generic_arg_list ref ); missing_exprs( @@ -576,12 +590,18 @@ or_pat_args( path_exprs( unique int id: @path_expr, - int path: @unimplemented ref + int path: @path ref ); path_pats( unique int id: @path_pat, - int path: @unimplemented ref + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr, + int expr: @expr ref, + string op: string ref ); range_exprs( @@ -621,37 +641,37 @@ range_pat_ends( int end: @pat ref ); -record_lit_exprs( - unique int id: @record_lit_expr +record_exprs( + unique int id: @record_expr ); #keyset[id] -record_lit_expr_paths( - int id: @record_lit_expr ref, - int path: @unimplemented ref +record_expr_paths( + int id: @record_expr ref, + int path: @path ref ); #keyset[id, index] -record_lit_expr_fields( - int id: @record_lit_expr ref, +record_expr_flds( + int id: @record_expr ref, int index: int ref, - int field: @record_lit_field ref + int fld: @record_expr_field ref ); #keyset[id] -record_lit_expr_spreads( - int id: @record_lit_expr ref, +record_expr_spreads( + int id: @record_expr ref, int spread: @expr ref ); #keyset[id] -record_lit_expr_has_ellipsis( - int id: @record_lit_expr ref +record_expr_has_ellipsis( + int id: @record_expr ref ); #keyset[id] -record_lit_expr_is_assignee_expr( - int id: @record_lit_expr ref +record_expr_is_assignee_expr( + int id: @record_expr ref ); record_pats( @@ -661,14 +681,14 @@ record_pats( #keyset[id] record_pat_paths( int id: @record_pat ref, - int path: @unimplemented ref + int path: @path ref ); #keyset[id, index] -record_pat_args( +record_pat_flds( int id: @record_pat ref, int index: int ref, - int arg: @record_field_pat ref + int fld: @record_pat_field ref ); #keyset[id] @@ -775,7 +795,7 @@ tuple_struct_pats( #keyset[id] tuple_struct_pat_paths( int id: @tuple_struct_pat ref, - int path: @unimplemented ref + int path: @path ref ); #keyset[id, index] @@ -791,18 +811,16 @@ tuple_struct_pat_ellipsis_indices( int ellipsis_index: int ref ); -unary_op_exprs( - unique int id: @unary_op_expr, - int expr: @expr ref, - string op: string ref -); - underscore_exprs( unique int id: @underscore_expr ); -wild_pats( - unique int id: @wild_pat +unimplemented_declarations( + unique int id: @unimplemented_declaration +); + +wildcard_pats( + unique int id: @wildcard_pat ); yeet_exprs( diff --git a/rust/ql/test/TestUtils.qll b/rust/ql/test/TestUtils.qll index 8cee9fa6a53e..214928691c05 100644 --- a/rust/ql/test/TestUtils.qll +++ b/rust/ql/test/TestUtils.qll @@ -1,10 +1,3 @@ private import rust -cached -predicate toBeTested(Element e) { - not e instanceof Locatable or - fileIsInTest(e.(Locatable).getFile()) -} - -cached -predicate fileIsInTest(File f) { f.getAbsolutePath().matches("%rust/ql/test%") } +predicate toBeTested(Element e) { any() } diff --git a/rust/ql/test/extractor-tests/File/File.ql b/rust/ql/test/extractor-tests/File/File.ql index c562e2587fe6..fcb2b274e781 100644 --- a/rust/ql/test/extractor-tests/File/File.ql +++ b/rust/ql/test/extractor-tests/File/File.ql @@ -1,6 +1,5 @@ import rust -import TestUtils from File f -where fileIsInTest(f) +where exists(f.getRelativePath()) select f diff --git a/rust/ql/test/extractor-tests/generated/.generated_tests.list b/rust/ql/test/extractor-tests/generated/.generated_tests.list index aca5873c8207..4bc99d18d264 100644 --- a/rust/ql/test/extractor-tests/generated/.generated_tests.list +++ b/rust/ql/test/extractor-tests/generated/.generated_tests.list @@ -1 +1,61 @@ -Function/gen_function.rs 4be46d4798cd32b51e449d1b6c4bc7461216a8a0e765b61abac21354401a7776 4be46d4798cd32b51e449d1b6c4bc7461216a8a0e765b61abac21354401a7776 +AsmExpr/gen_asm_expr.rs 98d1a2525501416434a087b3791268691e5420f122f6e4d6d868a4273ce89ca5 98d1a2525501416434a087b3791268691e5420f122f6e4d6d868a4273ce89ca5 +AsyncBlockExpr/gen_async_block_expr.rs 63b31fbeeead710902aa31184c06e88e604a1b7ff3308aba52b5d6a965870ff6 63b31fbeeead710902aa31184c06e88e604a1b7ff3308aba52b5d6a965870ff6 +AwaitExpr/gen_await_expr.rs 09632657a74dda663c217b0e16d7f1b33f7f49efb2ef480c0d2cc9c66b65202b 09632657a74dda663c217b0e16d7f1b33f7f49efb2ef480c0d2cc9c66b65202b +BecomeExpr/gen_become_expr.rs 15f42386c7362b50d8bcefda432167104e537fa63f038c1ab016f75a171f728c 15f42386c7362b50d8bcefda432167104e537fa63f038c1ab016f75a171f728c +BinaryExpr/gen_binary_expr.rs f763732714ef056e9d8aaaab69398c37dffdcf96eaf63e9f35d27e7868d78863 f763732714ef056e9d8aaaab69398c37dffdcf96eaf63e9f35d27e7868d78863 +BlockExpr/gen_block_expr.rs b09aa0406d2e772bc14bb1be4959ac21ebaf75c65a1d9f92bb3d8be5fd571023 b09aa0406d2e772bc14bb1be4959ac21ebaf75c65a1d9f92bb3d8be5fd571023 +BoxExpr/gen_box_expr.rs f4392a8e9daae2492c087fc8f7323f45ffbdb43a4ae5035be61e6edeaf427f23 f4392a8e9daae2492c087fc8f7323f45ffbdb43a4ae5035be61e6edeaf427f23 +BoxPat/gen_box_pat.rs 4f6c7ea95d49a350bcfe8bc381229b89c08eb44580d98c853cf6b2ab6649b3a6 4f6c7ea95d49a350bcfe8bc381229b89c08eb44580d98c853cf6b2ab6649b3a6 +BreakExpr/gen_break_expr.rs 4938cdab0fdb9b7bafa021912d59595a190fffbabfb3889ea7ee0917150b0a55 4938cdab0fdb9b7bafa021912d59595a190fffbabfb3889ea7ee0917150b0a55 +CallExpr/gen_call_expr.rs 8a3b00e4af996dcfd4593783316b2d793e8b90b24b4bb78acccca6f974cf9c36 8a3b00e4af996dcfd4593783316b2d793e8b90b24b4bb78acccca6f974cf9c36 +CastExpr/gen_cast_expr.rs 35ba1e109899f5b6297cb0db6d6a48270e031c91b27fab212b07a9f93948f816 35ba1e109899f5b6297cb0db6d6a48270e031c91b27fab212b07a9f93948f816 +ClosureExpr/gen_closure_expr.rs de77bc1d891b4e0f5a4d8a55a8a097990867f93a015c13d72fb10e767aa14ba4 de77bc1d891b4e0f5a4d8a55a8a097990867f93a015c13d72fb10e767aa14ba4 +ConstBlockPat/gen_const_block_pat.rs 6117cee861ea278aa0fb10fe141902a3bb91e6750565e52e5d3e7f0ad03b9203 6117cee861ea278aa0fb10fe141902a3bb91e6750565e52e5d3e7f0ad03b9203 +ConstExpr/gen_const_expr.rs 04a1e4620c843101bfccd38027af68390817dbb750c203250f4fcc208af0d26b 04a1e4620c843101bfccd38027af68390817dbb750c203250f4fcc208af0d26b +ContinueExpr/gen_continue_expr.rs cbbed5b8dd235c4702281c9772094799012d785cc0c39a25b9f21cd659bc98d2 cbbed5b8dd235c4702281c9772094799012d785cc0c39a25b9f21cd659bc98d2 +ElementListExpr/gen_element_list_expr.rs 66f8a3c4e02767e96692c44ada6fe7ed2b07b1aaefdad13e35ae41e081374f81 66f8a3c4e02767e96692c44ada6fe7ed2b07b1aaefdad13e35ae41e081374f81 +ExprStmt/gen_expr_stmt.rs eedad804b2fbd49385c284ece44ecddf18eb56b61ff54607dfdd6521e2481c93 eedad804b2fbd49385c284ece44ecddf18eb56b61ff54607dfdd6521e2481c93 +FieldExpr/gen_field_expr.rs 7ab04efc8b45892d3214eccaeac0b1659213623ae95acb463c531b865988f148 7ab04efc8b45892d3214eccaeac0b1659213623ae95acb463c531b865988f148 +Function/gen_function.rs 1048512614569eaf818e16a30df256556e25f3b7fb97eee2a8df4b0036b10e99 1048512614569eaf818e16a30df256556e25f3b7fb97eee2a8df4b0036b10e99 +GenericArgList/gen_generic_arg_list.rs 428b05b7dd2c2060ac752f4d98a4d3daf44eb9f0a7cfb05bccbe284a91f4be27 428b05b7dd2c2060ac752f4d98a4d3daf44eb9f0a7cfb05bccbe284a91f4be27 +IdentPat/gen_ident_pat.rs 719807aae94b372b489cac7e9ae00d91c2df6e2de7bae9b24e5f6f9aaf8f1b64 719807aae94b372b489cac7e9ae00d91c2df6e2de7bae9b24e5f6f9aaf8f1b64 +IfExpr/gen_if_expr.rs 073ba575b54a553945d3131d7e92cdb1520c24f380361723a1b9d848b6296d7b 073ba575b54a553945d3131d7e92cdb1520c24f380361723a1b9d848b6296d7b +IndexExpr/gen_index_expr.rs b1a1b9eadd40ac1652d944dc925337435ef5782bf485a0f0360c971f4938cdd8 b1a1b9eadd40ac1652d944dc925337435ef5782bf485a0f0360c971f4938cdd8 +Label/gen_label.rs 463ae5ff89ef1222896d7c2009fb8ae7f437c51bc767415e37f6a50b76b9edbd 463ae5ff89ef1222896d7c2009fb8ae7f437c51bc767415e37f6a50b76b9edbd +LetExpr/gen_let_expr.rs 83e9726f3f14fb9d3d332462230fc939f0214216997f5ca84f58518ffd65653d 83e9726f3f14fb9d3d332462230fc939f0214216997f5ca84f58518ffd65653d +LetStmt/gen_let_stmt.rs d22098db07cbdd4e4616c24bc9738f989e553336c7ce1a5391e1b403adb10dbb d22098db07cbdd4e4616c24bc9738f989e553336c7ce1a5391e1b403adb10dbb +LiteralExpr/gen_literal_expr.rs 302ebc81012fd46ccf8d960fe6ae691747bdec1c7cd52b0d47ed1273b4d8dc3a 302ebc81012fd46ccf8d960fe6ae691747bdec1c7cd52b0d47ed1273b4d8dc3a +LiteralPat/gen_literal_pat.rs b97dfb678d9e78d8b1673862e6d88593cfccb648fd5915a5849eb20fdc5d2165 b97dfb678d9e78d8b1673862e6d88593cfccb648fd5915a5849eb20fdc5d2165 +LoopExpr/gen_loop_expr.rs 0a7e6dd7690fae82495c466f8a175b3a4097478041ec0e0bc0b7db97d2e50e66 0a7e6dd7690fae82495c466f8a175b3a4097478041ec0e0bc0b7db97d2e50e66 +MatchArm/gen_match_arm.rs cad136c0d9ffd9fb4250e1e26ccaa7a2920b614d004c25296b819b8d33e87cf9 cad136c0d9ffd9fb4250e1e26ccaa7a2920b614d004c25296b819b8d33e87cf9 +MatchExpr/gen_match_expr.rs 5c444ccc272acd26aabed0462d0527096dbb52a783f8353e6385335314f1035f 5c444ccc272acd26aabed0462d0527096dbb52a783f8353e6385335314f1035f +MethodCallExpr/gen_method_call_expr.rs 2e303e2677134db6d1e757f093f78bbd0db08f067c86d6d9b141b7115f352fd7 2e303e2677134db6d1e757f093f78bbd0db08f067c86d6d9b141b7115f352fd7 +MissingExpr/gen_missing_expr.rs 24bed82f1e2a4bc18c00d59bc06ad0aa59371d5fab71e67a8b4eb1a5f59c61cb 24bed82f1e2a4bc18c00d59bc06ad0aa59371d5fab71e67a8b4eb1a5f59c61cb +MissingPat/gen_missing_pat.rs a4e05c03a08074e332ae5bf18edabb87950119ff938d825efa18e4362ccd4c12 a4e05c03a08074e332ae5bf18edabb87950119ff938d825efa18e4362ccd4c12 +Module/gen_module.rs 6ef553f0782cacf198efe10885a7784e208bbe8da27a65f7f004b49581a75120 6ef553f0782cacf198efe10885a7784e208bbe8da27a65f7f004b49581a75120 +OffsetOfExpr/gen_offset_of_expr.rs 3744346b0e37fd18193f41e45b74ba9a5dca8ae3dc6a30381272358e6ec8e495 3744346b0e37fd18193f41e45b74ba9a5dca8ae3dc6a30381272358e6ec8e495 +OrPat/gen_or_pat.rs 5b27d1397060dab0aba02ce35b7d182394d8b0a84a42984d2508868673d36b2c 5b27d1397060dab0aba02ce35b7d182394d8b0a84a42984d2508868673d36b2c +Path/gen_path.rs 9c70415477de7f794bc1b43eb5cc62a9d8280e312c0aa2039c7bf1f8d6760fb2 9c70415477de7f794bc1b43eb5cc62a9d8280e312c0aa2039c7bf1f8d6760fb2 +PathExpr/gen_path_expr.rs 5df9c18f835d840d95a9cf1d6dfd2870dd97947d7df5ba01d987e66ed9afbb38 5df9c18f835d840d95a9cf1d6dfd2870dd97947d7df5ba01d987e66ed9afbb38 +PathPat/gen_path_pat.rs a858875ccc5baffb04c46127e1f4cd41e5fcc7843eebbdf791c20ba2efe78e5a a858875ccc5baffb04c46127e1f4cd41e5fcc7843eebbdf791c20ba2efe78e5a +PrefixExpr/gen_prefix_expr.rs 0fe7608d3c57813db30f36fde77a55d804e009f00d62e232fd050d5cfc5b1eaf 0fe7608d3c57813db30f36fde77a55d804e009f00d62e232fd050d5cfc5b1eaf +RangeExpr/gen_range_expr.rs 3d77ccdc55a774c41b7d34773e5c65e4fdad6ef76aadd4d24c2694b324e9c006 3d77ccdc55a774c41b7d34773e5c65e4fdad6ef76aadd4d24c2694b324e9c006 +RangePat/gen_range_pat.rs f6661dd17ad104a8e80247e3c212517c6c888895edd86ac75f15ce0270eac0ce f6661dd17ad104a8e80247e3c212517c6c888895edd86ac75f15ce0270eac0ce +RecordExpr/gen_record_expr.rs e0b332e4d8ce9b6830f8f29a14e422a8d4b1df18490d3082f2d98105bcf09748 e0b332e4d8ce9b6830f8f29a14e422a8d4b1df18490d3082f2d98105bcf09748 +RecordExprField/gen_record_expr_field.rs ca3335ee9a4e091f2a4ebc183bd6f8ff9cd8f37c22e3cab16d936aa4751e6608 ca3335ee9a4e091f2a4ebc183bd6f8ff9cd8f37c22e3cab16d936aa4751e6608 +RecordPat/gen_record_pat.rs 4df648cfb7babf7f3b610499f279681b20840b63eb6ebbdda996298d8ff28aed 4df648cfb7babf7f3b610499f279681b20840b63eb6ebbdda996298d8ff28aed +RecordPatField/gen_record_pat_field.rs 83f05d7acccbf792f952272bf049253100d7590ce25c3665d7bb284f88cd62d5 83f05d7acccbf792f952272bf049253100d7590ce25c3665d7bb284f88cd62d5 +RefExpr/gen_ref_expr.rs b79b89935a758c51488ffe654c662bb51af867abd140825859db97197dc7af29 b79b89935a758c51488ffe654c662bb51af867abd140825859db97197dc7af29 +RefPat/gen_ref_pat.rs e12a9380919d62f8910efd09ce6883b7bb53257879eef0aaeaa9f1870af29ad5 e12a9380919d62f8910efd09ce6883b7bb53257879eef0aaeaa9f1870af29ad5 +RepeatExpr/gen_repeat_expr.rs 98e06e5b9d1750a6ec64513d451b7a46eb215e2f2a6d482eaeeb07dec6dc8564 98e06e5b9d1750a6ec64513d451b7a46eb215e2f2a6d482eaeeb07dec6dc8564 +ReturnExpr/gen_return_expr.rs ab3d5f8f19c8b2ad1410c9855b7f437b96dc9d50d67e99047678b515e58e5425 ab3d5f8f19c8b2ad1410c9855b7f437b96dc9d50d67e99047678b515e58e5425 +SlicePat/gen_slice_pat.rs fbbd5568cbadef51a7970fdbb8d99bf591e29d06987fe3c53b7c19f437431568 fbbd5568cbadef51a7970fdbb8d99bf591e29d06987fe3c53b7c19f437431568 +TupleExpr/gen_tuple_expr.rs 3c51f3f94092fb1992e09a096f66304cdc6dbd34b205aa5a4a47216484f3c3e8 3c51f3f94092fb1992e09a096f66304cdc6dbd34b205aa5a4a47216484f3c3e8 +TuplePat/gen_tuple_pat.rs 344d309368c28aba203483f96a8f5456e76a92d35df672313ec88262e036d4cf 344d309368c28aba203483f96a8f5456e76a92d35df672313ec88262e036d4cf +TupleStructPat/gen_tuple_struct_pat.rs 0d3f1ec362bd31cb690b4894a0d6fd695c0b1d80a931b609ad876590c0159f83 0d3f1ec362bd31cb690b4894a0d6fd695c0b1d80a931b609ad876590c0159f83 +TypeRef/gen_type_ref.rs 86362efc37ef9d8383854ac831ba576982e6676d037a85b45a5f7f4a3e8ff1e3 86362efc37ef9d8383854ac831ba576982e6676d037a85b45a5f7f4a3e8ff1e3 +UnderscoreExpr/gen_underscore_expr.rs 34bfcf5e4a865e882aa40fdfdb93237a4ccfb0c1fb053ae184a38719b3727b7a 34bfcf5e4a865e882aa40fdfdb93237a4ccfb0c1fb053ae184a38719b3727b7a +UnsafeBlockExpr/gen_unsafe_block_expr.rs 250656a4c0333c1260617117ae7ca96fc265d5109f948b90dce071867d020486 250656a4c0333c1260617117ae7ca96fc265d5109f948b90dce071867d020486 +WildcardPat/gen_wildcard_pat.rs aa5a5bc28a5fabe45f3d522e1b59bdf2fa5bd2848ec1f32263ef1f39a6b0290a aa5a5bc28a5fabe45f3d522e1b59bdf2fa5bd2848ec1f32263ef1f39a6b0290a +YeetExpr/gen_yeet_expr.rs 060b64c82db9015a28f375c05b98e932a78c3b1e11dc171d0c4844c988c6d8d9 060b64c82db9015a28f375c05b98e932a78c3b1e11dc171d0c4844c988c6d8d9 +YieldExpr/gen_yield_expr.rs 4742abc490211a92cd2aa7ebf7f2749aff5227db64fb1b7b5ede20727140c445 4742abc490211a92cd2aa7ebf7f2749aff5227db64fb1b7b5ede20727140c445 diff --git a/rust/ql/test/extractor-tests/generated/.gitattributes b/rust/ql/test/extractor-tests/generated/.gitattributes index 2ca6c1370538..1c0da518b29e 100644 --- a/rust/ql/test/extractor-tests/generated/.gitattributes +++ b/rust/ql/test/extractor-tests/generated/.gitattributes @@ -1,3 +1,63 @@ /.generated_tests.list linguist-generated /.gitattributes linguist-generated +/AsmExpr/gen_asm_expr.rs linguist-generated +/AsyncBlockExpr/gen_async_block_expr.rs linguist-generated +/AwaitExpr/gen_await_expr.rs linguist-generated +/BecomeExpr/gen_become_expr.rs linguist-generated +/BinaryExpr/gen_binary_expr.rs linguist-generated +/BlockExpr/gen_block_expr.rs linguist-generated +/BoxExpr/gen_box_expr.rs linguist-generated +/BoxPat/gen_box_pat.rs linguist-generated +/BreakExpr/gen_break_expr.rs linguist-generated +/CallExpr/gen_call_expr.rs linguist-generated +/CastExpr/gen_cast_expr.rs linguist-generated +/ClosureExpr/gen_closure_expr.rs linguist-generated +/ConstBlockPat/gen_const_block_pat.rs linguist-generated +/ConstExpr/gen_const_expr.rs linguist-generated +/ContinueExpr/gen_continue_expr.rs linguist-generated +/ElementListExpr/gen_element_list_expr.rs linguist-generated +/ExprStmt/gen_expr_stmt.rs linguist-generated +/FieldExpr/gen_field_expr.rs linguist-generated /Function/gen_function.rs linguist-generated +/GenericArgList/gen_generic_arg_list.rs linguist-generated +/IdentPat/gen_ident_pat.rs linguist-generated +/IfExpr/gen_if_expr.rs linguist-generated +/IndexExpr/gen_index_expr.rs linguist-generated +/Label/gen_label.rs linguist-generated +/LetExpr/gen_let_expr.rs linguist-generated +/LetStmt/gen_let_stmt.rs linguist-generated +/LiteralExpr/gen_literal_expr.rs linguist-generated +/LiteralPat/gen_literal_pat.rs linguist-generated +/LoopExpr/gen_loop_expr.rs linguist-generated +/MatchArm/gen_match_arm.rs linguist-generated +/MatchExpr/gen_match_expr.rs linguist-generated +/MethodCallExpr/gen_method_call_expr.rs linguist-generated +/MissingExpr/gen_missing_expr.rs linguist-generated +/MissingPat/gen_missing_pat.rs linguist-generated +/Module/gen_module.rs linguist-generated +/OffsetOfExpr/gen_offset_of_expr.rs linguist-generated +/OrPat/gen_or_pat.rs linguist-generated +/Path/gen_path.rs linguist-generated +/PathExpr/gen_path_expr.rs linguist-generated +/PathPat/gen_path_pat.rs linguist-generated +/PrefixExpr/gen_prefix_expr.rs linguist-generated +/RangeExpr/gen_range_expr.rs linguist-generated +/RangePat/gen_range_pat.rs linguist-generated +/RecordExpr/gen_record_expr.rs linguist-generated +/RecordExprField/gen_record_expr_field.rs linguist-generated +/RecordPat/gen_record_pat.rs linguist-generated +/RecordPatField/gen_record_pat_field.rs linguist-generated +/RefExpr/gen_ref_expr.rs linguist-generated +/RefPat/gen_ref_pat.rs linguist-generated +/RepeatExpr/gen_repeat_expr.rs linguist-generated +/ReturnExpr/gen_return_expr.rs linguist-generated +/SlicePat/gen_slice_pat.rs linguist-generated +/TupleExpr/gen_tuple_expr.rs linguist-generated +/TuplePat/gen_tuple_pat.rs linguist-generated +/TupleStructPat/gen_tuple_struct_pat.rs linguist-generated +/TypeRef/gen_type_ref.rs linguist-generated +/UnderscoreExpr/gen_underscore_expr.rs linguist-generated +/UnsafeBlockExpr/gen_unsafe_block_expr.rs linguist-generated +/WildcardPat/gen_wildcard_pat.rs linguist-generated +/YeetExpr/gen_yeet_expr.rs linguist-generated +/YieldExpr/gen_yield_expr.rs linguist-generated diff --git a/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.expected b/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.expected new file mode 100644 index 000000000000..44831a8693d1 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.expected @@ -0,0 +1 @@ +| gen_asm_expr.rs:6:9:6:24 | AsmExpr | getExpr: | gen_asm_expr.rs:6:23:6:23 | UnderscoreExpr | diff --git a/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.ql b/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.ql new file mode 100644 index 000000000000..d53de6289ddc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsmExpr/AsmExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsmExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/AsmExpr/gen_asm_expr.rs b/rust/ql/test/extractor-tests/generated/AsmExpr/gen_asm_expr.rs new file mode 100644 index 000000000000..101d003c811a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsmExpr/gen_asm_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_asm_expr() -> () { + // An inline assembly expression. For example: + unsafe { + builtin # asm(_); + } +} diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected new file mode 100644 index 000000000000..1cd82381fb4f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql new file mode 100644 index 000000000000..132be12a64f4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x, int getNumberOfStatements, string hasTail +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfStatements = x.getNumberOfStatements() and + if x.hasTail() then hasTail = "yes" else hasTail = "no" +select x, "getNumberOfStatements:", getNumberOfStatements, "hasTail:", hasTail diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected new file mode 100644 index 000000000000..d9c3f9a68979 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | 0 | gen_async_block_expr.rs:6:12:6:12 | LetStmt | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql new file mode 100644 index 000000000000..84e5c344a6f4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getStatement(index) diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected new file mode 100644 index 000000000000..66ead87e3122 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | gen_async_block_expr.rs:7:8:7:8 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql new file mode 100644 index 000000000000..574c7fa72034 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getTail() diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs new file mode 100644 index 000000000000..fec15de4176e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_async_block_expr() -> i32 { + // An async block expression. For example: + async { + let x = 42; + x + }.await +} diff --git a/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.expected b/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.expected new file mode 100644 index 000000000000..df585132030c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.expected @@ -0,0 +1 @@ +| gen_await_expr.rs:6:17:6:27 | AwaitExpr | getExpr: | gen_await_expr.rs:6:17:6:21 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.ql b/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.ql new file mode 100644 index 000000000000..30400ffc9bc0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AwaitExpr/AwaitExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AwaitExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/AwaitExpr/gen_await_expr.rs b/rust/ql/test/extractor-tests/generated/AwaitExpr/gen_await_expr.rs new file mode 100644 index 000000000000..7534fbc19a5d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AwaitExpr/gen_await_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_await_expr() -> () { + // An `await` expression. For example: + async { + let x = foo().await; + x + } +} diff --git a/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.expected b/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.expected new file mode 100644 index 000000000000..f067a46ca8d7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.expected @@ -0,0 +1 @@ +| gen_become_expr.rs:8:10:8:36 | BecomeExpr | getExpr: | gen_become_expr.rs:8:17:8:36 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.ql b/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.ql new file mode 100644 index 000000000000..25eb0809f2cf --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BecomeExpr/BecomeExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BecomeExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/BecomeExpr/gen_become_expr.rs b/rust/ql/test/extractor-tests/generated/BecomeExpr/gen_become_expr.rs new file mode 100644 index 000000000000..dd35255f4788 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BecomeExpr/gen_become_expr.rs @@ -0,0 +1,10 @@ +// generated by codegen + +// A `become` expression. For example: +fn fact_a(n: i32, a: i32) -> i32 { + if n == 0 { + a + } else { + become fact_a(n - 1, n * a) + } + } ``` diff --git a/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.expected b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.expected new file mode 100644 index 000000000000..7523e3df01c9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.expected @@ -0,0 +1,5 @@ +| gen_binary_expr.rs:5:5:5:9 | BinaryExpr | getLhs: | gen_binary_expr.rs:5:5:5:5 | PathExpr | getRhs: | gen_binary_expr.rs:5:9:5:9 | PathExpr | hasOp: | yes | +| gen_binary_expr.rs:6:5:6:10 | BinaryExpr | getLhs: | gen_binary_expr.rs:6:5:6:5 | PathExpr | getRhs: | gen_binary_expr.rs:6:10:6:10 | PathExpr | hasOp: | yes | +| gen_binary_expr.rs:7:5:7:10 | BinaryExpr | getLhs: | gen_binary_expr.rs:7:5:7:5 | PathExpr | getRhs: | gen_binary_expr.rs:7:10:7:10 | PathExpr | hasOp: | yes | +| gen_binary_expr.rs:8:5:8:9 | BinaryExpr | getLhs: | gen_binary_expr.rs:8:5:8:5 | PathExpr | getRhs: | gen_binary_expr.rs:8:9:8:9 | PathExpr | hasOp: | yes | +| gen_binary_expr.rs:9:5:9:10 | BinaryExpr | getLhs: | gen_binary_expr.rs:9:5:9:5 | PathExpr | getRhs: | gen_binary_expr.rs:9:10:9:10 | PathExpr | hasOp: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.ql b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.ql new file mode 100644 index 000000000000..91f358f258ec --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BinaryExpr x, Expr getLhs, Expr getRhs, string hasOp +where + toBeTested(x) and + not x.isUnknown() and + getLhs = x.getLhs() and + getRhs = x.getRhs() and + if x.hasOp() then hasOp = "yes" else hasOp = "no" +select x, "getLhs:", getLhs, "getRhs:", getRhs, "hasOp:", hasOp diff --git a/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.expected b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.expected new file mode 100644 index 000000000000..9f9e191f660a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.expected @@ -0,0 +1,5 @@ +| gen_binary_expr.rs:5:5:5:9 | BinaryExpr | + | +| gen_binary_expr.rs:6:5:6:10 | BinaryExpr | && | +| gen_binary_expr.rs:7:5:7:10 | BinaryExpr | <= | +| gen_binary_expr.rs:8:5:8:9 | BinaryExpr | = | +| gen_binary_expr.rs:9:5:9:10 | BinaryExpr | += | diff --git a/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.ql b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.ql new file mode 100644 index 000000000000..9fc20d407369 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOp.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BinaryExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getOp() diff --git a/rust/ql/test/extractor-tests/generated/BinaryExpr/gen_binary_expr.rs b/rust/ql/test/extractor-tests/generated/BinaryExpr/gen_binary_expr.rs new file mode 100644 index 000000000000..17f8c74c4b63 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryExpr/gen_binary_expr.rs @@ -0,0 +1,10 @@ +// generated by codegen + +fn test_binary_expr() -> () { + // A binary operation expression. For example: + x + y; + x && y; + x <= y; + x = y; + x += y; +} diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected new file mode 100644 index 000000000000..348f98b730ba --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected @@ -0,0 +1,3 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | hasLabel: | no | +| gen_block_expr.rs:5:5:7:5 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | no | hasLabel: | no | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | hasLabel: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql new file mode 100644 index 000000000000..d0c3e4e3e6db --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql @@ -0,0 +1,13 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x, int getNumberOfStatements, string hasTail, string hasLabel +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfStatements = x.getNumberOfStatements() and + (if x.hasTail() then hasTail = "yes" else hasTail = "no") and + if x.hasLabel() then hasLabel = "yes" else hasLabel = "no" +select x, "getNumberOfStatements:", getNumberOfStatements, "hasTail:", hasTail, "hasLabel:", + hasLabel diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected new file mode 100644 index 000000000000..3a935228e051 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected @@ -0,0 +1 @@ +| gen_block_expr.rs:8:5:11:5 | BlockExpr | gen_block_expr.rs:8:5:8:11 | Label | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql new file mode 100644 index 000000000000..dcc97bc9a485 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLabel() diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected new file mode 100644 index 000000000000..66dc93e503df --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected @@ -0,0 +1,3 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | 0 | gen_block_expr.rs:5:5:7:5 | ExprStmt | +| gen_block_expr.rs:5:5:7:5 | BlockExpr | 0 | gen_block_expr.rs:6:13:6:13 | LetStmt | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | 0 | gen_block_expr.rs:9:13:9:13 | LetStmt | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql new file mode 100644 index 000000000000..22c05e398d0a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getStatement(index) diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected new file mode 100644 index 000000000000..2a3d8031821c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected @@ -0,0 +1,2 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | gen_block_expr.rs:8:5:11:5 | BlockExpr | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | gen_block_expr.rs:10:9:10:9 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql new file mode 100644 index 000000000000..f86117be4b9d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getTail() diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs b/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs new file mode 100644 index 000000000000..9ccff26f1aae --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs @@ -0,0 +1,12 @@ +// generated by codegen + +fn test_block_expr() -> () { + // A block expression. For example: + { + let x = 42; + } + 'label: { + let x = 42; + x + } +} diff --git a/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.expected b/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.expected new file mode 100644 index 000000000000..b3324e400f5d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.expected @@ -0,0 +1 @@ +| gen_box_expr.rs:5:13:5:37 | BoxExpr | getExpr: | gen_box_expr.rs:5:35:5:36 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.ql b/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.ql new file mode 100644 index 000000000000..e24ec8ce6031 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxExpr/BoxExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BoxExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/BoxExpr/gen_box_expr.rs b/rust/ql/test/extractor-tests/generated/BoxExpr/gen_box_expr.rs new file mode 100644 index 000000000000..9ea4053ecf4b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxExpr/gen_box_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_box_expr() -> () { + // A box expression. For example: + let x = #[rustc_box] Box::new(42); +} diff --git a/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.expected b/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.expected new file mode 100644 index 000000000000..41597634b951 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.expected @@ -0,0 +1,2 @@ +| gen_box_pat.rs:6:9:6:27 | BoxPat | getInner: | gen_box_pat.rs:6:13:6:27 | TupleStructPat | +| gen_box_pat.rs:7:9:7:24 | BoxPat | getInner: | gen_box_pat.rs:7:13:7:24 | PathPat | diff --git a/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.ql b/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.ql new file mode 100644 index 000000000000..df6180cda58b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxPat/BoxPat.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BoxPat x, Pat getInner +where + toBeTested(x) and + not x.isUnknown() and + getInner = x.getInner() +select x, "getInner:", getInner diff --git a/rust/ql/test/extractor-tests/generated/BoxPat/gen_box_pat.rs b/rust/ql/test/extractor-tests/generated/BoxPat/gen_box_pat.rs new file mode 100644 index 000000000000..a8e16c413476 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxPat/gen_box_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_box_pat() -> () { + // A box pattern. For example: + match x { + box Option::Some(y) => y, + box Option::None => 0, + }; +} diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected new file mode 100644 index 000000000000..c7b451c235fc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected @@ -0,0 +1,2 @@ +| gen_break_expr.rs:7:13:7:17 | BreakExpr | hasExpr: | no | hasLabel: | no | +| gen_break_expr.rs:12:13:12:27 | BreakExpr | hasExpr: | yes | hasLabel: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.ql b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.ql new file mode 100644 index 000000000000..10d6cec5b611 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BreakExpr x, string hasExpr, string hasLabel +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasExpr() then hasExpr = "yes" else hasExpr = "no") and + if x.hasLabel() then hasLabel = "yes" else hasLabel = "no" +select x, "hasExpr:", hasExpr, "hasLabel:", hasLabel diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected new file mode 100644 index 000000000000..16dfc8124590 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected @@ -0,0 +1 @@ +| gen_break_expr.rs:12:13:12:27 | BreakExpr | gen_break_expr.rs:12:26:12:27 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.ql b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.ql new file mode 100644 index 000000000000..f83545cb7ce5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BreakExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getExpr() diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.expected new file mode 100644 index 000000000000..e8918129a36e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.expected @@ -0,0 +1 @@ +| gen_break_expr.rs:12:13:12:27 | BreakExpr | gen_break_expr.rs:10:13:10:19 | Label | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.ql b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.ql new file mode 100644 index 000000000000..6211ec52591a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLabel.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BreakExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLabel() diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs b/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs new file mode 100644 index 000000000000..4d2ec0573e32 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs @@ -0,0 +1,15 @@ +// generated by codegen + +fn test_break_expr() -> () { + // A break expression. For example: + loop { + if not_ready() { + break; + } + } + let x = 'label: loop { + if done() { + break 'label 42; + } + }; +} diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.expected b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.expected new file mode 100644 index 000000000000..111ff8392d21 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.expected @@ -0,0 +1,4 @@ +| gen_call_expr.rs:5:5:5:11 | CallExpr | getCallee: | gen_call_expr.rs:5:5:5:7 | PathExpr | getNumberOfArgs: | 1 | isAssigneeExpr: | no | +| gen_call_expr.rs:6:5:6:23 | CallExpr | getCallee: | gen_call_expr.rs:6:5:6:19 | PathExpr | getNumberOfArgs: | 1 | isAssigneeExpr: | no | +| gen_call_expr.rs:7:5:7:14 | CallExpr | getCallee: | gen_call_expr.rs:7:5:7:10 | IndexExpr | getNumberOfArgs: | 1 | isAssigneeExpr: | no | +| gen_call_expr.rs:8:5:8:10 | CallExpr | getCallee: | gen_call_expr.rs:8:5:8:7 | PathExpr | getNumberOfArgs: | 1 | isAssigneeExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.ql b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.ql new file mode 100644 index 000000000000..2d2c45c75b06 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr.ql @@ -0,0 +1,13 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from CallExpr x, Expr getCallee, int getNumberOfArgs, string isAssigneeExpr +where + toBeTested(x) and + not x.isUnknown() and + getCallee = x.getCallee() and + getNumberOfArgs = x.getNumberOfArgs() and + if x.isAssigneeExpr() then isAssigneeExpr = "yes" else isAssigneeExpr = "no" +select x, "getCallee:", getCallee, "getNumberOfArgs:", getNumberOfArgs, "isAssigneeExpr:", + isAssigneeExpr diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.expected b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.expected new file mode 100644 index 000000000000..6ff1a242993c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.expected @@ -0,0 +1,4 @@ +| gen_call_expr.rs:5:5:5:11 | CallExpr | 0 | gen_call_expr.rs:5:9:5:10 | LiteralExpr | +| gen_call_expr.rs:6:5:6:23 | CallExpr | 0 | gen_call_expr.rs:6:21:6:22 | LiteralExpr | +| gen_call_expr.rs:7:5:7:14 | CallExpr | 0 | gen_call_expr.rs:7:12:7:13 | LiteralExpr | +| gen_call_expr.rs:8:5:8:10 | CallExpr | 0 | gen_call_expr.rs:8:9:8:9 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.ql b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.ql new file mode 100644 index 000000000000..8f7ead93761e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/CallExpr_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from CallExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/gen_call_expr.rs b/rust/ql/test/extractor-tests/generated/CallExpr/gen_call_expr.rs new file mode 100644 index 000000000000..4d6c737e95cb --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/gen_call_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_call_expr() -> () { + // A function call expression. For example: + foo(42); + foo::(42); + foo[0](42); + foo(1) = 4; +} diff --git a/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.expected b/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.expected new file mode 100644 index 000000000000..b06efc92f75b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.expected @@ -0,0 +1 @@ +| gen_cast_expr.rs:5:5:5:16 | CastExpr | getExpr: | gen_cast_expr.rs:5:5:5:9 | PathExpr | getType: | file://:0:0:0:0 | TypeRef | diff --git a/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.ql b/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.ql new file mode 100644 index 000000000000..0b724a6f3ac7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CastExpr/CastExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from CastExpr x, Expr getExpr, TypeRef getType +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + getType = x.getType() +select x, "getExpr:", getExpr, "getType:", getType diff --git a/rust/ql/test/extractor-tests/generated/CastExpr/gen_cast_expr.rs b/rust/ql/test/extractor-tests/generated/CastExpr/gen_cast_expr.rs new file mode 100644 index 000000000000..11230130d065 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CastExpr/gen_cast_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_cast_expr() -> () { + // A cast expression. For example: + value as u64; +} diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected new file mode 100644 index 000000000000..0d9c025ea4a6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected @@ -0,0 +1,5 @@ +| gen_closure_expr.rs:5:5:5:13 | ClosureExpr | getNumberOfArgs: | 1 | hasRetType: | no | getBody: | gen_closure_expr.rs:5:9:5:13 | BinaryExpr | getClosureKind: | Closure | isMove: | no | +| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | getNumberOfArgs: | 1 | hasRetType: | yes | getBody: | gen_closure_expr.rs:6:26:6:34 | BlockExpr | getClosureKind: | Closure | isMove: | yes | +| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | getNumberOfArgs: | 2 | hasRetType: | no | getBody: | gen_closure_expr.rs:7:23:7:27 | BinaryExpr | getClosureKind: | Async | isMove: | no | +| gen_closure_expr.rs:8:6:9:15 | ClosureExpr | getNumberOfArgs: | 1 | hasRetType: | no | getBody: | gen_closure_expr.rs:9:9:9:15 | YieldExpr | getClosureKind: | Coroutine(Movable) | isMove: | no | +| gen_closure_expr.rs:10:6:11:23 | ClosureExpr | getNumberOfArgs: | 1 | hasRetType: | no | getBody: | gen_closure_expr.rs:11:17:11:23 | YieldExpr | getClosureKind: | Coroutine(Static) | isMove: | no | diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql new file mode 100644 index 000000000000..b56eda1978ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql @@ -0,0 +1,17 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from + ClosureExpr x, int getNumberOfArgs, string hasRetType, Expr getBody, string getClosureKind, + string isMove +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfArgs = x.getNumberOfArgs() and + (if x.hasRetType() then hasRetType = "yes" else hasRetType = "no") and + getBody = x.getBody() and + getClosureKind = x.getClosureKind() and + if x.isMove() then isMove = "yes" else isMove = "no" +select x, "getNumberOfArgs:", getNumberOfArgs, "hasRetType:", hasRetType, "getBody:", getBody, + "getClosureKind:", getClosureKind, "isMove:", isMove diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.expected b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.expected new file mode 100644 index 000000000000..41bbc86fb709 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.expected @@ -0,0 +1,6 @@ +| gen_closure_expr.rs:5:5:5:13 | ClosureExpr | 0 | gen_closure_expr.rs:5:6:5:6 | IdentPat | +| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | 0 | gen_closure_expr.rs:6:11:6:11 | IdentPat | +| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | 0 | gen_closure_expr.rs:7:12:7:12 | IdentPat | +| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | 1 | gen_closure_expr.rs:7:20:7:20 | IdentPat | +| gen_closure_expr.rs:8:6:9:15 | ClosureExpr | 0 | gen_closure_expr.rs:9:6:9:6 | IdentPat | +| gen_closure_expr.rs:10:6:11:23 | ClosureExpr | 0 | gen_closure_expr.rs:11:14:11:14 | IdentPat | diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.ql b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.ql new file mode 100644 index 000000000000..eca1b3a1f3da --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ClosureExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.expected b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.expected new file mode 100644 index 000000000000..dd1f87a74c10 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.expected @@ -0,0 +1,2 @@ +| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | 0 | file://:0:0:0:0 | TypeRef | +| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | 0 | file://:0:0:0:0 | TypeRef | diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.ql b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.ql new file mode 100644 index 000000000000..c2fd9a3022bc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getArgType.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ClosureExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArgType(index) diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.expected b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.expected new file mode 100644 index 000000000000..6decd91ca765 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.expected @@ -0,0 +1 @@ +| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | file://:0:0:0:0 | TypeRef | diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql new file mode 100644 index 000000000000..b428052d169e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ClosureExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getRetType() diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/gen_closure_expr.rs b/rust/ql/test/extractor-tests/generated/ClosureExpr/gen_closure_expr.rs new file mode 100644 index 000000000000..41e67e6bd87c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/gen_closure_expr.rs @@ -0,0 +1,12 @@ +// generated by codegen + +fn test_closure_expr() -> () { + // A closure expression. For example: + |x| x + 1; + move |x: i32| -> i32 { x + 1 }; + async |x: i32, y| x + y; + #[coroutine] + |x| yield x; + #[coroutine] + static |x| yield x; +} diff --git a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected new file mode 100644 index 000000000000..965df88445ed --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected @@ -0,0 +1 @@ +| gen_const_block_pat.rs:6:9:6:27 | ConstBlockPat | getExpr: | gen_const_block_pat.rs:6:15:6:27 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql new file mode 100644 index 000000000000..c412596eb32c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ConstBlockPat x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/ConstBlockPat/gen_const_block_pat.rs b/rust/ql/test/extractor-tests/generated/ConstBlockPat/gen_const_block_pat.rs new file mode 100644 index 000000000000..bb2a1743de40 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstBlockPat/gen_const_block_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_const_block_pat() -> () { + // A const block pattern. For example: + match x { + const { 1 + 2 + 3 } => "ok", + _ => "fail", + }; +} diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected new file mode 100644 index 000000000000..b36d974f7734 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected @@ -0,0 +1 @@ +| gen_const_expr.rs:5:8:5:97 | ConstExpr | getExpr: | gen_const_expr.rs:5:8:5:97 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql new file mode 100644 index 000000000000..700a5c704022 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ConstExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs b/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs new file mode 100644 index 000000000000..c9e3e3550906 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_const_expr() -> bool { + // A `const` block expression. For example: + if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + return false; + } +} diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.expected b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.expected new file mode 100644 index 000000000000..5bc5e5fc6667 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.expected @@ -0,0 +1,2 @@ +| gen_continue_expr.rs:7:13:7:20 | ContinueExpr | hasLabel: | no | +| gen_continue_expr.rs:12:13:12:27 | ContinueExpr | hasLabel: | yes | diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.ql b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.ql new file mode 100644 index 000000000000..399b8783da20 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ContinueExpr x, string hasLabel +where + toBeTested(x) and + not x.isUnknown() and + if x.hasLabel() then hasLabel = "yes" else hasLabel = "no" +select x, "hasLabel:", hasLabel diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.expected b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.expected new file mode 100644 index 000000000000..8688627b27ee --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.expected @@ -0,0 +1 @@ +| gen_continue_expr.rs:12:13:12:27 | ContinueExpr | gen_continue_expr.rs:10:5:10:11 | Label | diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.ql b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.ql new file mode 100644 index 000000000000..b9944aa07303 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLabel.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ContinueExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLabel() diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/gen_continue_expr.rs b/rust/ql/test/extractor-tests/generated/ContinueExpr/gen_continue_expr.rs new file mode 100644 index 000000000000..e818d65270b3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/gen_continue_expr.rs @@ -0,0 +1,15 @@ +// generated by codegen + +fn test_continue_expr() -> () { + // A continue expression. For example: + loop { + if not_ready() { + continue; + } + } + 'label: loop { + if not_ready() { + continue 'label; + } + } +} diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.expected b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.expected new file mode 100644 index 000000000000..8d6bdea67755 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.expected @@ -0,0 +1,2 @@ +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | getNumberOfElements: | 5 | isAssigneeExpr: | no | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | getNumberOfElements: | 5 | isAssigneeExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.ql b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.ql new file mode 100644 index 000000000000..9d8254f5ca51 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ElementListExpr x, int getNumberOfElements, string isAssigneeExpr +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfElements = x.getNumberOfElements() and + if x.isAssigneeExpr() then isAssigneeExpr = "yes" else isAssigneeExpr = "no" +select x, "getNumberOfElements:", getNumberOfElements, "isAssigneeExpr:", isAssigneeExpr diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.expected b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.expected new file mode 100644 index 000000000000..8bed9878b6e9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.expected @@ -0,0 +1,10 @@ +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | 0 | gen_element_list_expr.rs:5:6:5:6 | LiteralExpr | +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | 1 | gen_element_list_expr.rs:5:9:5:9 | LiteralExpr | +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | 2 | gen_element_list_expr.rs:5:12:5:12 | LiteralExpr | +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | 3 | gen_element_list_expr.rs:5:15:5:15 | LiteralExpr | +| gen_element_list_expr.rs:5:5:5:19 | ElementListExpr | 4 | gen_element_list_expr.rs:5:18:5:18 | LiteralExpr | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | 0 | gen_element_list_expr.rs:6:6:6:6 | LiteralExpr | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | 1 | gen_element_list_expr.rs:6:9:6:9 | LiteralExpr | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | 2 | gen_element_list_expr.rs:6:12:6:12 | LiteralExpr | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | 3 | gen_element_list_expr.rs:6:15:6:15 | LiteralExpr | +| gen_element_list_expr.rs:6:5:6:19 | ElementListExpr | 4 | gen_element_list_expr.rs:6:18:6:18 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.ql b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.ql new file mode 100644 index 000000000000..7d38ce31602b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/ElementListExpr_getElement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ElementListExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getElement(index) diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/gen_element_list_expr.rs b/rust/ql/test/extractor-tests/generated/ElementListExpr/gen_element_list_expr.rs new file mode 100644 index 000000000000..7a8400b446ce --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/gen_element_list_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_element_list_expr() -> () { + // An element list expression. For example: + [1, 2, 3, 4, 5]; + [1, 2, 3, 4, 5][0] = 6; +} diff --git a/rust/ql/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected new file mode 100644 index 000000000000..38497d3afabf --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected @@ -0,0 +1,2 @@ +| gen_expr_stmt.rs:5:5:5:11 | ExprStmt | getExpr: | gen_expr_stmt.rs:5:5:5:11 | CallExpr | hasSemicolon: | yes | +| gen_expr_stmt.rs:6:5:6:12 | ExprStmt | getExpr: | gen_expr_stmt.rs:6:5:6:12 | CallExpr | hasSemicolon: | no | diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.ql b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.ql new file mode 100644 index 000000000000..ff299ff6e5ab --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ExprStmt x, Expr getExpr, string hasSemicolon +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + if x.hasSemicolon() then hasSemicolon = "yes" else hasSemicolon = "no" +select x, "getExpr:", getExpr, "hasSemicolon:", hasSemicolon diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs b/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs new file mode 100644 index 000000000000..fefe06876995 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_expr_stmt() -> () { + // An expression statement. For example: + start(); + finish() + use std::env; +} diff --git a/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.expected b/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.expected new file mode 100644 index 000000000000..0ac28f7f13f8 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.expected @@ -0,0 +1 @@ +| gen_field_expr.rs:5:5:5:9 | FieldExpr | getExpr: | gen_field_expr.rs:5:5:5:5 | PathExpr | getName: | foo | diff --git a/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.ql b/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.ql new file mode 100644 index 000000000000..5cc4bc15dafd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/FieldExpr/FieldExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from FieldExpr x, Expr getExpr, string getName +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + getName = x.getName() +select x, "getExpr:", getExpr, "getName:", getName diff --git a/rust/ql/test/extractor-tests/generated/FieldExpr/gen_field_expr.rs b/rust/ql/test/extractor-tests/generated/FieldExpr/gen_field_expr.rs new file mode 100644 index 000000000000..d5f02eb26512 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/FieldExpr/gen_field_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_field_expr() -> () { + // A field access expression. For example: + x.foo +} diff --git a/rust/ql/test/extractor-tests/generated/File/File.expected b/rust/ql/test/extractor-tests/generated/File/File.expected deleted file mode 100644 index 47f86056a5f2..000000000000 --- a/rust/ql/test/extractor-tests/generated/File/File.expected +++ /dev/null @@ -1,2 +0,0 @@ -| lib.rs:0:0:0:0 | lib.rs | DbFile | getName: | lib.rs | -| test.rs:0:0:0:0 | test.rs | DbFile | getName: | test.rs | diff --git a/rust/ql/test/extractor-tests/generated/Function/Function.expected b/rust/ql/test/extractor-tests/generated/Function/Function.expected index 453a2db17934..ccb4ce460e3a 100644 --- a/rust/ql/test/extractor-tests/generated/Function/Function.expected +++ b/rust/ql/test/extractor-tests/generated/Function/Function.expected @@ -1 +1 @@ -| gen_function.rs:3:1:4:40 | foo | getName: | foo | getBody: | gen_function.rs:4:23:4:40 | BlockExpr | +| gen_function.rs:3:1:4:38 | foo | getName: | foo | getBody: | gen_function.rs:4:23:4:38 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/Function/gen_function.rs b/rust/ql/test/extractor-tests/generated/Function/gen_function.rs index 0df26fce0ee8..2c306d78c074 100644 --- a/rust/ql/test/extractor-tests/generated/Function/gen_function.rs +++ b/rust/ql/test/extractor-tests/generated/Function/gen_function.rs @@ -1,7 +1,7 @@ // generated by codegen // A function declaration. For example -fn foo(x: u32) -> u64 { (x + 1).into() } +fn foo(x: u32) -> u64 {(x + 1).into()} // A function declaration within a trait might not have a body: trait Trait { fn bar(); diff --git a/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.expected b/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.expected new file mode 100644 index 000000000000..43c48a031599 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.expected @@ -0,0 +1 @@ +| file://:0:0:0:0 | GenericArgList | diff --git a/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.ql b/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.ql new file mode 100644 index 000000000000..d4b2fa8beebe --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/GenericArgList/GenericArgList.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from GenericArgList x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/GenericArgList/gen_generic_arg_list.rs b/rust/ql/test/extractor-tests/generated/GenericArgList/gen_generic_arg_list.rs new file mode 100644 index 000000000000..a439ab96505d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/GenericArgList/gen_generic_arg_list.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_generic_arg_list() -> () { + // The base class for generic arguments. + x.foo::(42); +} diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected new file mode 100644 index 000000000000..6973ca9aba2e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected @@ -0,0 +1,2 @@ +| gen_ident_pat.rs:6:22:6:22 | IdentPat | getBindingId: | y | hasSubpat: | no | +| gen_ident_pat.rs:10:9:10:25 | IdentPat | getBindingId: | y | hasSubpat: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql new file mode 100644 index 000000000000..b5fe4af4f8a6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IdentPat x, string getBindingId, string hasSubpat +where + toBeTested(x) and + not x.isUnknown() and + getBindingId = x.getBindingId() and + if x.hasSubpat() then hasSubpat = "yes" else hasSubpat = "no" +select x, "getBindingId:", getBindingId, "hasSubpat:", hasSubpat diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.expected new file mode 100644 index 000000000000..705456753b9c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.expected @@ -0,0 +1 @@ +| gen_ident_pat.rs:10:9:10:25 | IdentPat | gen_ident_pat.rs:10:11:10:25 | TupleStructPat | diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.ql b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.ql new file mode 100644 index 000000000000..71302ef13674 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat_getSubpat.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IdentPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getSubpat() diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/gen_ident_pat.rs b/rust/ql/test/extractor-tests/generated/IdentPat/gen_ident_pat.rs new file mode 100644 index 000000000000..0b8111cc1072 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IdentPat/gen_ident_pat.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_ident_pat() -> () { + // A binding pattern. For example: + match x { + Option::Some(y) => y, + Option::None => 0, + }; + match x { + y@Option::Some(_) => y, + Option::None => 0, + }; +} diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected new file mode 100644 index 000000000000..44dff354b047 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected @@ -0,0 +1,2 @@ +| gen_if_expr.rs:5:5:7:5 | IfExpr | getCondition: | gen_if_expr.rs:5:8:5:14 | BinaryExpr | getThen: | gen_if_expr.rs:5:16:7:5 | BlockExpr | hasElse: | no | +| gen_if_expr.rs:8:13:12:5 | IfExpr | getCondition: | gen_if_expr.rs:8:16:8:20 | BinaryExpr | getThen: | gen_if_expr.rs:8:22:10:5 | BlockExpr | hasElse: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql new file mode 100644 index 000000000000..a684dcd54341 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IfExpr x, Expr getCondition, Expr getThen, string hasElse +where + toBeTested(x) and + not x.isUnknown() and + getCondition = x.getCondition() and + getThen = x.getThen() and + if x.hasElse() then hasElse = "yes" else hasElse = "no" +select x, "getCondition:", getCondition, "getThen:", getThen, "hasElse:", hasElse diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected new file mode 100644 index 000000000000..a857dbe2099a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected @@ -0,0 +1 @@ +| gen_if_expr.rs:8:13:12:5 | IfExpr | gen_if_expr.rs:10:12:12:5 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql new file mode 100644 index 000000000000..8e6209a248c1 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IfExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getElse() diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs b/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs new file mode 100644 index 000000000000..6ef2659892bc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_if_expr() -> () { + // An `if` expression. For example: + if x == 42 { + println!("that's the answer"); + } + let y = if x > 0 { + 1 + } else { + 0 + } +} diff --git a/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.expected b/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.expected new file mode 100644 index 000000000000..edbf139dfc35 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.expected @@ -0,0 +1,2 @@ +| gen_index_expr.rs:5:5:5:12 | IndexExpr | getBase: | gen_index_expr.rs:5:5:5:8 | PathExpr | getIndex: | gen_index_expr.rs:5:10:5:11 | LiteralExpr | isAssigneeExpr: | no | +| gen_index_expr.rs:6:5:6:12 | IndexExpr | getBase: | gen_index_expr.rs:6:5:6:8 | PathExpr | getIndex: | gen_index_expr.rs:6:10:6:11 | LiteralExpr | isAssigneeExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.ql b/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.ql new file mode 100644 index 000000000000..e03488ac6d08 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IndexExpr/IndexExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IndexExpr x, Expr getBase, Expr getIndex, string isAssigneeExpr +where + toBeTested(x) and + not x.isUnknown() and + getBase = x.getBase() and + getIndex = x.getIndex() and + if x.isAssigneeExpr() then isAssigneeExpr = "yes" else isAssigneeExpr = "no" +select x, "getBase:", getBase, "getIndex:", getIndex, "isAssigneeExpr:", isAssigneeExpr diff --git a/rust/ql/test/extractor-tests/generated/IndexExpr/gen_index_expr.rs b/rust/ql/test/extractor-tests/generated/IndexExpr/gen_index_expr.rs new file mode 100644 index 000000000000..117577d368e3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IndexExpr/gen_index_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_index_expr() -> () { + // An index expression. For example: + list[42]; + list[42] = 1; +} diff --git a/rust/ql/test/extractor-tests/generated/Label/Label.expected b/rust/ql/test/extractor-tests/generated/Label/Label.expected new file mode 100644 index 000000000000..297511910be5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Label/Label.expected @@ -0,0 +1,2 @@ +| gen_label.rs:5:5:5:11 | Label | getName: | 'label | +| gen_label.rs:5:5:5:11 | Label | getName: | 'label | diff --git a/rust/ql/test/extractor-tests/generated/Label/Label.ql b/rust/ql/test/extractor-tests/generated/Label/Label.ql new file mode 100644 index 000000000000..873eacb4772c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Label/Label.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from Label x, string getName +where + toBeTested(x) and + not x.isUnknown() and + getName = x.getName() +select x, "getName:", getName diff --git a/rust/ql/test/extractor-tests/generated/Label/gen_label.rs b/rust/ql/test/extractor-tests/generated/Label/gen_label.rs new file mode 100644 index 000000000000..2fd977db1593 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Label/gen_label.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_label() -> () { + // A label. For example: + 'label: loop { + println!("Hello, world (once)!"); + break 'label; + }; +} diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected new file mode 100644 index 000000000000..41d358886f42 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected @@ -0,0 +1 @@ +| gen_let_expr.rs:5:8:5:31 | LetExpr | getPat: | gen_let_expr.rs:5:12:5:18 | TupleStructPat | getExpr: | gen_let_expr.rs:5:22:5:31 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql new file mode 100644 index 000000000000..bcb2e1112678 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetExpr x, Pat getPat, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getPat = x.getPat() and + getExpr = x.getExpr() +select x, "getPat:", getPat, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs b/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs new file mode 100644 index 000000000000..1a8bab21c4fe --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_let_expr(maybe_some: Option) -> () { + // A `let` expression. For example: + if let Some(x) = maybe_some { + println!("{}", x); + } +} diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.expected b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.expected new file mode 100644 index 000000000000..a60f24798332 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.expected @@ -0,0 +1,6 @@ +| gen_let_stmt.rs:5:9:5:9 | LetStmt | getPat: | gen_let_stmt.rs:5:9:5:9 | IdentPat | hasType: | no | hasInitializer: | yes | hasElse: | no | +| gen_let_stmt.rs:6:9:6:9 | LetStmt | getPat: | gen_let_stmt.rs:6:9:6:9 | IdentPat | hasType: | yes | hasInitializer: | yes | hasElse: | no | +| gen_let_stmt.rs:7:9:7:9 | LetStmt | getPat: | gen_let_stmt.rs:7:9:7:9 | IdentPat | hasType: | yes | hasInitializer: | no | hasElse: | no | +| gen_let_stmt.rs:8:9:8:9 | LetStmt | getPat: | gen_let_stmt.rs:8:9:8:9 | IdentPat | hasType: | no | hasInitializer: | no | hasElse: | no | +| gen_let_stmt.rs:9:9:9:14 | LetStmt | getPat: | gen_let_stmt.rs:9:9:9:14 | TuplePat | hasType: | no | hasInitializer: | yes | hasElse: | no | +| gen_let_stmt.rs:10:9:10:15 | LetStmt | getPat: | gen_let_stmt.rs:10:9:10:15 | TupleStructPat | hasType: | no | hasInitializer: | yes | hasElse: | yes | diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.ql b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.ql new file mode 100644 index 000000000000..02a624e921e4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt.ql @@ -0,0 +1,14 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetStmt x, Pat getPat, string hasType, string hasInitializer, string hasElse +where + toBeTested(x) and + not x.isUnknown() and + getPat = x.getPat() and + (if x.hasType() then hasType = "yes" else hasType = "no") and + (if x.hasInitializer() then hasInitializer = "yes" else hasInitializer = "no") and + if x.hasElse() then hasElse = "yes" else hasElse = "no" +select x, "getPat:", getPat, "hasType:", hasType, "hasInitializer:", hasInitializer, "hasElse:", + hasElse diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.expected b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.expected new file mode 100644 index 000000000000..2d6e500d14a6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.expected @@ -0,0 +1 @@ +| gen_let_stmt.rs:10:9:10:15 | LetStmt | gen_let_stmt.rs:10:45:12:5 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.ql b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.ql new file mode 100644 index 000000000000..66ac961a635d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getElse.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetStmt x +where toBeTested(x) and not x.isUnknown() +select x, x.getElse() diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.expected b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.expected new file mode 100644 index 000000000000..59bffddf5453 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.expected @@ -0,0 +1,4 @@ +| gen_let_stmt.rs:5:9:5:9 | LetStmt | gen_let_stmt.rs:5:13:5:14 | LiteralExpr | +| gen_let_stmt.rs:6:9:6:9 | LetStmt | gen_let_stmt.rs:6:18:6:19 | LiteralExpr | +| gen_let_stmt.rs:9:9:9:14 | LetStmt | gen_let_stmt.rs:9:18:9:23 | TupleExpr | +| gen_let_stmt.rs:10:9:10:15 | LetStmt | gen_let_stmt.rs:10:19:10:38 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.ql b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.ql new file mode 100644 index 000000000000..4578c2c87680 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getInitializer.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetStmt x +where toBeTested(x) and not x.isUnknown() +select x, x.getInitializer() diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.expected b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.expected new file mode 100644 index 000000000000..7a67697cb653 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.expected @@ -0,0 +1,2 @@ +| gen_let_stmt.rs:6:9:6:9 | LetStmt | file://:0:0:0:0 | TypeRef | +| gen_let_stmt.rs:7:9:7:9 | LetStmt | file://:0:0:0:0 | TypeRef | diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.ql b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.ql new file mode 100644 index 000000000000..62271f18fb00 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/LetStmt_getType.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetStmt x +where toBeTested(x) and not x.isUnknown() +select x, x.getType() diff --git a/rust/ql/test/extractor-tests/generated/LetStmt/gen_let_stmt.rs b/rust/ql/test/extractor-tests/generated/LetStmt/gen_let_stmt.rs new file mode 100644 index 000000000000..307386b8aef4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetStmt/gen_let_stmt.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_let_stmt() -> () { + // A let statement. For example: + let x = 42; + let x: i32 = 42; + let x: i32; + let x; + let (x, y) = (1, 2); + let Some(x) = std::env::var("FOO") else { + return; + }; +} diff --git a/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.expected b/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.expected new file mode 100644 index 000000000000..4ea6107f6a81 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.expected @@ -0,0 +1,8 @@ +| gen_literal_expr.rs:5:5:5:6 | LiteralExpr | +| gen_literal_expr.rs:6:5:6:8 | LiteralExpr | +| gen_literal_expr.rs:7:5:7:19 | LiteralExpr | +| gen_literal_expr.rs:8:5:8:20 | LiteralExpr | +| gen_literal_expr.rs:9:5:9:7 | LiteralExpr | +| gen_literal_expr.rs:10:5:10:8 | LiteralExpr | +| gen_literal_expr.rs:11:5:11:20 | LiteralExpr | +| gen_literal_expr.rs:12:5:12:8 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.ql b/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.ql new file mode 100644 index 000000000000..48c2e1d6f00f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralExpr/LiteralExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LiteralExpr x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/LiteralExpr/gen_literal_expr.rs b/rust/ql/test/extractor-tests/generated/LiteralExpr/gen_literal_expr.rs new file mode 100644 index 000000000000..13e1590e8e54 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralExpr/gen_literal_expr.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_literal_expr() -> () { + // A literal expression. For example: + 42; + 42.0; + "Hello, world!"; + b"Hello, world!"; + 'x'; + b'x'; + r"Hello, world!"; + true; +} diff --git a/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.expected b/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.expected new file mode 100644 index 000000000000..ebde9562c6da --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.expected @@ -0,0 +1 @@ +| gen_literal_pat.rs:6:9:6:10 | LiteralPat | getExpr: | gen_literal_pat.rs:6:9:6:10 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.ql b/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.ql new file mode 100644 index 000000000000..d3c76459e49e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralPat/LiteralPat.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LiteralPat x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/LiteralPat/gen_literal_pat.rs b/rust/ql/test/extractor-tests/generated/LiteralPat/gen_literal_pat.rs new file mode 100644 index 000000000000..f029cbb8660e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralPat/gen_literal_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_literal_pat() -> () { + // A literal pattern. For example: + match x { + 42 => "ok", + _ => "fail", + } +} diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.expected b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.expected new file mode 100644 index 000000000000..82e50bf474f4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.expected @@ -0,0 +1,3 @@ +| gen_loop_expr.rs:5:5:7:5 | LoopExpr | getBody: | gen_loop_expr.rs:5:10:7:5 | BlockExpr | hasLabel: | no | +| gen_loop_expr.rs:8:5:11:5 | LoopExpr | getBody: | gen_loop_expr.rs:8:18:11:5 | BlockExpr | hasLabel: | yes | +| gen_loop_expr.rs:13:5:19:5 | LoopExpr | getBody: | gen_loop_expr.rs:13:10:19:5 | BlockExpr | hasLabel: | no | diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql new file mode 100644 index 000000000000..aa62fe0be91e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LoopExpr x, Expr getBody, string hasLabel +where + toBeTested(x) and + not x.isUnknown() and + getBody = x.getBody() and + if x.hasLabel() then hasLabel = "yes" else hasLabel = "no" +select x, "getBody:", getBody, "hasLabel:", hasLabel diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.expected b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.expected new file mode 100644 index 000000000000..98a657f09832 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.expected @@ -0,0 +1 @@ +| gen_loop_expr.rs:8:5:11:5 | LoopExpr | gen_loop_expr.rs:8:5:8:11 | Label | diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql new file mode 100644 index 000000000000..67d1fd3e07bd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LoopExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLabel() diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/gen_loop_expr.rs b/rust/ql/test/extractor-tests/generated/LoopExpr/gen_loop_expr.rs new file mode 100644 index 000000000000..699cbe243164 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/gen_loop_expr.rs @@ -0,0 +1,20 @@ +// generated by codegen + +fn test_loop_expr() -> () { + // A loop expression. For example: + loop { + println!("Hello, world (again)!"); + }; + 'label: loop { + println!("Hello, world (once)!"); + break 'label; + }; + let mut x = 0; + loop { + if x < 10 { + x += 1; + } else { + break; + } + }; +} diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.expected b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.expected new file mode 100644 index 000000000000..97b049e6f540 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.expected @@ -0,0 +1,4 @@ +| gen_match_arm.rs:6:9:6:23 | MatchArm | getPat: | gen_match_arm.rs:6:9:6:23 | TupleStructPat | hasGuard: | no | getExpr: | gen_match_arm.rs:6:28:6:28 | PathExpr | +| gen_match_arm.rs:7:9:7:20 | MatchArm | getPat: | gen_match_arm.rs:7:9:7:20 | PathPat | hasGuard: | no | getExpr: | gen_match_arm.rs:7:25:7:25 | LiteralExpr | +| gen_match_arm.rs:10:9:10:15 | MatchArm | getPat: | gen_match_arm.rs:10:9:10:15 | TupleStructPat | hasGuard: | yes | getExpr: | gen_match_arm.rs:10:30:10:34 | BinaryExpr | +| gen_match_arm.rs:11:9:11:9 | MatchArm | getPat: | gen_match_arm.rs:11:9:11:9 | WildcardPat | hasGuard: | no | getExpr: | gen_match_arm.rs:11:14:11:14 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.ql b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.ql new file mode 100644 index 000000000000..6f65a88f202c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MatchArm x, Pat getPat, string hasGuard, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getPat = x.getPat() and + (if x.hasGuard() then hasGuard = "yes" else hasGuard = "no") and + getExpr = x.getExpr() +select x, "getPat:", getPat, "hasGuard:", hasGuard, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.expected b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.expected new file mode 100644 index 000000000000..7430f1179eb7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.expected @@ -0,0 +1 @@ +| gen_match_arm.rs:10:9:10:15 | MatchArm | gen_match_arm.rs:10:20:10:25 | BinaryExpr | diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.ql b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.ql new file mode 100644 index 000000000000..345a08a7c6a5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchArm/MatchArm_getGuard.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MatchArm x +where toBeTested(x) and not x.isUnknown() +select x, x.getGuard() diff --git a/rust/ql/test/extractor-tests/generated/MatchArm/gen_match_arm.rs b/rust/ql/test/extractor-tests/generated/MatchArm/gen_match_arm.rs new file mode 100644 index 000000000000..bda762f694bf --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchArm/gen_match_arm.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_match_arm(x: i32) -> i32 { + // A match arm. For example: + match x { + Option::Some(y) => y, + Option::None => 0, + }; + match x { + Some(y) if y != 0 => 1 / y, + _ => 0, + }; +} diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.expected b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.expected new file mode 100644 index 000000000000..15c7dcb2f237 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.expected @@ -0,0 +1,2 @@ +| gen_match_expr.rs:5:5:8:5 | MatchExpr | getExpr: | gen_match_expr.rs:5:11:5:11 | PathExpr | getNumberOfBranches: | 2 | +| gen_match_expr.rs:9:5:12:5 | MatchExpr | getExpr: | gen_match_expr.rs:9:11:9:11 | PathExpr | getNumberOfBranches: | 2 | diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.ql b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.ql new file mode 100644 index 000000000000..3b59363841f0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MatchExpr x, Expr getExpr, int getNumberOfBranches +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + getNumberOfBranches = x.getNumberOfBranches() +select x, "getExpr:", getExpr, "getNumberOfBranches:", getNumberOfBranches diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.expected b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.expected new file mode 100644 index 000000000000..ff70602e20dd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.expected @@ -0,0 +1,4 @@ +| gen_match_expr.rs:5:5:8:5 | MatchExpr | 0 | gen_match_expr.rs:6:9:6:23 | MatchArm | +| gen_match_expr.rs:5:5:8:5 | MatchExpr | 1 | gen_match_expr.rs:7:9:7:20 | MatchArm | +| gen_match_expr.rs:9:5:12:5 | MatchExpr | 0 | gen_match_expr.rs:10:9:10:15 | MatchArm | +| gen_match_expr.rs:9:5:12:5 | MatchExpr | 1 | gen_match_expr.rs:11:9:11:9 | MatchArm | diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.ql b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.ql new file mode 100644 index 000000000000..42f235a3a6e5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MatchExpr_getBranch.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MatchExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getBranch(index) diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/gen_match_expr.rs b/rust/ql/test/extractor-tests/generated/MatchExpr/gen_match_expr.rs new file mode 100644 index 000000000000..2e50514cc552 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/gen_match_expr.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_match_expr(x: i32) -> i32 { + // A match expression. For example: + match x { + Option::Some(y) => y, + Option::None => 0, + } + match x { + Some(y) if y != 0 => 1 / y, + _ => 0, + } +} diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.expected b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.expected new file mode 100644 index 000000000000..d28ebe1c53ed --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.expected @@ -0,0 +1,2 @@ +| gen_method_call_expr.rs:5:5:5:13 | MethodCallExpr | getReceiver: | gen_method_call_expr.rs:5:5:5:5 | PathExpr | getMethodName: | foo | getNumberOfArgs: | 1 | hasGenericArgs: | no | +| gen_method_call_expr.rs:6:5:6:25 | MethodCallExpr | getReceiver: | gen_method_call_expr.rs:6:5:6:5 | PathExpr | getMethodName: | foo | getNumberOfArgs: | 1 | hasGenericArgs: | yes | diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.ql b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.ql new file mode 100644 index 000000000000..70b43f0707c2 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr.ql @@ -0,0 +1,16 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from + MethodCallExpr x, Expr getReceiver, string getMethodName, int getNumberOfArgs, + string hasGenericArgs +where + toBeTested(x) and + not x.isUnknown() and + getReceiver = x.getReceiver() and + getMethodName = x.getMethodName() and + getNumberOfArgs = x.getNumberOfArgs() and + if x.hasGenericArgs() then hasGenericArgs = "yes" else hasGenericArgs = "no" +select x, "getReceiver:", getReceiver, "getMethodName:", getMethodName, "getNumberOfArgs:", + getNumberOfArgs, "hasGenericArgs:", hasGenericArgs diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.expected b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.expected new file mode 100644 index 000000000000..601b344cd0fc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.expected @@ -0,0 +1,2 @@ +| gen_method_call_expr.rs:5:5:5:13 | MethodCallExpr | 0 | gen_method_call_expr.rs:5:11:5:12 | LiteralExpr | +| gen_method_call_expr.rs:6:5:6:25 | MethodCallExpr | 0 | gen_method_call_expr.rs:6:23:6:24 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.ql b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.ql new file mode 100644 index 000000000000..9ddca0971908 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MethodCallExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.expected b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.expected new file mode 100644 index 000000000000..f4590b4f4e15 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.expected @@ -0,0 +1 @@ +| gen_method_call_expr.rs:6:5:6:25 | MethodCallExpr | file://:0:0:0:0 | GenericArgList | diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.ql b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.ql new file mode 100644 index 000000000000..a1e4ef6c2098 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MethodCallExpr_getGenericArgs.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MethodCallExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getGenericArgs() diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/gen_method_call_expr.rs b/rust/ql/test/extractor-tests/generated/MethodCallExpr/gen_method_call_expr.rs new file mode 100644 index 000000000000..d4c2d5bc1352 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/gen_method_call_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_method_call_expr() -> () { + // A method call expression. For example: + x.foo(42); + x.foo::(42); +} diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected new file mode 100644 index 000000000000..bd096b3f4880 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected @@ -0,0 +1 @@ +| gen_missing_expr.rs:6:13:6:33 | MissingExpr | diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql new file mode 100644 index 000000000000..eb4a28543c74 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MissingExpr x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs b/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs new file mode 100644 index 000000000000..0a0f6ad7660e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_missing_expr() -> () { + // A missing expression, used as a placeholder for incomplete syntax. + // + let x = non_existing_macro!(); +} diff --git a/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.expected b/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.expected new file mode 100644 index 000000000000..10515823daae --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.expected @@ -0,0 +1 @@ +| gen_missing_pat.rs:6:9:6:10 | MissingPat | diff --git a/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.ql b/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.ql new file mode 100644 index 000000000000..ea33cd3b0820 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingPat/MissingPat.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MissingPat x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/MissingPat/gen_missing_pat.rs b/rust/ql/test/extractor-tests/generated/MissingPat/gen_missing_pat.rs new file mode 100644 index 000000000000..4a76319568a9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingPat/gen_missing_pat.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_missing_pat() -> () { + // A missing pattern, used as a place holder for incomplete syntax. + match Some(42) { + .. => "bad use of .. syntax", + }; +} diff --git a/rust/ql/test/extractor-tests/generated/Module/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/Module/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/Module/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/Module/Module.expected b/rust/ql/test/extractor-tests/generated/Module/Module.expected new file mode 100644 index 000000000000..7198e7b0f23f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Module/Module.expected @@ -0,0 +1,7 @@ +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 0 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 0 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 0 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 1 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 2 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 2 | +| file://:0:0:0:0 | Module | getNumberOfDeclarations: | 2 | diff --git a/rust/ql/test/extractor-tests/generated/Module/Module.ql b/rust/ql/test/extractor-tests/generated/Module/Module.ql new file mode 100644 index 000000000000..bb7a1eece17b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Module/Module.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from Module x, int getNumberOfDeclarations +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfDeclarations = x.getNumberOfDeclarations() +select x, "getNumberOfDeclarations:", getNumberOfDeclarations diff --git a/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.expected b/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.expected new file mode 100644 index 000000000000..1441501f34e4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.expected @@ -0,0 +1,7 @@ +| file://:0:0:0:0 | Module | 0 | file://:0:0:0:0 | UnimplementedDeclaration | +| file://:0:0:0:0 | Module | 0 | file://:0:0:0:0 | UnimplementedDeclaration | +| file://:0:0:0:0 | Module | 0 | file://:0:0:0:0 | UnimplementedDeclaration | +| file://:0:0:0:0 | Module | 0 | gen_module.rs:6:5:6:19 | baz | +| file://:0:0:0:0 | Module | 1 | file://:0:0:0:0 | UnimplementedDeclaration | +| file://:0:0:0:0 | Module | 1 | file://:0:0:0:0 | UnimplementedDeclaration | +| file://:0:0:0:0 | Module | 1 | file://:0:0:0:0 | UnimplementedDeclaration | diff --git a/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.ql b/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.ql new file mode 100644 index 000000000000..f531c0184958 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Module/Module_getDeclaration.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from Module x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getDeclaration(index) diff --git a/rust/ql/test/extractor-tests/generated/Module/gen_module.rs b/rust/ql/test/extractor-tests/generated/Module/gen_module.rs new file mode 100644 index 000000000000..d7d84ee47725 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Module/gen_module.rs @@ -0,0 +1,7 @@ +// generated by codegen + +// A module declaration. For example: +mod foo; +mod bar { + pub fn baz() {} +} diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.expected b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.expected new file mode 100644 index 000000000000..e28c61da351d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.expected @@ -0,0 +1 @@ +| gen_offset_of_expr.rs:5:5:5:38 | OffsetOfExpr | getContainer: | file://:0:0:0:0 | TypeRef | getNumberOfFields: | 1 | diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.ql b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.ql new file mode 100644 index 000000000000..7eed7c6530b2 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from OffsetOfExpr x, TypeRef getContainer, int getNumberOfFields +where + toBeTested(x) and + not x.isUnknown() and + getContainer = x.getContainer() and + getNumberOfFields = x.getNumberOfFields() +select x, "getContainer:", getContainer, "getNumberOfFields:", getNumberOfFields diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.expected b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.expected new file mode 100644 index 000000000000..5aac2799dab6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.expected @@ -0,0 +1 @@ +| gen_offset_of_expr.rs:5:5:5:38 | OffsetOfExpr | 0 | field | diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.ql b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.ql new file mode 100644 index 000000000000..d38d99bbd742 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/OffsetOfExpr_getField.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from OffsetOfExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getField(index) diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/gen_offset_of_expr.rs b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/gen_offset_of_expr.rs new file mode 100644 index 000000000000..497aebeb2ad7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/gen_offset_of_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_offset_of_expr() -> () { + // An `offset_of` expression. For example: + builtin # offset_of(Struct, field); +} diff --git a/rust/ql/test/extractor-tests/generated/OrPat/OrPat.expected b/rust/ql/test/extractor-tests/generated/OrPat/OrPat.expected new file mode 100644 index 000000000000..bca61721ca45 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OrPat/OrPat.expected @@ -0,0 +1 @@ +| gen_or_pat.rs:6:9:6:38 | OrPat | getNumberOfArgs: | 2 | diff --git a/rust/ql/test/extractor-tests/generated/OrPat/OrPat.ql b/rust/ql/test/extractor-tests/generated/OrPat/OrPat.ql new file mode 100644 index 000000000000..f2b5bcae611b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OrPat/OrPat.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from OrPat x, int getNumberOfArgs +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfArgs = x.getNumberOfArgs() +select x, "getNumberOfArgs:", getNumberOfArgs diff --git a/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.expected b/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.expected new file mode 100644 index 000000000000..a701548b2345 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.expected @@ -0,0 +1,2 @@ +| gen_or_pat.rs:6:9:6:38 | OrPat | 0 | gen_or_pat.rs:6:9:6:23 | TupleStructPat | +| gen_or_pat.rs:6:9:6:38 | OrPat | 1 | gen_or_pat.rs:6:27:6:38 | PathPat | diff --git a/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.ql b/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.ql new file mode 100644 index 000000000000..24a924c8042a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OrPat/OrPat_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from OrPat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/OrPat/gen_or_pat.rs b/rust/ql/test/extractor-tests/generated/OrPat/gen_or_pat.rs new file mode 100644 index 000000000000..2ad139d6e374 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OrPat/gen_or_pat.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_or_pat() -> () { + // An or pattern. For example: + match x { + Option::Some(y) | Option::None => 0, + } +} diff --git a/rust/ql/test/extractor-tests/generated/Pat/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/Pat/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/Pat/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/Path/Path.expected b/rust/ql/test/extractor-tests/generated/Path/Path.expected new file mode 100644 index 000000000000..3e0c5eb3e26e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Path/Path.expected @@ -0,0 +1 @@ +| gen_path.rs:5:5:5:12 | Path | diff --git a/rust/ql/test/extractor-tests/generated/Path/Path.ql b/rust/ql/test/extractor-tests/generated/Path/Path.ql new file mode 100644 index 000000000000..ed36a54c785a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Path/Path.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from Path x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/Path/gen_path.rs b/rust/ql/test/extractor-tests/generated/Path/gen_path.rs new file mode 100644 index 000000000000..86cd3eec067a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/Path/gen_path.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_path() -> () { + // A path. For example: + foo::bar; +} diff --git a/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.expected b/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.expected new file mode 100644 index 000000000000..7f24b432aa23 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.expected @@ -0,0 +1,4 @@ +| gen_path_expr.rs:5:13:5:20 | PathExpr | getPath: | gen_path_expr.rs:5:13:5:20 | Path | +| gen_path_expr.rs:6:13:6:20 | PathExpr | getPath: | gen_path_expr.rs:6:13:6:20 | Path | +| gen_path_expr.rs:7:13:7:20 | PathExpr | getPath: | gen_path_expr.rs:7:13:7:20 | Path | +| gen_path_expr.rs:8:13:8:35 | PathExpr | getPath: | gen_path_expr.rs:8:13:8:35 | Path | diff --git a/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.ql b/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.ql new file mode 100644 index 000000000000..064dbdea51a3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathExpr/PathExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from PathExpr x, Path getPath +where + toBeTested(x) and + not x.isUnknown() and + getPath = x.getPath() +select x, "getPath:", getPath diff --git a/rust/ql/test/extractor-tests/generated/PathExpr/gen_path_expr.rs b/rust/ql/test/extractor-tests/generated/PathExpr/gen_path_expr.rs new file mode 100644 index 000000000000..6ccbd7f80e58 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathExpr/gen_path_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_path_expr() -> () { + // A path expression. For example: + let x = variable; + let x = foo::bar; + let y = ::foo; + let z = ::foo; +} diff --git a/rust/ql/test/extractor-tests/generated/PathPat/PathPat.expected b/rust/ql/test/extractor-tests/generated/PathPat/PathPat.expected new file mode 100644 index 000000000000..38e42ebfcf2f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathPat/PathPat.expected @@ -0,0 +1 @@ +| gen_path_pat.rs:6:9:6:16 | PathPat | getPath: | gen_path_pat.rs:6:9:6:16 | Path | diff --git a/rust/ql/test/extractor-tests/generated/PathPat/PathPat.ql b/rust/ql/test/extractor-tests/generated/PathPat/PathPat.ql new file mode 100644 index 000000000000..35179c13ae24 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathPat/PathPat.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from PathPat x, Path getPath +where + toBeTested(x) and + not x.isUnknown() and + getPath = x.getPath() +select x, "getPath:", getPath diff --git a/rust/ql/test/extractor-tests/generated/PathPat/gen_path_pat.rs b/rust/ql/test/extractor-tests/generated/PathPat/gen_path_pat.rs new file mode 100644 index 000000000000..5b61631593d0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathPat/gen_path_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_path_pat() -> () { + // A path pattern. For example: + match x { + Foo::Bar => "ok", + _ => "fail", + } +} diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.expected b/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.expected new file mode 100644 index 000000000000..151eb7e17453 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.expected @@ -0,0 +1,3 @@ +| gen_prefix_expr.rs:5:13:5:15 | PrefixExpr | getExpr: | gen_prefix_expr.rs:5:14:5:15 | LiteralExpr | getOp: | - | +| gen_prefix_expr.rs:6:13:6:17 | PrefixExpr | getExpr: | gen_prefix_expr.rs:6:14:6:17 | LiteralExpr | getOp: | ! | +| gen_prefix_expr.rs:7:13:7:16 | PrefixExpr | getExpr: | gen_prefix_expr.rs:7:14:7:16 | PathExpr | getOp: | * | diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql b/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql new file mode 100644 index 000000000000..ad665f2edb8d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from PrefixExpr x, Expr getExpr, string getOp +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + getOp = x.getOp() +select x, "getExpr:", getExpr, "getOp:", getOp diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs b/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs new file mode 100644 index 000000000000..3f09b6ba9e6b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_prefix_expr() -> () { + // A unary operation expression. For example: + let x = -42 + let y = !true + let z = *ptr +} diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.expected b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.expected new file mode 100644 index 000000000000..12e7e47c757e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.expected @@ -0,0 +1,6 @@ +| gen_range_expr.rs:5:13:5:18 | RangeExpr | hasLhs: | yes | hasRhs: | yes | isInclusive: | yes | +| gen_range_expr.rs:6:13:6:17 | RangeExpr | hasLhs: | yes | hasRhs: | yes | isInclusive: | no | +| gen_range_expr.rs:7:13:7:16 | RangeExpr | hasLhs: | yes | hasRhs: | no | isInclusive: | no | +| gen_range_expr.rs:8:13:8:16 | RangeExpr | hasLhs: | no | hasRhs: | yes | isInclusive: | no | +| gen_range_expr.rs:9:13:9:17 | RangeExpr | hasLhs: | no | hasRhs: | yes | isInclusive: | yes | +| gen_range_expr.rs:10:13:10:14 | RangeExpr | hasLhs: | no | hasRhs: | no | isInclusive: | no | diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.ql b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.ql new file mode 100644 index 000000000000..94d158792ded --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangeExpr x, string hasLhs, string hasRhs, string isInclusive +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasLhs() then hasLhs = "yes" else hasLhs = "no") and + (if x.hasRhs() then hasRhs = "yes" else hasRhs = "no") and + if x.isInclusive() then isInclusive = "yes" else isInclusive = "no" +select x, "hasLhs:", hasLhs, "hasRhs:", hasRhs, "isInclusive:", isInclusive diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.expected b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.expected new file mode 100644 index 000000000000..f88c18b39c2d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.expected @@ -0,0 +1,3 @@ +| gen_range_expr.rs:5:13:5:18 | RangeExpr | gen_range_expr.rs:5:13:5:13 | LiteralExpr | +| gen_range_expr.rs:6:13:6:17 | RangeExpr | gen_range_expr.rs:6:13:6:13 | LiteralExpr | +| gen_range_expr.rs:7:13:7:16 | RangeExpr | gen_range_expr.rs:7:13:7:14 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.ql b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.ql new file mode 100644 index 000000000000..9b184651733f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getLhs.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangeExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLhs() diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.expected b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.expected new file mode 100644 index 000000000000..f596145bfc9d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.expected @@ -0,0 +1,4 @@ +| gen_range_expr.rs:5:13:5:18 | RangeExpr | gen_range_expr.rs:5:17:5:18 | LiteralExpr | +| gen_range_expr.rs:6:13:6:17 | RangeExpr | gen_range_expr.rs:6:16:6:17 | LiteralExpr | +| gen_range_expr.rs:8:13:8:16 | RangeExpr | gen_range_expr.rs:8:15:8:16 | LiteralExpr | +| gen_range_expr.rs:9:13:9:17 | RangeExpr | gen_range_expr.rs:9:16:9:17 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.ql b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.ql new file mode 100644 index 000000000000..ead566af537b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/RangeExpr_getRhs.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangeExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getRhs() diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/gen_range_expr.rs b/rust/ql/test/extractor-tests/generated/RangeExpr/gen_range_expr.rs new file mode 100644 index 000000000000..b27f504d81c7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/gen_range_expr.rs @@ -0,0 +1,11 @@ +// generated by codegen + +fn test_range_expr() -> () { + // A range expression. For example: + let x = 1..=10; + let x = 1..10; + let x = 10..; + let x = ..10; + let x = ..=10; + let x = ..; +} diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat.expected b/rust/ql/test/extractor-tests/generated/RangePat/RangePat.expected new file mode 100644 index 000000000000..51b3ecd3d685 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat.expected @@ -0,0 +1,3 @@ +| gen_range_pat.rs:6:9:6:12 | RangePat | hasStart: | no | hasEnd: | yes | +| gen_range_pat.rs:7:9:7:15 | RangePat | hasStart: | yes | hasEnd: | yes | +| gen_range_pat.rs:8:9:8:12 | RangePat | hasStart: | yes | hasEnd: | no | diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat.ql b/rust/ql/test/extractor-tests/generated/RangePat/RangePat.ql new file mode 100644 index 000000000000..d632e12ebe72 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangePat x, string hasStart, string hasEnd +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasStart() then hasStart = "yes" else hasStart = "no") and + if x.hasEnd() then hasEnd = "yes" else hasEnd = "no" +select x, "hasStart:", hasStart, "hasEnd:", hasEnd diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.expected b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.expected new file mode 100644 index 000000000000..bc0e1485b8c0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.expected @@ -0,0 +1,2 @@ +| gen_range_pat.rs:6:9:6:12 | RangePat | gen_range_pat.rs:6:9:6:12 | LiteralPat | +| gen_range_pat.rs:7:9:7:15 | RangePat | gen_range_pat.rs:7:9:7:15 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.ql b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.ql new file mode 100644 index 000000000000..1c9d984689e3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getEnd.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangePat x +where toBeTested(x) and not x.isUnknown() +select x, x.getEnd() diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.expected b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.expected new file mode 100644 index 000000000000..fe4a876680a3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.expected @@ -0,0 +1,2 @@ +| gen_range_pat.rs:7:9:7:15 | RangePat | gen_range_pat.rs:7:9:7:15 | LiteralPat | +| gen_range_pat.rs:8:9:8:12 | RangePat | gen_range_pat.rs:8:9:8:12 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.ql b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.ql new file mode 100644 index 000000000000..53ba8f8e770b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/RangePat_getStart.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RangePat x +where toBeTested(x) and not x.isUnknown() +select x, x.getStart() diff --git a/rust/ql/test/extractor-tests/generated/RangePat/gen_range_pat.rs b/rust/ql/test/extractor-tests/generated/RangePat/gen_range_pat.rs new file mode 100644 index 000000000000..21fecc5f2a9e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangePat/gen_range_pat.rs @@ -0,0 +1,10 @@ +// generated by codegen + +fn test_range_pat() -> () { + // A range pattern. For example: + match x { + ..15 => "too cold", + 16..=25 => "just right", + 26.. => "too hot", + } +} diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected new file mode 100644 index 000000000000..e5759d93ad86 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.expected @@ -0,0 +1,4 @@ +| gen_record_expr.rs:5:17:5:34 | RecordExpr | hasPath: | yes | getNumberOfFlds: | 2 | hasSpread: | no | hasEllipsis: | no | isAssigneeExpr: | no | +| gen_record_expr.rs:6:18:6:38 | RecordExpr | hasPath: | yes | getNumberOfFlds: | 1 | hasSpread: | yes | hasEllipsis: | yes | isAssigneeExpr: | no | +| gen_record_expr.rs:7:5:7:22 | RecordExpr | hasPath: | yes | getNumberOfFlds: | 2 | hasSpread: | no | hasEllipsis: | no | isAssigneeExpr: | yes | +| gen_record_expr.rs:8:5:8:14 | RecordExpr | hasPath: | yes | getNumberOfFlds: | 0 | hasSpread: | no | hasEllipsis: | yes | isAssigneeExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql new file mode 100644 index 000000000000..9b25e7667fa6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr.ql @@ -0,0 +1,17 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from + RecordExpr x, string hasPath, int getNumberOfFlds, string hasSpread, string hasEllipsis, + string isAssigneeExpr +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasPath() then hasPath = "yes" else hasPath = "no") and + getNumberOfFlds = x.getNumberOfFlds() and + (if x.hasSpread() then hasSpread = "yes" else hasSpread = "no") and + (if x.hasEllipsis() then hasEllipsis = "yes" else hasEllipsis = "no") and + if x.isAssigneeExpr() then isAssigneeExpr = "yes" else isAssigneeExpr = "no" +select x, "hasPath:", hasPath, "getNumberOfFlds:", getNumberOfFlds, "hasSpread:", hasSpread, + "hasEllipsis:", hasEllipsis, "isAssigneeExpr:", isAssigneeExpr diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.expected new file mode 100644 index 000000000000..f020086a8f77 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.expected @@ -0,0 +1,5 @@ +| gen_record_expr.rs:5:17:5:34 | RecordExpr | 0 | gen_record_expr.rs:5:26:5:26 | RecordExprField | +| gen_record_expr.rs:5:17:5:34 | RecordExpr | 1 | gen_record_expr.rs:5:32:5:32 | RecordExprField | +| gen_record_expr.rs:6:18:6:38 | RecordExpr | 0 | gen_record_expr.rs:6:27:6:27 | RecordExprField | +| gen_record_expr.rs:7:5:7:22 | RecordExpr | 0 | gen_record_expr.rs:7:14:7:14 | RecordExprField | +| gen_record_expr.rs:7:5:7:22 | RecordExpr | 1 | gen_record_expr.rs:7:20:7:20 | RecordExprField | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.ql new file mode 100644 index 000000000000..11bbad28dce2 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getFld.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getFld(index) diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.expected new file mode 100644 index 000000000000..e49dd014e305 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.expected @@ -0,0 +1,4 @@ +| gen_record_expr.rs:5:17:5:34 | RecordExpr | gen_record_expr.rs:5:17:5:34 | Path | +| gen_record_expr.rs:6:18:6:38 | RecordExpr | gen_record_expr.rs:6:18:6:38 | Path | +| gen_record_expr.rs:7:5:7:22 | RecordExpr | gen_record_expr.rs:7:5:7:22 | Path | +| gen_record_expr.rs:8:5:8:14 | RecordExpr | gen_record_expr.rs:8:5:8:14 | Path | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql new file mode 100644 index 000000000000..0204ff893a9c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getPath.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getPath() diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.expected b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.expected new file mode 100644 index 000000000000..ae380aa5d662 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.expected @@ -0,0 +1 @@ +| gen_record_expr.rs:6:18:6:38 | RecordExpr | gen_record_expr.rs:6:32:6:36 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.ql b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.ql new file mode 100644 index 000000000000..e5d206702d3d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/RecordExpr_getSpread.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getSpread() diff --git a/rust/ql/test/extractor-tests/generated/RecordExpr/gen_record_expr.rs b/rust/ql/test/extractor-tests/generated/RecordExpr/gen_record_expr.rs new file mode 100644 index 000000000000..2b42cce4f143 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExpr/gen_record_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_record_expr() -> () { + // A record expression. For example: + let first = Foo { a: 1, b: 2 }; + let second = Foo { a: 2, ..first }; + Foo { a: 1, b: 2 }[2] = 10; + Foo { .. } = second; +} diff --git a/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.expected b/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.expected new file mode 100644 index 000000000000..10165f69cfda --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.expected @@ -0,0 +1,2 @@ +| gen_record_expr_field.rs:5:14:5:14 | RecordExprField | getName: | a | getExpr: | gen_record_expr_field.rs:5:14:5:14 | LiteralExpr | +| gen_record_expr_field.rs:5:20:5:20 | RecordExprField | getName: | b | getExpr: | gen_record_expr_field.rs:5:20:5:20 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.ql b/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.ql new file mode 100644 index 000000000000..5e146165097a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExprField/RecordExprField.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordExprField x, string getName, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getName = x.getName() and + getExpr = x.getExpr() +select x, "getName:", getName, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/RecordExprField/gen_record_expr_field.rs b/rust/ql/test/extractor-tests/generated/RecordExprField/gen_record_expr_field.rs new file mode 100644 index 000000000000..8d9835f0b6f7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordExprField/gen_record_expr_field.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_record_expr_field() -> () { + // A field in a record expression. For example `a: 1` in: + Foo { a: 1, b: 2 }; +} diff --git a/rust/ql/test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected new file mode 100644 index 000000000000..c6abe134f671 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.expected @@ -0,0 +1,2 @@ +| gen_record_pat.rs:6:9:6:26 | RecordPat | hasPath: | yes | getNumberOfFlds: | 2 | hasEllipsis: | no | +| gen_record_pat.rs:7:9:7:18 | RecordPat | hasPath: | yes | getNumberOfFlds: | 0 | hasEllipsis: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql new file mode 100644 index 000000000000..67b13d341c51 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordPat x, string hasPath, int getNumberOfFlds, string hasEllipsis +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasPath() then hasPath = "yes" else hasPath = "no") and + getNumberOfFlds = x.getNumberOfFlds() and + if x.hasEllipsis() then hasEllipsis = "yes" else hasEllipsis = "no" +select x, "hasPath:", hasPath, "getNumberOfFlds:", getNumberOfFlds, "hasEllipsis:", hasEllipsis diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.expected new file mode 100644 index 000000000000..d99c027de911 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.expected @@ -0,0 +1,2 @@ +| gen_record_pat.rs:6:9:6:26 | RecordPat | 0 | gen_record_pat.rs:6:18:6:18 | RecordPatField | +| gen_record_pat.rs:6:9:6:26 | RecordPat | 1 | gen_record_pat.rs:6:24:6:24 | RecordPatField | diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.ql new file mode 100644 index 000000000000..fba9c8350688 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getFld.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordPat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getFld(index) diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.expected b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.expected new file mode 100644 index 000000000000..0dfc1cf99cb7 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.expected @@ -0,0 +1,2 @@ +| gen_record_pat.rs:6:9:6:26 | RecordPat | gen_record_pat.rs:6:9:6:26 | Path | +| gen_record_pat.rs:7:9:7:18 | RecordPat | gen_record_pat.rs:7:9:7:18 | Path | diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql new file mode 100644 index 000000000000..20e4befd2237 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/RecordPat_getPath.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getPath() diff --git a/rust/ql/test/extractor-tests/generated/RecordPat/gen_record_pat.rs b/rust/ql/test/extractor-tests/generated/RecordPat/gen_record_pat.rs new file mode 100644 index 000000000000..161d8e46c8c4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPat/gen_record_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_record_pat() -> () { + // A record pattern. For example: + match x { + Foo { a: 1, b: 2 } => "ok", + Foo { .. } => "fail", + } +} diff --git a/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.expected b/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.expected new file mode 100644 index 000000000000..8941bd466d36 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.expected @@ -0,0 +1,2 @@ +| gen_record_pat_field.rs:5:18:5:18 | RecordPatField | getName: | a | getPat: | gen_record_pat_field.rs:5:18:5:18 | LiteralPat | +| gen_record_pat_field.rs:5:24:5:24 | RecordPatField | getName: | b | getPat: | gen_record_pat_field.rs:5:24:5:24 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.ql b/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.ql new file mode 100644 index 000000000000..370c86386914 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPatField/RecordPatField.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RecordPatField x, string getName, Pat getPat +where + toBeTested(x) and + not x.isUnknown() and + getName = x.getName() and + getPat = x.getPat() +select x, "getName:", getName, "getPat:", getPat diff --git a/rust/ql/test/extractor-tests/generated/RecordPatField/gen_record_pat_field.rs b/rust/ql/test/extractor-tests/generated/RecordPatField/gen_record_pat_field.rs new file mode 100644 index 000000000000..77e7ca88985e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordPatField/gen_record_pat_field.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_record_pat_field() -> () { + // A field in a record pattern. For example `a: 1` in: + let Foo { a: 1, b: 2 } = foo; +} diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected new file mode 100644 index 000000000000..b2b75ae61e14 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected @@ -0,0 +1,4 @@ +| gen_ref_expr.rs:5:25:5:28 | RefExpr | getExpr: | gen_ref_expr.rs:5:26:5:28 | PathExpr | isRaw: | no | isMut: | no | +| gen_ref_expr.rs:6:23:6:30 | RefExpr | getExpr: | gen_ref_expr.rs:6:28:6:30 | PathExpr | isRaw: | no | isMut: | yes | +| gen_ref_expr.rs:7:35:7:48 | RefExpr | getExpr: | gen_ref_expr.rs:7:46:7:48 | PathExpr | isRaw: | yes | isMut: | no | +| gen_ref_expr.rs:8:33:8:44 | RefExpr | getExpr: | gen_ref_expr.rs:8:42:8:44 | PathExpr | isRaw: | yes | isMut: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql new file mode 100644 index 000000000000..e69683486ddb --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RefExpr x, Expr getExpr, string isRaw, string isMut +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() and + (if x.isRaw() then isRaw = "yes" else isRaw = "no") and + if x.isMut() then isMut = "yes" else isMut = "no" +select x, "getExpr:", getExpr, "isRaw:", isRaw, "isMut:", isMut diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/gen_ref_expr.rs b/rust/ql/test/extractor-tests/generated/RefExpr/gen_ref_expr.rs new file mode 100644 index 000000000000..551b957cc65c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefExpr/gen_ref_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_ref_expr() -> () { + // A reference expression. For example: + let ref_const = &foo; + let ref_mut = &mut foo; + let raw_const: &mut i32 = &raw const foo; + let raw_mut: &mut i32 = &raw mut foo; +} diff --git a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected new file mode 100644 index 000000000000..095e9af1d6f0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected @@ -0,0 +1,2 @@ +| gen_ref_pat.rs:6:9:6:28 | RefPat | getPat: | gen_ref_pat.rs:6:14:6:28 | TupleStructPat | isMut: | yes | +| gen_ref_pat.rs:7:9:7:21 | RefPat | getPat: | gen_ref_pat.rs:7:10:7:21 | PathPat | isMut: | no | diff --git a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql new file mode 100644 index 000000000000..cceccf2e689e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RefPat x, Pat getPat, string isMut +where + toBeTested(x) and + not x.isUnknown() and + getPat = x.getPat() and + if x.isMut() then isMut = "yes" else isMut = "no" +select x, "getPat:", getPat, "isMut:", isMut diff --git a/rust/ql/test/extractor-tests/generated/RefPat/gen_ref_pat.rs b/rust/ql/test/extractor-tests/generated/RefPat/gen_ref_pat.rs new file mode 100644 index 000000000000..cf5d7375b06f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefPat/gen_ref_pat.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_ref_pat() -> () { + // A reference pattern. For example: + match x { + &mut Option::Some(y) => y, + &Option::None => 0, + }; +} diff --git a/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.expected b/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.expected new file mode 100644 index 000000000000..370729af71d0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.expected @@ -0,0 +1 @@ +| gen_repeat_expr.rs:5:5:5:11 | RepeatExpr | getInitializer: | gen_repeat_expr.rs:5:6:5:6 | LiteralExpr | getRepeat: | gen_repeat_expr.rs:5:9:5:10 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.ql b/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.ql new file mode 100644 index 000000000000..aa1534fae462 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RepeatExpr/RepeatExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from RepeatExpr x, Expr getInitializer, Expr getRepeat +where + toBeTested(x) and + not x.isUnknown() and + getInitializer = x.getInitializer() and + getRepeat = x.getRepeat() +select x, "getInitializer:", getInitializer, "getRepeat:", getRepeat diff --git a/rust/ql/test/extractor-tests/generated/RepeatExpr/gen_repeat_expr.rs b/rust/ql/test/extractor-tests/generated/RepeatExpr/gen_repeat_expr.rs new file mode 100644 index 000000000000..822902f60d1f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RepeatExpr/gen_repeat_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_repeat_expr() -> () { + // A repeat expression. For example: + [1; 10]; +} diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.expected b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.expected new file mode 100644 index 000000000000..d715c0cb6641 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.expected @@ -0,0 +1,2 @@ +| gen_return_expr.rs:5:5:5:13 | ReturnExpr | hasExpr: | yes | +| gen_return_expr.rs:8:5:8:10 | ReturnExpr | hasExpr: | no | diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql new file mode 100644 index 000000000000..fab38b3b8ad5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ReturnExpr x, string hasExpr +where + toBeTested(x) and + not x.isUnknown() and + if x.hasExpr() then hasExpr = "yes" else hasExpr = "no" +select x, "hasExpr:", hasExpr diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.expected new file mode 100644 index 000000000000..4247069ccc25 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.expected @@ -0,0 +1 @@ +| gen_return_expr.rs:5:5:5:13 | ReturnExpr | gen_return_expr.rs:5:12:5:13 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql new file mode 100644 index 000000000000..f93fa9c35231 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ReturnExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getExpr() diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/gen_return_expr.rs b/rust/ql/test/extractor-tests/generated/ReturnExpr/gen_return_expr.rs new file mode 100644 index 000000000000..8e72e8324f87 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/gen_return_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +// A return expression. For example: +fn some_value() -> i32 { + return 42; +} +fn no_value() -> () { + return; +} diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.expected b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.expected new file mode 100644 index 000000000000..96aa9c9cb287 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.expected @@ -0,0 +1,3 @@ +| gen_slice_pat.rs:6:9:6:23 | SlicePat | getNumberOfPrefixes: | 5 | hasSlice: | no | getNumberOfSuffixes: | 0 | +| gen_slice_pat.rs:7:9:7:18 | SlicePat | getNumberOfPrefixes: | 2 | hasSlice: | yes | getNumberOfSuffixes: | 0 | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | getNumberOfPrefixes: | 2 | hasSlice: | yes | getNumberOfSuffixes: | 2 | diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.ql b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.ql new file mode 100644 index 000000000000..3e3441a18f9a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat.ql @@ -0,0 +1,13 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from SlicePat x, int getNumberOfPrefixes, string hasSlice, int getNumberOfSuffixes +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfPrefixes = x.getNumberOfPrefixes() and + (if x.hasSlice() then hasSlice = "yes" else hasSlice = "no") and + getNumberOfSuffixes = x.getNumberOfSuffixes() +select x, "getNumberOfPrefixes:", getNumberOfPrefixes, "hasSlice:", hasSlice, + "getNumberOfSuffixes:", getNumberOfSuffixes diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.expected b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.expected new file mode 100644 index 000000000000..763ef8783b4e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.expected @@ -0,0 +1,9 @@ +| gen_slice_pat.rs:6:9:6:23 | SlicePat | 0 | gen_slice_pat.rs:6:10:6:10 | LiteralPat | +| gen_slice_pat.rs:6:9:6:23 | SlicePat | 1 | gen_slice_pat.rs:6:13:6:13 | LiteralPat | +| gen_slice_pat.rs:6:9:6:23 | SlicePat | 2 | gen_slice_pat.rs:6:16:6:16 | LiteralPat | +| gen_slice_pat.rs:6:9:6:23 | SlicePat | 3 | gen_slice_pat.rs:6:19:6:19 | LiteralPat | +| gen_slice_pat.rs:6:9:6:23 | SlicePat | 4 | gen_slice_pat.rs:6:22:6:22 | LiteralPat | +| gen_slice_pat.rs:7:9:7:18 | SlicePat | 0 | gen_slice_pat.rs:7:10:7:10 | LiteralPat | +| gen_slice_pat.rs:7:9:7:18 | SlicePat | 1 | gen_slice_pat.rs:7:13:7:13 | LiteralPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 0 | gen_slice_pat.rs:8:10:8:10 | IdentPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 1 | gen_slice_pat.rs:8:13:8:13 | IdentPat | diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.ql b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.ql new file mode 100644 index 000000000000..ecb98e1821c8 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getPrefix.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from SlicePat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getPrefix(index) diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.expected b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.expected new file mode 100644 index 000000000000..1e0f4586250f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.expected @@ -0,0 +1,2 @@ +| gen_slice_pat.rs:7:9:7:18 | SlicePat | gen_slice_pat.rs:7:16:7:17 | MissingPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | gen_slice_pat.rs:8:16:8:17 | MissingPat | diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.ql b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.ql new file mode 100644 index 000000000000..d7cb38f27601 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSlice.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from SlicePat x +where toBeTested(x) and not x.isUnknown() +select x, x.getSlice() diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.expected b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.expected new file mode 100644 index 000000000000..a815226345a9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.expected @@ -0,0 +1,2 @@ +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 0 | gen_slice_pat.rs:8:20:8:20 | IdentPat | +| gen_slice_pat.rs:8:9:8:24 | SlicePat | 1 | gen_slice_pat.rs:8:23:8:23 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.ql b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.ql new file mode 100644 index 000000000000..fb3156272d3a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/SlicePat_getSuffix.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from SlicePat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getSuffix(index) diff --git a/rust/ql/test/extractor-tests/generated/SlicePat/gen_slice_pat.rs b/rust/ql/test/extractor-tests/generated/SlicePat/gen_slice_pat.rs new file mode 100644 index 000000000000..b2c155960d59 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/SlicePat/gen_slice_pat.rs @@ -0,0 +1,10 @@ +// generated by codegen + +fn test_slice_pat() -> () { + // A slice pattern. For example: + match x { + [1, 2, 3, 4, 5] => "ok", + [1, 2, ..] => "fail", + [x, y, .., z, 7] => "fail", + } +} diff --git a/rust/ql/test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.expected b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.expected new file mode 100644 index 000000000000..9522fe8750df --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.expected @@ -0,0 +1,2 @@ +| gen_tuple_expr.rs:5:5:5:14 | TupleExpr | getNumberOfExprs: | 2 | isAssigneeExpr: | no | +| gen_tuple_expr.rs:6:5:6:14 | TupleExpr | getNumberOfExprs: | 2 | isAssigneeExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.ql b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.ql new file mode 100644 index 000000000000..4f353568b7f1 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleExpr x, int getNumberOfExprs, string isAssigneeExpr +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfExprs = x.getNumberOfExprs() and + if x.isAssigneeExpr() then isAssigneeExpr = "yes" else isAssigneeExpr = "no" +select x, "getNumberOfExprs:", getNumberOfExprs, "isAssigneeExpr:", isAssigneeExpr diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.expected new file mode 100644 index 000000000000..936d2a39bb27 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.expected @@ -0,0 +1,4 @@ +| gen_tuple_expr.rs:5:5:5:14 | TupleExpr | 0 | gen_tuple_expr.rs:5:6:5:6 | LiteralExpr | +| gen_tuple_expr.rs:5:5:5:14 | TupleExpr | 1 | gen_tuple_expr.rs:5:9:5:13 | LiteralExpr | +| gen_tuple_expr.rs:6:5:6:14 | TupleExpr | 0 | gen_tuple_expr.rs:6:6:6:6 | LiteralExpr | +| gen_tuple_expr.rs:6:5:6:14 | TupleExpr | 1 | gen_tuple_expr.rs:6:9:6:13 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.ql b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.ql new file mode 100644 index 000000000000..00c8d589921e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/TupleExpr_getExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getExpr(index) diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/gen_tuple_expr.rs b/rust/ql/test/extractor-tests/generated/TupleExpr/gen_tuple_expr.rs new file mode 100644 index 000000000000..8cab6455b73c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/gen_tuple_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_tuple_expr() -> () { + // A tuple expression. For example: + (1, "one"); + (2, "two")[0] = 3; +} diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.expected b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.expected new file mode 100644 index 000000000000..393cbfdda381 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.expected @@ -0,0 +1,2 @@ +| gen_tuple_pat.rs:5:9:5:14 | TuplePat | getNumberOfArgs: | 2 | hasEllipsisIndex: | no | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | getNumberOfArgs: | 3 | hasEllipsisIndex: | yes | diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.ql b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.ql new file mode 100644 index 000000000000..97f1df0380e6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TuplePat x, int getNumberOfArgs, string hasEllipsisIndex +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfArgs = x.getNumberOfArgs() and + if x.hasEllipsisIndex() then hasEllipsisIndex = "yes" else hasEllipsisIndex = "no" +select x, "getNumberOfArgs:", getNumberOfArgs, "hasEllipsisIndex:", hasEllipsisIndex diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.expected b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.expected new file mode 100644 index 000000000000..993b348b4ee9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.expected @@ -0,0 +1,5 @@ +| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 0 | gen_tuple_pat.rs:5:10:5:10 | IdentPat | +| gen_tuple_pat.rs:5:9:5:14 | TuplePat | 1 | gen_tuple_pat.rs:5:13:5:13 | IdentPat | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 0 | gen_tuple_pat.rs:6:10:6:10 | IdentPat | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 1 | gen_tuple_pat.rs:6:13:6:13 | IdentPat | +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 2 | gen_tuple_pat.rs:6:21:6:21 | IdentPat | diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.ql b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.ql new file mode 100644 index 000000000000..42ff250f76f0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TuplePat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.expected b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.expected new file mode 100644 index 000000000000..7248cb17ab33 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.expected @@ -0,0 +1 @@ +| gen_tuple_pat.rs:6:9:6:22 | TuplePat | 2 | diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.ql b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.ql new file mode 100644 index 000000000000..2d621b9abb06 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/TuplePat_getEllipsisIndex.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TuplePat x +where toBeTested(x) and not x.isUnknown() +select x, x.getEllipsisIndex() diff --git a/rust/ql/test/extractor-tests/generated/TuplePat/gen_tuple_pat.rs b/rust/ql/test/extractor-tests/generated/TuplePat/gen_tuple_pat.rs new file mode 100644 index 000000000000..8bf0f63ebabc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TuplePat/gen_tuple_pat.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_tuple_pat() -> () { + // A tuple pattern. For example: + let (x, y) = (1, 2); + let (a, b, .., z) = (1, 2, 3, 4, 5); +} diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected new file mode 100644 index 000000000000..03ce4b8082d9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.expected @@ -0,0 +1,3 @@ +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | hasPath: | yes | getNumberOfArgs: | 4 | hasEllipsisIndex: | no | +| gen_tuple_struct_pat.rs:7:9:7:20 | TupleStructPat | hasPath: | yes | getNumberOfArgs: | 1 | hasEllipsisIndex: | yes | +| gen_tuple_struct_pat.rs:8:9:8:17 | TupleStructPat | hasPath: | yes | getNumberOfArgs: | 0 | hasEllipsisIndex: | yes | diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql new file mode 100644 index 000000000000..55c85f8b5545 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat.ql @@ -0,0 +1,13 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleStructPat x, string hasPath, int getNumberOfArgs, string hasEllipsisIndex +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasPath() then hasPath = "yes" else hasPath = "no") and + getNumberOfArgs = x.getNumberOfArgs() and + if x.hasEllipsisIndex() then hasEllipsisIndex = "yes" else hasEllipsisIndex = "no" +select x, "hasPath:", hasPath, "getNumberOfArgs:", getNumberOfArgs, "hasEllipsisIndex:", + hasEllipsisIndex diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.expected new file mode 100644 index 000000000000..2a1a163a5aad --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.expected @@ -0,0 +1,5 @@ +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | 0 | gen_tuple_struct_pat.rs:6:15:6:17 | LiteralPat | +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | 1 | gen_tuple_struct_pat.rs:6:20:6:20 | LiteralPat | +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | 2 | gen_tuple_struct_pat.rs:6:23:6:23 | LiteralPat | +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | 3 | gen_tuple_struct_pat.rs:6:26:6:26 | LiteralPat | +| gen_tuple_struct_pat.rs:7:9:7:20 | TupleStructPat | 0 | gen_tuple_struct_pat.rs:7:19:7:19 | LiteralPat | diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.ql new file mode 100644 index 000000000000..a453cce4e1cd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getArg.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleStructPat x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getArg(index) diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.expected new file mode 100644 index 000000000000..96cb3797a629 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.expected @@ -0,0 +1,2 @@ +| gen_tuple_struct_pat.rs:7:9:7:20 | TupleStructPat | 0 | +| gen_tuple_struct_pat.rs:8:9:8:17 | TupleStructPat | 0 | diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.ql new file mode 100644 index 000000000000..51c3064f6205 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getEllipsisIndex.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleStructPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getEllipsisIndex() diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.expected b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.expected new file mode 100644 index 000000000000..de7f0f1ffe06 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.expected @@ -0,0 +1,3 @@ +| gen_tuple_struct_pat.rs:6:9:6:27 | TupleStructPat | gen_tuple_struct_pat.rs:6:9:6:27 | Path | +| gen_tuple_struct_pat.rs:7:9:7:20 | TupleStructPat | gen_tuple_struct_pat.rs:7:9:7:20 | Path | +| gen_tuple_struct_pat.rs:8:9:8:17 | TupleStructPat | gen_tuple_struct_pat.rs:8:9:8:17 | Path | diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql new file mode 100644 index 000000000000..2dd64f448806 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TupleStructPat x +where toBeTested(x) and not x.isUnknown() +select x, x.getPath() diff --git a/rust/ql/test/extractor-tests/generated/TupleStructPat/gen_tuple_struct_pat.rs b/rust/ql/test/extractor-tests/generated/TupleStructPat/gen_tuple_struct_pat.rs new file mode 100644 index 000000000000..6407217b7f01 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleStructPat/gen_tuple_struct_pat.rs @@ -0,0 +1,10 @@ +// generated by codegen + +fn test_tuple_struct_pat() -> () { + // A tuple struct pattern. For example: + match x { + Tuple("a", 1, 2, 3) => "great", + Tuple(.., 3) => "fine", + Tuple(..) => "fail", + }; +} diff --git a/rust/ql/test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt deleted file mode 100644 index 9cb54ddd059e..000000000000 --- a/rust/ql/test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt +++ /dev/null @@ -1,4 +0,0 @@ -// generated by codegen - -After a source file is added in this directory and codegen is run again, test queries -will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.expected b/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.expected new file mode 100644 index 000000000000..af51fa0b6032 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.expected @@ -0,0 +1,3 @@ +| file://:0:0:0:0 | TypeRef | +| file://:0:0:0:0 | TypeRef | +| file://:0:0:0:0 | TypeRef | diff --git a/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.ql b/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.ql new file mode 100644 index 000000000000..04748b7dd043 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TypeRef/TypeRef.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from TypeRef x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/TypeRef/gen_type_ref.rs b/rust/ql/test/extractor-tests/generated/TypeRef/gen_type_ref.rs new file mode 100644 index 000000000000..1077dc2b4f5f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TypeRef/gen_type_ref.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_type_ref() -> () { + // The base class for type references. + let x: i32; + let y: Vec; + let z: Option; +} diff --git a/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.expected b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.expected new file mode 100644 index 000000000000..b81aa1f81b08 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.expected @@ -0,0 +1 @@ +| gen_underscore_expr.rs:5:5:5:5 | UnderscoreExpr | diff --git a/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql new file mode 100644 index 000000000000..e65e78cc81fc --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/UnderscoreExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from UnderscoreExpr x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/UnderscoreExpr/gen_underscore_expr.rs b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/gen_underscore_expr.rs new file mode 100644 index 000000000000..51b480e84bec --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/gen_underscore_expr.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_underscore_expr() -> () { + // An underscore expression. For example: + _ = 42; +} diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.expected b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.expected new file mode 100644 index 000000000000..2fb952294e6e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.expected @@ -0,0 +1 @@ +| gen_unsafe_block_expr.rs:5:18:8:5 | UnsafeBlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.ql b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.ql new file mode 100644 index 000000000000..fe7906db5fa3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from UnsafeBlockExpr x, int getNumberOfStatements, string hasTail +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfStatements = x.getNumberOfStatements() and + if x.hasTail() then hasTail = "yes" else hasTail = "no" +select x, "getNumberOfStatements:", getNumberOfStatements, "hasTail:", hasTail diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.expected b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.expected new file mode 100644 index 000000000000..a9c91832300c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.expected @@ -0,0 +1 @@ +| gen_unsafe_block_expr.rs:5:18:8:5 | UnsafeBlockExpr | 0 | gen_unsafe_block_expr.rs:6:13:6:13 | LetStmt | diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.ql b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.ql new file mode 100644 index 000000000000..e813310cd46a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getStatement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from UnsafeBlockExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getStatement(index) diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.expected b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.expected new file mode 100644 index 000000000000..c0d12ae28a5b --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.expected @@ -0,0 +1 @@ +| gen_unsafe_block_expr.rs:5:18:8:5 | UnsafeBlockExpr | gen_unsafe_block_expr.rs:7:9:7:54 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.ql b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.ql new file mode 100644 index 000000000000..cce5b9284fcf --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/UnsafeBlockExpr_getTail.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from UnsafeBlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getTail() diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/gen_unsafe_block_expr.rs b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/gen_unsafe_block_expr.rs new file mode 100644 index 000000000000..6adf2190cdfa --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/gen_unsafe_block_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_unsafe_block_expr() -> () { + // An unsafe block expression. For example: + let layout = unsafe { + let x = 42; + Layout::from_size_align_unchecked(size, align) + }; +} diff --git a/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.expected b/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.expected new file mode 100644 index 000000000000..ceb155671b7f --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.expected @@ -0,0 +1 @@ +| gen_wildcard_pat.rs:5:9:5:9 | WildcardPat | diff --git a/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.ql b/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.ql new file mode 100644 index 000000000000..16a1e5936b4d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/WildcardPat/WildcardPat.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from WildcardPat x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/WildcardPat/gen_wildcard_pat.rs b/rust/ql/test/extractor-tests/generated/WildcardPat/gen_wildcard_pat.rs new file mode 100644 index 000000000000..97377808a6d6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/WildcardPat/gen_wildcard_pat.rs @@ -0,0 +1,6 @@ +// generated by codegen + +fn test_wildcard_pat() -> () { + // A wildcard pattern. For example: + let _ = 42; +} diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.expected b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.expected new file mode 100644 index 000000000000..bda4e84abfd9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.expected @@ -0,0 +1 @@ +| gen_yeet_expr.rs:6:8:6:36 | YeetExpr | hasExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.ql b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.ql new file mode 100644 index 000000000000..0f99cbc0c3f1 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from YeetExpr x, string hasExpr +where + toBeTested(x) and + not x.isUnknown() and + if x.hasExpr() then hasExpr = "yes" else hasExpr = "no" +select x, "hasExpr:", hasExpr diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.expected new file mode 100644 index 000000000000..074c6fbff74c --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.expected @@ -0,0 +1 @@ +| gen_yeet_expr.rs:6:8:6:36 | YeetExpr | gen_yeet_expr.rs:6:16:6:36 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.ql b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.ql new file mode 100644 index 000000000000..526ac38ba1da --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/YeetExpr_getExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from YeetExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getExpr() diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/gen_yeet_expr.rs b/rust/ql/test/extractor-tests/generated/YeetExpr/gen_yeet_expr.rs new file mode 100644 index 000000000000..877710805c31 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/gen_yeet_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_yeet_expr() -> () { + // A `yeet` expression. For example: + if x < size { + do yeet "index out of bounds"; + } +} diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.expected b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.expected new file mode 100644 index 000000000000..e897a88bb240 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.expected @@ -0,0 +1 @@ +| gen_yield_expr.rs:7:13:7:19 | YieldExpr | hasExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.ql b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.ql new file mode 100644 index 000000000000..18fd38bac9c6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from YieldExpr x, string hasExpr +where + toBeTested(x) and + not x.isUnknown() and + if x.hasExpr() then hasExpr = "yes" else hasExpr = "no" +select x, "hasExpr:", hasExpr diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.expected new file mode 100644 index 000000000000..87b88ef24196 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.expected @@ -0,0 +1 @@ +| gen_yield_expr.rs:7:13:7:19 | YieldExpr | gen_yield_expr.rs:7:19:7:19 | LiteralExpr | diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.ql b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.ql new file mode 100644 index 000000000000..8bba6eb87e95 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/YieldExpr_getExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from YieldExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getExpr() diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/gen_yield_expr.rs b/rust/ql/test/extractor-tests/generated/YieldExpr/gen_yield_expr.rs new file mode 100644 index 000000000000..b6d951f7adf4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/gen_yield_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_yield_expr() -> () { + // A `yield` expression. For example: + let one = #[coroutine] + || { + yield 1; + }; +} diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 57cbfe8c0011..6b660ee661f7 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -6,7 +6,7 @@ nodes | test.rs:1:18:7:1 | BlockExpr | semmle.order | 5 | | test.rs:2:5:6:5 | IfExpr | semmle.order | 6 | | test.rs:2:8:2:12 | LiteralExpr | semmle.order | 7 | -| test.rs:2:8:2:21 | BinaryOpExpr | semmle.order | 8 | +| test.rs:2:8:2:21 | BinaryExpr | semmle.order | 8 | | test.rs:2:17:2:21 | LiteralExpr | semmle.order | 9 | | test.rs:2:23:4:5 | BlockExpr | semmle.order | 10 | | test.rs:3:9:3:20 | CallExpr | semmle.order | 11 | @@ -21,13 +21,13 @@ nodes | test.rs:9:29:16:1 | BlockExpr | semmle.order | 20 | | test.rs:11:5:15:5 | IfExpr | semmle.order | 21 | | test.rs:11:8:11:8 | PathExpr | semmle.order | 22 | -| test.rs:11:8:11:13 | BinaryOpExpr | semmle.order | 23 | +| test.rs:11:8:11:13 | BinaryExpr | semmle.order | 23 | | test.rs:11:13:11:13 | LiteralExpr | semmle.order | 24 | | test.rs:11:15:13:5 | BlockExpr | semmle.order | 25 | | test.rs:12:9:12:9 | LiteralExpr | semmle.order | 26 | | test.rs:13:12:15:5 | BlockExpr | semmle.order | 27 | | test.rs:14:9:14:9 | PathExpr | semmle.order | 28 | -| test.rs:14:9:14:13 | BinaryOpExpr | semmle.order | 29 | +| test.rs:14:9:14:13 | BinaryExpr | semmle.order | 29 | | test.rs:14:13:14:13 | LiteralExpr | semmle.order | 30 | edges | test.rs:1:1:7:1 | enter main | test.rs:2:8:2:12 | LiteralExpr | semmle.label | | @@ -42,12 +42,12 @@ edges | test.rs:2:5:6:5 | IfExpr | test.rs:1:18:7:1 | BlockExpr | semmle.order | 1 | | test.rs:2:8:2:12 | LiteralExpr | test.rs:2:17:2:21 | LiteralExpr | semmle.label | | | test.rs:2:8:2:12 | LiteralExpr | test.rs:2:17:2:21 | LiteralExpr | semmle.order | 1 | -| test.rs:2:8:2:21 | BinaryOpExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.label | true | -| test.rs:2:8:2:21 | BinaryOpExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.order | 1 | -| test.rs:2:8:2:21 | BinaryOpExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.label | false | -| test.rs:2:8:2:21 | BinaryOpExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.order | 2 | -| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryOpExpr | semmle.label | | -| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryOpExpr | semmle.order | 1 | +| test.rs:2:8:2:21 | BinaryExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.label | true | +| test.rs:2:8:2:21 | BinaryExpr | test.rs:3:19:3:19 | LiteralExpr | semmle.order | 1 | +| test.rs:2:8:2:21 | BinaryExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.label | false | +| test.rs:2:8:2:21 | BinaryExpr | test.rs:5:19:5:19 | LiteralExpr | semmle.order | 2 | +| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryExpr | semmle.label | | +| test.rs:2:17:2:21 | LiteralExpr | test.rs:2:8:2:21 | BinaryExpr | semmle.order | 1 | | test.rs:2:23:4:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.label | | | test.rs:2:23:4:5 | BlockExpr | test.rs:2:5:6:5 | IfExpr | semmle.order | 1 | | test.rs:3:9:3:20 | CallExpr | test.rs:2:23:4:5 | BlockExpr | semmle.label | | @@ -72,12 +72,12 @@ edges | test.rs:11:5:15:5 | IfExpr | test.rs:9:29:16:1 | BlockExpr | semmle.order | 1 | | test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | LiteralExpr | semmle.label | | | test.rs:11:8:11:8 | PathExpr | test.rs:11:13:11:13 | LiteralExpr | semmle.order | 1 | -| test.rs:11:8:11:13 | BinaryOpExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.label | true | -| test.rs:11:8:11:13 | BinaryOpExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.order | 1 | -| test.rs:11:8:11:13 | BinaryOpExpr | test.rs:14:9:14:9 | PathExpr | semmle.label | false | -| test.rs:11:8:11:13 | BinaryOpExpr | test.rs:14:9:14:9 | PathExpr | semmle.order | 2 | -| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryOpExpr | semmle.label | | -| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryOpExpr | semmle.order | 1 | +| test.rs:11:8:11:13 | BinaryExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.label | true | +| test.rs:11:8:11:13 | BinaryExpr | test.rs:12:9:12:9 | LiteralExpr | semmle.order | 1 | +| test.rs:11:8:11:13 | BinaryExpr | test.rs:14:9:14:9 | PathExpr | semmle.label | false | +| test.rs:11:8:11:13 | BinaryExpr | test.rs:14:9:14:9 | PathExpr | semmle.order | 2 | +| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryExpr | semmle.label | | +| test.rs:11:13:11:13 | LiteralExpr | test.rs:11:8:11:13 | BinaryExpr | semmle.order | 1 | | test.rs:11:15:13:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.label | | | test.rs:11:15:13:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.order | 1 | | test.rs:12:9:12:9 | LiteralExpr | test.rs:11:15:13:5 | BlockExpr | semmle.label | | @@ -86,7 +86,7 @@ edges | test.rs:13:12:15:5 | BlockExpr | test.rs:11:5:15:5 | IfExpr | semmle.order | 1 | | test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | LiteralExpr | semmle.label | | | test.rs:14:9:14:9 | PathExpr | test.rs:14:13:14:13 | LiteralExpr | semmle.order | 1 | -| test.rs:14:9:14:13 | BinaryOpExpr | test.rs:13:12:15:5 | BlockExpr | semmle.label | | -| test.rs:14:9:14:13 | BinaryOpExpr | test.rs:13:12:15:5 | BlockExpr | semmle.order | 1 | -| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryOpExpr | semmle.label | | -| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryOpExpr | semmle.order | 1 | +| test.rs:14:9:14:13 | BinaryExpr | test.rs:13:12:15:5 | BlockExpr | semmle.label | | +| test.rs:14:9:14:13 | BinaryExpr | test.rs:13:12:15:5 | BlockExpr | semmle.order | 1 | +| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryExpr | semmle.label | | +| test.rs:14:13:14:13 | LiteralExpr | test.rs:14:9:14:13 | BinaryExpr | semmle.order | 1 | diff --git a/rust/schema.py b/rust/schema.py index d9ea1ca19cb3..1924c530cfe1 100644 --- a/rust/schema.py +++ b/rust/schema.py @@ -24,48 +24,117 @@ class Element: class Locatable(Element): pass + @qltest.skip class AstNode(Locatable): pass @qltest.skip -class Unimplemented(AstNode): +class Unimplemented(Element): + """ + The base class for unimplemented nodes. This is used to mark nodes that are not yet extracted. + """ pass class Declaration(AstNode): + """ + The base class for declarations. + """ + pass + + +@qltest.skip +class UnimplementedDeclaration(Declaration, Unimplemented): + """ + A declaration that is not yet extracted. + """ pass class Module(Declaration): - # TODO name + """ + A module declaration. For example: + ``` + mod foo; + ``` + ``` + mod bar { + pub fn baz() {} + } + ``` + """ declarations: list[Declaration] | child -@qltest.collapse_hierarchy class Expr(AstNode): + """ + The base class for expressions. + """ pass -@qltest.collapse_hierarchy class Pat(AstNode): + """ + The base class for patterns. + """ pass -@qltest.skip +@rust.doc_test_signature("() -> ()") class Label(AstNode): + """ + A label. For example: + ``` + 'label: loop { + println!("Hello, world (once)!"); + break 'label; + }; + ``` + """ name: string -@qltest.collapse_hierarchy class Stmt(AstNode): + """ + The base class for statements. + """ + pass + + +@rust.doc_test_signature("() -> ()") +class TypeRef(AstNode, Unimplemented): + """ + The base class for type references. + ``` + let x: i32; + let y: Vec; + let z: Option; + ``` + """ pass -@qltest.collapse_hierarchy -class TypeRef(AstNode): - # TODO +@rust.doc_test_signature("() -> ()") +class Path(AstNode, Unimplemented): + """ + A path. For example: + ``` + foo::bar; + ``` + """ + pass + + +@rust.doc_test_signature("() -> ()") +class GenericArgList(AstNode, Unimplemented): + """ + The base class for generic arguments. + ``` + x.foo::(42); + ``` + """ pass @@ -73,7 +142,7 @@ class Function(Declaration): """ A function declaration. For example ``` - fn foo(x: u32) -> u64 { (x + 1).into() } + fn foo(x: u32) -> u64 {(x + 1).into()} ``` A function declaration within a trait might not have a body: ``` @@ -86,492 +155,886 @@ class Function(Declaration): body: Expr | child -# Missing, +@rust.doc_test_signature("() -> ()") class MissingExpr(Expr): - pass - + """ + A missing expression, used as a placeholder for incomplete syntax. -# Path(Path), + ``` + let x = non_existing_macro!(); + ``` + """ + pass +@rust.doc_test_signature("() -> ()") class PathExpr(Expr): - path: Unimplemented | child - -# If { -# condition: ExprId, -# then_branch: ExprId, -# else_branch: Option, -# }, + """ + A path expression. For example: + ``` + let x = variable; + let x = foo::bar; + let y = ::foo; + let z = ::foo; + ``` + """ + path: Path | child +@rust.doc_test_signature("() -> ()") class IfExpr(Expr): + """ + An `if` expression. For example: + ``` + if x == 42 { + println!("that's the answer"); + } + ``` + ``` + let y = if x > 0 { + 1 + } else { + 0 + } + ``` + """ condition: Expr | child then: Expr | child else_: optional[Expr] | child -# Let { -# pat: PatId, -# expr: ExprId, -# }, - +@rust.doc_test_signature("(maybe_some: Option) -> ()") class LetExpr(Expr): + """ + A `let` expression. For example: + ``` + if let Some(x) = maybe_some { + println!("{}", x); + } + ``` + """ pat: Pat | child expr: Expr | child -# Block { -# id: Option, -# statements: Box<[Stmt]>, -# tail: Option, -# label: Option, -# }, - class BlockExprBase(Expr): statements: list[Stmt] | child tail: optional[Expr] | child +@rust.doc_test_signature("() -> ()") class BlockExpr(BlockExprBase): + """ + A block expression. For example: + ``` + { + let x = 42; + } + ``` + ``` + 'label: { + let x = 42; + x + } + ``` + """ label: optional[Label] | child -# Async { -# id: Option, -# statements: Box<[Stmt]>, -# tail: Option, -# }, - +@rust.doc_test_signature("() -> i32") class AsyncBlockExpr(BlockExprBase): + """ + An async block expression. For example: + ``` + async { + let x = 42; + x + }.await + ``` + """ pass -# Const(ConstBlockId), - +@rust.doc_test_signature("() -> bool") class ConstExpr(Expr): + """ + A `const` block expression. For example: + ``` + if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + return false; + } + ``` + """ expr: Expr | child -# // FIXME: Fold this into Block with an unsafe flag? -# Unsafe { -# id: Option, -# statements: Box<[Stmt]>, -# tail: Option, -# }, - +@rust.doc_test_signature("() -> ()") class UnsafeBlockExpr(BlockExprBase): + """ + An unsafe block expression. For example: + ``` + let layout = unsafe { + let x = 42; + Layout::from_size_align_unchecked(size, align) + }; + ``` + """ pass -# Loop { -# body: ExprId, -# label: Option, -# }, - +@rust.doc_test_signature("() -> ()") class LoopExpr(Expr): + """ + A loop expression. For example: + ``` + loop { + println!("Hello, world (again)!"); + }; + ``` + ``` + 'label: loop { + println!("Hello, world (once)!"); + break 'label; + }; + ``` + ``` + let mut x = 0; + loop { + if x < 10 { + x += 1; + } else { + break; + } + }; + ``` + """ body: Expr | child label: optional[Label] | child -# Call { -# callee: ExprId, -# args: Box<[ExprId]>, -# is_assignee_expr: bool, -# }, - +@rust.doc_test_signature("() -> ()") class CallExpr(Expr): + """ + A function call expression. For example: + ``` + foo(42); + foo::(42); + foo[0](42); + foo(1) = 4; + ``` + """ callee: Expr | child args: list[Expr] | child is_assignee_expr: predicate -# MethodCall { -# receiver: ExprId, -# method_name: Name, -# args: Box<[ExprId]>, -# generic_args: Option>, -# }, - +@rust.doc_test_signature("() -> ()") class MethodCallExpr(Expr): + """ + A method call expression. For example: + ``` + x.foo(42); + x.foo::(42); + """ receiver: Expr | child method_name: string args: list[Expr] | child - generic_args: optional[Unimplemented] | child + generic_args: optional[GenericArgList] | child -# pub struct MatchArm { -# pub pat: PatId, -# pub guard: Option, -# pub expr: ExprId, -# } - -@qltest.skip +@rust.doc_test_signature("(x: i32) -> i32") class MatchArm(AstNode): + """ + A match arm. For example: + ``` + match x { + Option::Some(y) => y, + Option::None => 0, + }; + ``` + ``` + match x { + Some(y) if y != 0 => 1 / y, + _ => 0, + }; + ``` + """ pat: Pat | child guard: optional[Expr] | child expr: Expr | child -# Match { -# expr: ExprId, -# arms: Box<[MatchArm]>, -# }, +@rust.doc_test_signature("(x: i32) -> i32") class MatchExpr(Expr): + """ + A match expression. For example: + ``` + match x { + Option::Some(y) => y, + Option::None => 0, + } + ``` + ``` + match x { + Some(y) if y != 0 => 1 / y, + _ => 0, + } + ``` + """ expr: Expr | child branches: list[MatchArm] | child -# Continue { -# label: Option, -# }, - +@rust.doc_test_signature("() -> ()") class ContinueExpr(Expr): + """ + A continue expression. For example: + ``` + loop { + if not_ready() { + continue; + } + } + ``` + ``` + 'label: loop { + if not_ready() { + continue 'label; + } + } + ``` + """ label: optional[Label] | child -# Break { -# expr: Option, -# label: Option, -# }, - +@rust.doc_test_signature("() -> ()") class BreakExpr(Expr): + """ + A break expression. For example: + ``` + loop { + if not_ready() { + break; + } + } + ``` + ``` + let x = 'label: loop { + if done() { + break 'label 42; + } + }; + ``` + """ expr: optional[Expr] | child label: optional[Label] | child -# Return { -# expr: Option, -# }, - class ReturnExpr(Expr): + """ + A return expression. For example: + ``` + fn some_value() -> i32 { + return 42; + } + ``` + ``` + fn no_value() -> () { + return; + } + ``` + """ expr: optional[Expr] | child -# Become { -# expr: ExprId, -# }, class BecomeExpr(Expr): + """ + A `become` expression. For example: + ``` + fn fact_a(n: i32, a: i32) -> i32 { + if n == 0 { + a + } else { + become fact_a(n - 1, n * a) + } + } ``` + """ expr: Expr | child -# Yield { -# expr: Option, -# }, +@rust.doc_test_signature("() -> ()") class YieldExpr(Expr): + """ + A `yield` expression. For example: + ``` + let one = #[coroutine] + || { + yield 1; + }; + ``` + """ expr: optional[Expr] | child -# Yeet { -# expr: Option, -# }, - +@rust.doc_test_signature("() -> ()") class YeetExpr(Expr): + """ + A `yeet` expression. For example: + ``` + if x < size { + do yeet "index out of bounds"; + } + ``` + """ expr: optional[Expr] | child -# RecordLit { -# path: Option>, -# fields: Box<[RecordLitField]>, -# spread: Option, -# ellipsis: bool, -# is_assignee_expr: bool, -# }, -class RecordFieldPat(AstNode): - name: string - pat: Pat | child - - -class RecordLitField(AstNode): +@rust.doc_test_signature("() -> ()") +class RecordExprField(AstNode): + """ + A field in a record expression. For example `a: 1` in: + ``` + Foo { a: 1, b: 2 }; + ``` + """ name: string expr: Expr | child -class RecordLitExpr(Expr): - path: optional[Unimplemented] | child - fields: list[RecordLitField] | child +@rust.doc_test_signature("() -> ()") +class RecordExpr(Expr): + """ + A record expression. For example: + ``` + let first = Foo { a: 1, b: 2 }; + let second = Foo { a: 2, ..first }; + Foo { a: 1, b: 2 }[2] = 10; + Foo { .. } = second; + ``` + """ + path: optional[Path] | child + flds: list[RecordExprField] | child spread: optional[Expr] | child has_ellipsis: predicate is_assignee_expr: predicate -# Field { -# expr: ExprId, -# name: Name, -# }, - +@rust.doc_test_signature("() -> ()") class FieldExpr(Expr): + """ + A field access expression. For example: + ``` + x.foo + ``` + """ expr: Expr | child name: string -# Await { -# expr: ExprId, -# }, - +@rust.doc_test_signature("() -> ()") class AwaitExpr(Expr): + """ + An `await` expression. For example: + ``` + async { + let x = foo().await; + x + } + ``` + """ expr: Expr | child -# Cast { -# expr: ExprId, -# type_ref: Interned, -# }, - +@rust.doc_test_signature("() -> ()") class CastExpr(Expr): + """ + A cast expression. For example: + ``` + value as u64; + ``` + """ expr: Expr | child - type_ref: TypeRef | child -# Ref { -# expr: ExprId, -# rawness: Rawness, -# mutability: Mutability, -# }, + type: TypeRef | child +@rust.doc_test_signature("() -> ()") class RefExpr(Expr): + """ + A reference expression. For example: + ``` + let ref_const = &foo; + let ref_mut = &mut foo; + let raw_const: &mut i32 = &raw const foo; + let raw_mut: &mut i32 = &raw mut foo; + ``` + """ expr: Expr | child is_raw: predicate is_mut: predicate -# Box { -# expr: ExprId, -# }, +@rust.doc_test_signature("() -> ()") class BoxExpr(Expr): + """ + A box expression. For example: + ``` + let x = #[rustc_box] Box::new(42); + ``` + """ expr: Expr | child -# UnaryOp { -# expr: ExprId, -# op: UnaryOp, -# }, -class UnaryOpExpr(Expr): +@rust.doc_test_signature("() -> ()") +class PrefixExpr(Expr): + """ + A unary operation expression. For example: + ``` + let x = -42 + let y = !true + let z = *ptr + ``` + """ expr: Expr | child op: string -# BinaryOp { -# lhs: ExprId, -# rhs: ExprId, -# op: Option, -# }, - - -class BinaryOpExpr(Expr): +@rust.doc_test_signature("() -> ()") +class BinaryExpr(Expr): + """ + A binary operation expression. For example: + ``` + x + y; + x && y; + x <= y; + x = y; + x += y; + ``` + """ lhs: Expr | child rhs: Expr | child op: optional[string] -# Range { -# lhs: Option, -# rhs: Option, -# range_type: RangeOp, -# }, - - +@rust.doc_test_signature("() -> ()") class RangeExpr(Expr): + """ + A range expression. For example: + ``` + let x = 1..=10; + let x = 1..10; + let x = 10..; + let x = ..10; + let x = ..=10; + let x = ..; + ``` + """ lhs: optional[Expr] | child rhs: optional[Expr] | child is_inclusive: predicate -# Index { -# base: ExprId, -# index: ExprId, -# is_assignee_expr: bool, -# }, - +@rust.doc_test_signature("() -> ()") class IndexExpr(Expr): + """ + An index expression. For example: + ``` + list[42]; + list[42] = 1; + ``` + """ base: Expr | child index: Expr | child is_assignee_expr: predicate -# Closure { -# args: Box<[PatId]>, -# arg_types: Box<[Option>]>, -# ret_type: Option>, -# body: ExprId, -# closure_kind: ClosureKind, -# capture_by: CaptureBy, -# }, - +@rust.doc_test_signature("() -> ()") class ClosureExpr(Expr): + """ + A closure expression. For example: + ``` + |x| x + 1; + move |x: i32| -> i32 { x + 1 }; + async |x: i32, y| x + y; + #[coroutine] + |x| yield x; + #[coroutine] + static |x| yield x; + ``` + """ args: list[Pat] | child arg_types: list[optional[TypeRef]] | child ret_type: optional[TypeRef] | child body: Expr | child closure_kind: string is_move: predicate -# Tuple { -# exprs: Box<[ExprId]>, -# is_assignee_expr: bool, -# }, +@rust.doc_test_signature("() -> ()") class TupleExpr(Expr): + """ + A tuple expression. For example: + ``` + (1, "one"); + (2, "two")[0] = 3; + ``` + """ exprs: list[Expr] | child is_assignee_expr: predicate -# Array(Array), - class ArrayExpr(Expr): + """ + An array expression. For example: + ``` + [1, 2, 3]; + [1; 10]; + ``` + """ pass -# Literal(Literal), - -# ElementList { elements: Box<[ExprId]>, is_assignee_expr: bool }, +@rust.doc_test_signature("() -> ()") class ElementListExpr(ArrayExpr): + """ + An element list expression. For example: + ``` + [1, 2, 3, 4, 5]; + [1, 2, 3, 4, 5][0] = 6; + ``` + """ elements: list[Expr] | child is_assignee_expr: predicate -# Repeat { initializer: ExprId, repeat: ExprId }, - +@rust.doc_test_signature("() -> ()") class RepeatExpr(ArrayExpr): + """ + A repeat expression. For example: + ``` + [1; 10]; + """ initializer: Expr | child repeat: Expr | child +@rust.doc_test_signature("() -> ()") class LiteralExpr(Expr): + """ + A literal expression. For example: + ``` + 42; + 42.0; + "Hello, world!"; + b"Hello, world!"; + 'x'; + b'x'; + r"Hello, world!"; + true; + """ pass -# Underscore, +@rust.doc_test_signature("() -> ()") class UnderscoreExpr(Expr): + """ + An underscore expression. For example: + ``` + _ = 42; + ``` + """ pass -# OffsetOf(OffsetOf), +@rust.doc_test_signature("() -> ()") class OffsetOfExpr(Expr): + """ + An `offset_of` expression. For example: + ``` + builtin # offset_of(Struct, field); + ``` + """ container: TypeRef | child fields: list[string] -# InlineAsm(InlineAsm), - -class InlineAsmExpr(Expr): +@rust.doc_test_signature("() -> ()") +class AsmExpr(Expr): + """ + An inline assembly expression. For example: + ``` + unsafe { + builtin # asm(_); + } + ``` + """ expr: Expr | child -# Let { -# pat: PatId, -# type_ref: Option>, -# initializer: Option, -# else_branch: Option, -# }, - +@rust.doc_test_signature("() -> ()") class LetStmt(Stmt): + """ + A let statement. For example: + ``` + let x = 42; + let x: i32 = 42; + let x: i32; + let x; + let (x, y) = (1, 2); + let Some(x) = std::env::var("FOO") else { + return; + }; + + """ pat: Pat | child - type_ref: optional[TypeRef] | child + type: optional[TypeRef] | child initializer: optional[Expr] | child else_: optional[Expr] | child -# Expr { -# expr: ExprId, -# has_semi: bool, -# }, +@rust.doc_test_signature("() -> ()") class ExprStmt(Stmt): + """ + An expression statement. For example: + ``` + start(); + finish() + use std::env; + ``` + """ expr: Expr | child has_semicolon: predicate -# // At the moment, we only use this to figure out if a return expression -# // is really the last statement of a block. See #16566 -# Item, - +# At the HIR-level, we don't have items, only some markers without location indicating where they used to be. +@qltest.skip class ItemStmt(Stmt): + """ + An item statement. For example: + ``` + fn print_hello() { + println!("Hello, world!"); + } + print_hello(); + ``` + """ pass - # Missing, - +@rust.doc_test_signature("() -> ()") class MissingPat(Pat): + """ + A missing pattern, used as a place holder for incomplete syntax. + ``` + match Some(42) { + .. => "bad use of .. syntax", + }; + ``` + """ pass - # Wild, -class WildPat(Pat): +@rust.doc_test_signature("() -> ()") +class WildcardPat(Pat): + """ + A wildcard pattern. For example: + ``` + let _ = 42; + ``` + """ pass - # Tuple { args: Box<[PatId]>, ellipsis: Option }, +@rust.doc_test_signature("() -> ()") class TuplePat(Pat): + """ + A tuple pattern. For example: + ``` + let (x, y) = (1, 2); + let (a, b, .., z) = (1, 2, 3, 4, 5); + ``` + """ args: list[Pat] | child ellipsis_index: optional[int] - # Or(Box<[PatId]>), - +@rust.doc_test_signature("() -> ()") class OrPat(Pat): + """ + An or pattern. For example: + ``` + match x { + Option::Some(y) | Option::None => 0, + } + ``` + """ args: list[Pat] | child -# Record { path: Option>, args: Box<[RecordFieldPat]>, ellipsis: bool }, +@rust.doc_test_signature("() -> ()") +class RecordPatField(AstNode): + """ + A field in a record pattern. For example `a: 1` in: + ``` + let Foo { a: 1, b: 2 } = foo; + ``` + """ + name: string + pat: Pat | child +@rust.doc_test_signature("() -> ()") class RecordPat(Pat): - path: optional[Unimplemented] | child - args: list[RecordFieldPat] | child - has_ellipsis: predicate + """ + A record pattern. For example: + ``` + match x { + Foo { a: 1, b: 2 } => "ok", + Foo { .. } => "fail", + } + ``` + """ - # Range { start: Option>, end: Option> }, + path: optional[Path] | child + flds: list[RecordPatField] | child + has_ellipsis: predicate +@rust.doc_test_signature("() -> ()") class RangePat(Pat): + """ + A range pattern. For example: + ``` + match x { + ..15 => "too cold", + 16..=25 => "just right", + 26.. => "too hot", + } + ``` + """ start: optional[Pat] | child end: optional[Pat] | child - # Slice { prefix: Box<[PatId]>, slice: Option, suffix: Box<[PatId]> }, +@rust.doc_test_signature("() -> ()") class SlicePat(Pat): + """ + A slice pattern. For example: + ``` + match x { + [1, 2, 3, 4, 5] => "ok", + [1, 2, ..] => "fail", + [x, y, .., z, 7] => "fail", + } + """ prefix: list[Pat] | child slice: optional[Pat] | child suffix: list[Pat] | child - # Path(Box), +@rust.doc_test_signature("() -> ()") class PathPat(Pat): - path: Unimplemented | child - - # Lit(ExprId), + """ + A path pattern. For example: + ``` + match x { + Foo::Bar => "ok", + _ => "fail", + } + ``` + """ + path: Path | child -class LitPat(Pat): +@rust.doc_test_signature("() -> ()") +class LiteralPat(Pat): + """ + A literal pattern. For example: + ``` + match x { + 42 => "ok", + _ => "fail", + } + ``` + """ expr: Expr | child - # Bind { id: BindingId, subpat: Option }, - -class BindPat(Pat): +@rust.doc_test_signature("() -> ()") +class IdentPat(Pat): + """ + A binding pattern. For example: + ``` + match x { + Option::Some(y) => y, + Option::None => 0, + }; + ``` + ``` + match x { + y@Option::Some(_) => y, + Option::None => 0, + }; + ``` + """ binding_id: string subpat: optional[Pat] | child - # TupleStruct { path: Option>, args: Box<[PatId]>, ellipsis: Option }, - +@rust.doc_test_signature("() -> ()") class TupleStructPat(Pat): - path: optional[Unimplemented] | child + """ + A tuple struct pattern. For example: + ``` + match x { + Tuple("a", 1, 2, 3) => "great", + Tuple(.., 3) => "fine", + Tuple(..) => "fail", + }; + ``` + """ + path: optional[Path] | child args: list[Pat] | child ellipsis_index: optional[int] - # Ref { pat: PatId, mutability: Mutability }, - +@rust.doc_test_signature("() -> ()") class RefPat(Pat): + """ + A reference pattern. For example: + ``` + match x { + &mut Option::Some(y) => y, + &Option::None => 0, + }; + ``` + """ pat: Pat | child is_mut: predicate - # Box { inner: PatId }, - +@rust.doc_test_signature("() -> ()") class BoxPat(Pat): + """ + A box pattern. For example: + ``` + match x { + box Option::Some(y) => y, + box Option::None => 0, + }; + ``` + """ inner: Pat | child - # ConstBlock(ExprId), +@rust.doc_test_signature("() -> ()") class ConstBlockPat(Pat): + """ + A const block pattern. For example: + ``` + match x { + const { 1 + 2 + 3 } => "ok", + _ => "fail", + }; + ``` + """ expr: Expr | child diff --git a/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/old.dbscheme b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/old.dbscheme new file mode 100644 index 000000000000..1a24fefd78ba --- /dev/null +++ b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/old.dbscheme @@ -0,0 +1,2786 @@ +// generated by codegen/codegen.py + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/swift.dbscheme b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/swift.dbscheme new file mode 100644 index 000000000000..15a630f68e14 --- /dev/null +++ b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/swift.dbscheme @@ -0,0 +1,2786 @@ +// generated by codegen/codegen.py + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @callable +| @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/upgrade.properties b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/upgrade.properties new file mode 100644 index 000000000000..d4bfeacde377 --- /dev/null +++ b/swift/downgrades/1a24fefd78baf8af6c104d9e63849f3f6e1ef1a3/upgrade.properties @@ -0,0 +1,2 @@ +description: Make `@callable` part of `@element`. +compatibility: backwards diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index cf1df940b706..f4b04500820e 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -394,7 +394,7 @@ lib/codeql/swift/elements.qll bb863ff140bfaa0bf887708f421a16c85816886f4d061bbc5a lib/codeql/swift/generated/AstNode.qll 68877daa9e14b462247ac6b7b724f5e683288e39953a8ebb02a362b7d1df8e4c 54d3512744738e1ee15645f3af116437053cb5209687f4106361a1943b38b666 lib/codeql/swift/generated/AvailabilityInfo.qll e74e218a1ab00416cb8823610ff93642101aa784aa61cbc2b4deef61471a5bac e2c6c19860dc3e6e211041c95d8e6d52c3505ccff7018b80a849735cc98141af lib/codeql/swift/generated/AvailabilitySpec.qll a8afc5071887a67b4e0dec27356ab8cbf3e176b5358cb34c785e3015b2cad5a2 c7f88b0d701612c821359c983b3102f31b23edc211c3dcfe97de5adec61af386 -lib/codeql/swift/generated/Callable.qll 967fcb4f24a31754ef3bfdd1ea1e585ee8dc7fca02c8f6a2db451df22b156e38 d2e2824119e1b01964851a58099e19f787d12402de8ebce278731433325a76e9 +lib/codeql/swift/generated/Callable.qll d1a674575ec2edfeada622a5b34133101927b40714bdd6106f5f8b0708119c16 177e44bab51c105bc34925b06b18564b71a2c112e6fb700e47f1cc62fa03b483 lib/codeql/swift/generated/Comment.qll fea1b1eb97adcb9a1e5eee0a516240de7b0f0ffef55068c91dc13d29acd3a9a1 f2c8cf8ab5cd5daa67aae51bad4cd34a80a81c00220950476b2e91fd0808628d lib/codeql/swift/generated/DbFile.qll fc2f1cd370a6e67d0e0aeeb9ccd585ce6875064101a1385c2e456021728cfd53 fc2f1cd370a6e67d0e0aeeb9ccd585ce6875064101a1385c2e456021728cfd53 lib/codeql/swift/generated/DbLocation.qll 929f015202c9c5a8062c913c38ef069482e4f459606ce4e917d021c643cfc11d 929f015202c9c5a8062c913c38ef069482e4f459606ce4e917d021c643cfc11d @@ -407,11 +407,11 @@ lib/codeql/swift/generated/Locatable.qll 6cb437dd7ff7331429ec6586b0af50b1af15e4f lib/codeql/swift/generated/Location.qll 3f3bad413be87d05a596fe7b8004f415c2caa98cb759021a6aad20b589b7d700 ed30ed646962b3ffb6b47c97c6434fe47a6b1ea8e3f2e0589577bea5cf96c88e lib/codeql/swift/generated/MacroRole.qll aaf5631c49de81e046854955341202d6d3516713cd09bc2e7b870e40c261cc9f 6cd17d40cbf1d8fa4ef01dfb8b3462b7cee902e6058fb76417c2035be12481d1 lib/codeql/swift/generated/OtherAvailabilitySpec.qll 06393a08e8da36106c5ec6efb9f1bd56a5c7b3d3f3d0bcefc6fa07fa96860c31 06393a08e8da36106c5ec6efb9f1bd56a5c7b3d3f3d0bcefc6fa07fa96860c31 -lib/codeql/swift/generated/ParentChild.qll eae164aa8a78e883e707fba6c671ff2cd0ddab1084b0871fc5ae27c44cded4c5 3af88b63e21d58090f9702e6e4716a5b8a5a65897b8c92362b6e3c0fba60ddc2 +lib/codeql/swift/generated/ParentChild.qll 9c93c47197f4d510dc0e6a619e15938dc9b31907a300fde2fc27906448422e08 b153266ec86d64414c0c5c6a8f051209937594d40964715e2145982173ef6854 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll 5355be9da8b778d1d8ae60d25d9c3394477da24f94e8a6ab4484c6a16d07cd7c 075438c1762ec0a7775004b39032dcf85aada038a4269e6f428c34b8282786e9 lib/codeql/swift/generated/PureSynthConstructors.qll 40f5c0c573ce12f16322d9efb12306750f672254cbc36a200c298cb08e504229 40f5c0c573ce12f16322d9efb12306750f672254cbc36a200c298cb08e504229 -lib/codeql/swift/generated/Raw.qll 10633b948918d315b98b6ff6733d4c368e082c5afd78334c0862291f9d883216 66abde4c9a2283773033d90a4633c1203d6563fc238ddbd48fdf1b910f90021a -lib/codeql/swift/generated/Synth.qll 848284b2ae9854c5be74e5ef50a51090e248e5c9c02289a6bc63455e440122da e2607f46a4830e81718ca1636fa65bc29420a18539443d109fafd7f1af1591ce +lib/codeql/swift/generated/Raw.qll 118b43fedd4265b5aa15c33ef01a2f5a5db6e5597f95bef1078a01c3ff8da983 075aec2c8b232f0361ebf63f07ae9b66163f3975e6023583fb0fa2e40b979a33 +lib/codeql/swift/generated/Synth.qll 221f40afbc2bed0f5de1961877fd39dd025574bc72622af0e9f47f278a8324b7 05b8aaa9ac6236b0c08d6afc7a13e58361b90524cff6520a1ac6d422eea4fe40 lib/codeql/swift/generated/SynthConstructors.qll 7edffc30d3dddc4d73241f4e0d3df4501a99eb38d056f82043ed69e481404342 7edffc30d3dddc4d73241f4e0d3df4501a99eb38d056f82043ed69e481404342 lib/codeql/swift/generated/UnknownFile.qll 5325944cf96a72d5d224597745e15960fb6a9448b96b6644ececd6344dfd9d74 5325944cf96a72d5d224597745e15960fb6a9448b96b6644ececd6344dfd9d74 lib/codeql/swift/generated/UnknownLocation.qll dfdeb8eedb2564eccaac416695784ea04fe9754a3e109e8484c695021af4e554 dfdeb8eedb2564eccaac416695784ea04fe9754a3e109e8484c695021af4e554 diff --git a/swift/ql/lib/codeql/swift/elements/Callable.qll b/swift/ql/lib/codeql/swift/elements/Callable.qll index 367741ecd7c3..b74b530683d7 100644 --- a/swift/ql/lib/codeql/swift/elements/Callable.qll +++ b/swift/ql/lib/codeql/swift/elements/Callable.qll @@ -2,7 +2,7 @@ private import codeql.swift.generated.Callable private import codeql.swift.elements.AstNode private import codeql.swift.elements.decl.Decl -class Callable extends Generated::Callable, AstNode { +class Callable extends Generated::Callable { /** * Holds if this Callable is a function named `funcName`. */ diff --git a/swift/ql/lib/codeql/swift/generated/Callable.qll b/swift/ql/lib/codeql/swift/generated/Callable.qll index 71cfede9e923..4ad169e81c0f 100644 --- a/swift/ql/lib/codeql/swift/generated/Callable.qll +++ b/swift/ql/lib/codeql/swift/generated/Callable.qll @@ -6,9 +6,9 @@ private import codeql.swift.generated.Synth private import codeql.swift.generated.Raw +import codeql.swift.elements.AstNode import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.decl.CapturedDecl -import codeql.swift.elements.Element import codeql.swift.elements.decl.ParamDecl /** @@ -20,7 +20,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::Callable` class directly. * Use the subclass `Callable`, where the following predicates are available. */ - class Callable extends Synth::TCallable, Element { + class Callable extends Synth::TCallable, AstNode { /** * Gets the name of this callable, if it exists. * diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 1578315af7dc..058d02bfcb53 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -14,33 +14,6 @@ private module Impl { none() } - private Element getImmediateChildOfCallable(Callable e, int index, string partialPredicateCall) { - exists(int b, int bElement, int n, int nSelfParam, int nParam, int nBody, int nCapture | - b = 0 and - bElement = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfElement(e, i, _)) | i) and - n = bElement and - nSelfParam = n + 1 and - nParam = nSelfParam + 1 + max(int i | i = -1 or exists(e.getParam(i)) | i) and - nBody = nParam + 1 and - nCapture = nBody + 1 + max(int i | i = -1 or exists(e.getCapture(i)) | i) and - ( - none() - or - result = getImmediateChildOfElement(e, index - b, partialPredicateCall) - or - index = n and result = e.getSelfParam() and partialPredicateCall = "SelfParam()" - or - result = e.getParam(index - nSelfParam) and - partialPredicateCall = "Param(" + (index - nSelfParam).toString() + ")" - or - index = nParam and result = e.getBody() and partialPredicateCall = "Body()" - or - result = e.getCapture(index - nBody) and - partialPredicateCall = "Capture(" + (index - nBody).toString() + ")" - ) - ) - } - private Element getImmediateChildOfFile(File e, int index, string partialPredicateCall) { exists(int b, int bElement, int n | b = 0 and @@ -226,6 +199,33 @@ private module Impl { ) } + private Element getImmediateChildOfCallable(Callable e, int index, string partialPredicateCall) { + exists(int b, int bAstNode, int n, int nSelfParam, int nParam, int nBody, int nCapture | + b = 0 and + bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and + n = bAstNode and + nSelfParam = n + 1 and + nParam = nSelfParam + 1 + max(int i | i = -1 or exists(e.getParam(i)) | i) and + nBody = nParam + 1 and + nCapture = nBody + 1 + max(int i | i = -1 or exists(e.getCapture(i)) | i) and + ( + none() + or + result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall) + or + index = n and result = e.getSelfParam() and partialPredicateCall = "SelfParam()" + or + result = e.getParam(index - nSelfParam) and + partialPredicateCall = "Param(" + (index - nSelfParam).toString() + ")" + or + index = nParam and result = e.getBody() and partialPredicateCall = "Body()" + or + result = e.getCapture(index - nBody) and + partialPredicateCall = "Capture(" + (index - nBody).toString() + ")" + ) + ) + } + private Element getImmediateChildOfKeyPathComponent( KeyPathComponent e, int index, string partialPredicateCall ) { diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index 69168ddd0a70..69b72a2b06b7 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -15,40 +15,6 @@ module Raw { predicate isUnknown() { element_is_unknown(this) } } - /** - * INTERNAL: Do not use. - */ - class Callable extends @callable, Element { - /** - * Gets the name of this callable, if it exists. - * - * The name includes argument labels of the callable, for example `myFunction(arg:)`. - */ - string getName() { callable_names(this, result) } - - /** - * Gets the self parameter of this callable, if it exists. - */ - ParamDecl getSelfParam() { callable_self_params(this, result) } - - /** - * Gets the `index`th parameter of this callable (0-based). - */ - ParamDecl getParam(int index) { callable_params(this, index, result) } - - /** - * Gets the body of this callable, if it exists. - * - * The body is absent within protocol declarations. - */ - BraceStmt getBody() { callable_bodies(this, result) } - - /** - * Gets the `index`th capture of this callable (0-based). - */ - CapturedDecl getCapture(int index) { callable_captures(this, index, result) } - } - /** * INTERNAL: Do not use. */ @@ -197,6 +163,40 @@ module Raw { */ class AvailabilitySpec extends @availability_spec, AstNode { } + /** + * INTERNAL: Do not use. + */ + class Callable extends @callable, AstNode { + /** + * Gets the name of this callable, if it exists. + * + * The name includes argument labels of the callable, for example `myFunction(arg:)`. + */ + string getName() { callable_names(this, result) } + + /** + * Gets the self parameter of this callable, if it exists. + */ + ParamDecl getSelfParam() { callable_self_params(this, result) } + + /** + * Gets the `index`th parameter of this callable (0-based). + */ + ParamDecl getParam(int index) { callable_params(this, index, result) } + + /** + * Gets the body of this callable, if it exists. + * + * The body is absent within protocol declarations. + */ + BraceStmt getBody() { callable_bodies(this, result) } + + /** + * Gets the `index`th capture of this callable (0-based). + */ + CapturedDecl getCapture(int index) { callable_captures(this, index, result) } + } + /** * INTERNAL: Do not use. * A component of a `KeyPathExpr`. diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 778eb6462cf1..7d8c69f779d2 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -1080,8 +1080,9 @@ module Synth { * INTERNAL: Do not use. */ class TAstNode = - TAvailabilityInfo or TAvailabilitySpec or TCaseLabelItem or TConditionElement or TDecl or - TExpr or TKeyPathComponent or TMacroRole or TPattern or TStmt or TStmtCondition or TTypeRepr; + TAvailabilityInfo or TAvailabilitySpec or TCallable or TCaseLabelItem or TConditionElement or + TDecl or TExpr or TKeyPathComponent or TMacroRole or TPattern or TStmt or TStmtCondition or + TTypeRepr; /** * INTERNAL: Do not use. @@ -3369,6 +3370,8 @@ module Synth { or result = convertAvailabilitySpecFromRaw(e) or + result = convertCallableFromRaw(e) + or result = convertCaseLabelItemFromRaw(e) or result = convertConditionElementFromRaw(e) @@ -3418,8 +3421,6 @@ module Synth { */ cached TElement convertElementFromRaw(Raw::Element e) { - result = convertCallableFromRaw(e) - or result = convertFileFromRaw(e) or result = convertGenericContextFromRaw(e) @@ -6341,6 +6342,8 @@ module Synth { or result = convertAvailabilitySpecToRaw(e) or + result = convertCallableToRaw(e) + or result = convertCaseLabelItemToRaw(e) or result = convertConditionElementToRaw(e) @@ -6390,8 +6393,6 @@ module Synth { */ cached Raw::Element convertElementToRaw(TElement e) { - result = convertCallableToRaw(e) - or result = convertFileToRaw(e) or result = convertGenericContextToRaw(e) diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 15a630f68e14..1a24fefd78ba 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -12,8 +12,7 @@ sourceLocationPrefix( // from schema.py @element = - @callable -| @file + @file | @generic_context | @locatable | @location @@ -25,43 +24,6 @@ element_is_unknown( int id: @element ref ); -@callable = - @closure_expr -| @function -; - -#keyset[id] -callable_names( - int id: @callable ref, - string name: string ref -); - -#keyset[id] -callable_self_params( - int id: @callable ref, - int self_param: @param_decl_or_none ref -); - -#keyset[id, index] -callable_params( - int id: @callable ref, - int index: int ref, - int param: @param_decl_or_none ref -); - -#keyset[id] -callable_bodies( - int id: @callable ref, - int body: @brace_stmt_or_none ref -); - -#keyset[id, index] -callable_captures( - int id: @callable ref, - int index: int ref, - int capture: @captured_decl_or_none ref -); - @file = @db_file ; @@ -108,6 +70,7 @@ locations( @ast_node = @availability_info | @availability_spec +| @callable | @case_label_item | @condition_element | @decl @@ -175,6 +138,43 @@ availability_info_specs( | @platform_version_availability_spec ; +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + key_path_components( unique int id: @key_path_component, int kind: int ref, diff --git a/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/old.dbscheme b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/old.dbscheme new file mode 100644 index 000000000000..15a630f68e14 --- /dev/null +++ b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/old.dbscheme @@ -0,0 +1,2786 @@ +// generated by codegen/codegen.py + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @callable +| @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/swift.dbscheme b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/swift.dbscheme new file mode 100644 index 000000000000..1a24fefd78ba --- /dev/null +++ b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/swift.dbscheme @@ -0,0 +1,2786 @@ +// generated by codegen/codegen.py + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/upgrade.properties b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/upgrade.properties new file mode 100644 index 000000000000..6b544767ef21 --- /dev/null +++ b/swift/ql/lib/upgrades/15a630f68e14f053932cf6a23797f43d958eedc9/upgrade.properties @@ -0,0 +1,2 @@ +description: Make `@callable` part of `@astnode`. +compatibility: backwards diff --git a/swift/schema.py b/swift/schema.py index 66fe693a8bcb..e1deb0a2778a 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -242,7 +242,7 @@ class ParamDecl(VarDecl): has a property wrapper. """) -class Callable(Element): +class Callable(AstNode): name: optional[string] | doc("name of this callable") | desc("The name includes argument " "labels of the callable, for example `myFunction(arg:)`.") self_param: optional[ParamDecl] | child