Rust: more advanced toString

This commit is contained in:
Paolo Tranquilli
2024-11-20 16:21:23 +01:00
parent 4d04c5af83
commit b4af5a61d1
74 changed files with 1777 additions and 1425 deletions

View File

@@ -1,2 +1,2 @@
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
top.rs cdfb9890318d847e6db320abd8b9e9939524ecc47bcdc8491b9c8253bd3178c2 cdfb9890318d847e6db320abd8b9e9939524ecc47bcdc8491b9c8253bd3178c2
top.rs 7a5bbe75eae6069f4f255db13787a3575e706742af1f57122c02d46895de9a1b 7a5bbe75eae6069f4f255db13787a3575e706742af1f57122c02d46895de9a1b

View File

@@ -3568,97 +3568,6 @@ impl From<trap::Label<BinaryExpr>> for trap::Label<Locatable> {
}
}
#[derive(Debug)]
pub struct BlockExpr {
pub id: trap::TrapId<BlockExpr>,
pub attrs: Vec<trap::Label<Attr>>,
pub is_async: bool,
pub is_const: bool,
pub is_gen: bool,
pub is_move: bool,
pub is_try: bool,
pub is_unsafe: bool,
pub label: Option<trap::Label<Label>>,
pub stmt_list: Option<trap::Label<StmtList>>,
}
impl trap::TrapEntry for BlockExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("block_exprs", vec![id.into()]);
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("block_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if self.is_async {
out.add_tuple("block_expr_is_async", vec![id.into()]);
}
if self.is_const {
out.add_tuple("block_expr_is_const", vec![id.into()]);
}
if self.is_gen {
out.add_tuple("block_expr_is_gen", vec![id.into()]);
}
if self.is_move {
out.add_tuple("block_expr_is_move", vec![id.into()]);
}
if self.is_try {
out.add_tuple("block_expr_is_try", vec![id.into()]);
}
if self.is_unsafe {
out.add_tuple("block_expr_is_unsafe", vec![id.into()]);
}
if let Some(v) = self.label {
out.add_tuple("block_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.stmt_list {
out.add_tuple("block_expr_stmt_lists", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for BlockExpr {
fn class_name() -> &'static str { "BlockExpr" }
}
impl From<trap::Label<BlockExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Element> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct BoxPat {
pub id: trap::TrapId<BoxPat>,
@@ -4582,81 +4491,6 @@ impl From<trap::Label<FnPtrType>> for trap::Label<TypeRef> {
}
}
#[derive(Debug)]
pub struct ForExpr {
pub id: trap::TrapId<ForExpr>,
pub attrs: Vec<trap::Label<Attr>>,
pub iterable: Option<trap::Label<Expr>>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
pub pat: Option<trap::Label<Pat>>,
}
impl trap::TrapEntry for ForExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("for_exprs", vec![id.into()]);
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("for_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.iterable {
out.add_tuple("for_expr_iterables", vec![id.into(), v.into()]);
}
if let Some(v) = self.label {
out.add_tuple("for_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("for_expr_loop_bodies", vec![id.into(), v.into()]);
}
if let Some(v) = self.pat {
out.add_tuple("for_expr_pats", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for ForExpr {
fn class_name() -> &'static str { "ForExpr" }
}
impl From<trap::Label<ForExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Element> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct ForType {
pub id: trap::TrapId<ForType>,
@@ -5168,6 +5002,51 @@ impl From<trap::Label<Item>> for trap::Label<Stmt> {
}
}
#[derive(Debug)]
pub struct LabelableExpr {
_unused: ()
}
impl trap::TrapClass for LabelableExpr {
fn class_name() -> &'static str { "LabelableExpr" }
}
impl From<trap::Label<LabelableExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<LabelableExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LabelableExpr>> for trap::Label<Element> {
fn from(value: trap::Label<LabelableExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LabelableExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<LabelableExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LabelableExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<LabelableExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LabelableExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct LetExpr {
pub id: trap::TrapId<LetExpr>,
@@ -5558,73 +5437,6 @@ impl From<trap::Label<LiteralPat>> for trap::Label<Pat> {
}
}
#[derive(Debug)]
pub struct LoopExpr {
pub id: trap::TrapId<LoopExpr>,
pub attrs: Vec<trap::Label<Attr>>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
}
impl trap::TrapEntry for LoopExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("loop_exprs", vec![id.into()]);
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("loop_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.label {
out.add_tuple("loop_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("loop_expr_loop_bodies", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for LoopExpr {
fn class_name() -> &'static str { "LoopExpr" }
}
impl From<trap::Label<LoopExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Element> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct MacroExpr {
pub id: trap::TrapId<MacroExpr>,
@@ -7914,77 +7726,6 @@ impl From<trap::Label<UnderscoreExpr>> for trap::Label<Locatable> {
}
}
#[derive(Debug)]
pub struct WhileExpr {
pub id: trap::TrapId<WhileExpr>,
pub attrs: Vec<trap::Label<Attr>>,
pub condition: Option<trap::Label<Expr>>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
}
impl trap::TrapEntry for WhileExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("while_exprs", vec![id.into()]);
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("while_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.condition {
out.add_tuple("while_expr_conditions", vec![id.into(), v.into()]);
}
if let Some(v) = self.label {
out.add_tuple("while_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("while_expr_loop_bodies", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for WhileExpr {
fn class_name() -> &'static str { "WhileExpr" }
}
impl From<trap::Label<WhileExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Element> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct WildcardPat {
pub id: trap::TrapId<WildcardPat>,
@@ -8166,6 +7907,106 @@ impl From<trap::Label<YieldExpr>> for trap::Label<Locatable> {
}
}
#[derive(Debug)]
pub struct BlockExpr {
pub id: trap::TrapId<BlockExpr>,
pub label: Option<trap::Label<Label>>,
pub attrs: Vec<trap::Label<Attr>>,
pub is_async: bool,
pub is_const: bool,
pub is_gen: bool,
pub is_move: bool,
pub is_try: bool,
pub is_unsafe: bool,
pub stmt_list: Option<trap::Label<StmtList>>,
}
impl trap::TrapEntry for BlockExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("block_exprs", vec![id.into()]);
if let Some(v) = self.label {
out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]);
}
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("block_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if self.is_async {
out.add_tuple("block_expr_is_async", vec![id.into()]);
}
if self.is_const {
out.add_tuple("block_expr_is_const", vec![id.into()]);
}
if self.is_gen {
out.add_tuple("block_expr_is_gen", vec![id.into()]);
}
if self.is_move {
out.add_tuple("block_expr_is_move", vec![id.into()]);
}
if self.is_try {
out.add_tuple("block_expr_is_try", vec![id.into()]);
}
if self.is_unsafe {
out.add_tuple("block_expr_is_unsafe", vec![id.into()]);
}
if let Some(v) = self.stmt_list {
out.add_tuple("block_expr_stmt_lists", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for BlockExpr {
fn class_name() -> &'static str { "BlockExpr" }
}
impl From<trap::Label<BlockExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Element> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<LabelableExpr> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of LabelableExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<BlockExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<BlockExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme BlockExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct CallExpr {
pub id: trap::TrapId<CallExpr>,
@@ -8842,6 +8683,60 @@ impl From<trap::Label<Impl>> for trap::Label<Stmt> {
}
}
#[derive(Debug)]
pub struct LoopingExpr {
_unused: ()
}
impl trap::TrapClass for LoopingExpr {
fn class_name() -> &'static str { "LoopingExpr" }
}
impl From<trap::Label<LoopingExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<LoopingExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopingExpr>> for trap::Label<Element> {
fn from(value: trap::Label<LoopingExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopingExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<LoopingExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopingExpr>> for trap::Label<LabelableExpr> {
fn from(value: trap::Label<LoopingExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of LabelableExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopingExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<LoopingExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopingExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct MacroCall {
pub id: trap::TrapId<MacroCall>,
@@ -10005,3 +9900,270 @@ impl From<trap::Label<Use>> for trap::Label<Stmt> {
}
}
}
#[derive(Debug)]
pub struct ForExpr {
pub id: trap::TrapId<ForExpr>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
pub attrs: Vec<trap::Label<Attr>>,
pub iterable: Option<trap::Label<Expr>>,
pub pat: Option<trap::Label<Pat>>,
}
impl trap::TrapEntry for ForExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("for_exprs", vec![id.into()]);
if let Some(v) = self.label {
out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]);
}
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("for_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.iterable {
out.add_tuple("for_expr_iterables", vec![id.into(), v.into()]);
}
if let Some(v) = self.pat {
out.add_tuple("for_expr_pats", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for ForExpr {
fn class_name() -> &'static str { "ForExpr" }
}
impl From<trap::Label<ForExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Element> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<LabelableExpr> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of LabelableExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<ForExpr>> for trap::Label<LoopingExpr> {
fn from(value: trap::Label<ForExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme ForExpr is a subclass of LoopingExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct LoopExpr {
pub id: trap::TrapId<LoopExpr>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
pub attrs: Vec<trap::Label<Attr>>,
}
impl trap::TrapEntry for LoopExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("loop_exprs", vec![id.into()]);
if let Some(v) = self.label {
out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]);
}
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("loop_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
}
}
impl trap::TrapClass for LoopExpr {
fn class_name() -> &'static str { "LoopExpr" }
}
impl From<trap::Label<LoopExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Element> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<LabelableExpr> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of LabelableExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<LoopExpr>> for trap::Label<LoopingExpr> {
fn from(value: trap::Label<LoopExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme LoopExpr is a subclass of LoopingExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
#[derive(Debug)]
pub struct WhileExpr {
pub id: trap::TrapId<WhileExpr>,
pub label: Option<trap::Label<Label>>,
pub loop_body: Option<trap::Label<BlockExpr>>,
pub attrs: Vec<trap::Label<Attr>>,
pub condition: Option<trap::Label<Expr>>,
}
impl trap::TrapEntry for WhileExpr {
fn extract_id(&mut self) -> trap::TrapId<Self> {
std::mem::replace(&mut self.id, trap::TrapId::Star)
}
fn emit(self, id: trap::Label<Self>, out: &mut trap::Writer) {
out.add_tuple("while_exprs", vec![id.into()]);
if let Some(v) = self.label {
out.add_tuple("labelable_expr_labels", vec![id.into(), v.into()]);
}
if let Some(v) = self.loop_body {
out.add_tuple("looping_expr_loop_bodies", vec![id.into(), v.into()]);
}
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("while_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.condition {
out.add_tuple("while_expr_conditions", vec![id.into(), v.into()]);
}
}
}
impl trap::TrapClass for WhileExpr {
fn class_name() -> &'static str { "WhileExpr" }
}
impl From<trap::Label<WhileExpr>> for trap::Label<AstNode> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of AstNode
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Element> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Element
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Expr> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Expr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<LabelableExpr> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of LabelableExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<Locatable> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of Locatable
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}
impl From<trap::Label<WhileExpr>> for trap::Label<LoopingExpr> {
fn from(value: trap::Label<WhileExpr>) -> Self {
// SAFETY: this is safe because in the dbscheme WhileExpr is a subclass of LoopingExpr
unsafe {
Self::from_untyped(value.as_untyped())
}
}
}

View File

@@ -11,7 +11,7 @@ lib/codeql/rust/elements/Attr.qll 53887a49513b95e38344b57d824a7474331467561f1edf
lib/codeql/rust/elements/AwaitExpr.qll d8b37c01f7d27f0ec40d92a533a8f09a06af7ece1ae832b4ea8f2450c1762511 92cdb7ff0efddf26bed2b7b2729fddd197e26c1a11c8fec0c747aab642710c21
lib/codeql/rust/elements/BecomeExpr.qll 7a3cfc4894feb6be1cde664f675b18936434e68ccea52e55314c33d01491e34f 49666eca509b30d44bb02702bda67239c76bf8d9f231022c9cf6ecca123f8616
lib/codeql/rust/elements/BinaryExpr.qll 394522da3bc3a716fc7bc40c3560143ca840f5d210cfcba2a752c3026dd0f725 fbbd6fb79bf16a7d9820613654c584cd7ff3e7a29988f3920b6cfbe746acfd8d
lib/codeql/rust/elements/BlockExpr.qll b952fd44b89de248931d4089834d2c9406f6f2fc1a3f5c2365156be4e55157cf daccc07ab11ac696679b9fadc99f40b1bf579c90bf6c7cca6e82eaa313932ede
lib/codeql/rust/elements/BlockExpr.qll b5cf57119b15f27d0bc258dfa375b0ef2730c157870ff543f0dc7a8cfe514182 f6a01999606b010c81ef9c6ff1385e6640632b6f5ce067ffeb0ef0af0a0aeb92
lib/codeql/rust/elements/BoxPat.qll 1b2c3fff171aa6aa238c9460b122f26c79e04577cea67fa856de99842ba873d4 0caf8d23ed6e0997a6b8751def27641582151fba6e24fccf798712a4690b42f1
lib/codeql/rust/elements/BreakExpr.qll 7ca3807a20e9a9a988d1fd7abebf240325ed422fcb45c719ba46272f031f94db dffb7379d3f3ba220acfbd05eb7bb6cfd9cfda211e9c8b1f5240ca5fa61be3fc
lib/codeql/rust/elements/CallExpr.qll f336500ca7a611b164d48b90e80edb0c0d3816792b0ececce659ac1ff1ffeb3e f99a9c55466418ef53860c44d9f2d6161af4b492178ddd9e5870dff742b70ae5
@@ -38,7 +38,7 @@ lib/codeql/rust/elements/ExternItemList.qll bc96f188970e8dc0cd1e77dea3e49b715edf
lib/codeql/rust/elements/FieldExpr.qll 8102cd659f9059cf6af2a22033cfcd2aae9c35204b86f7d219a05f1f8de54b3b f818169dddf5102095ae1410583615f80031376a08b5307d0c464e79953c3975
lib/codeql/rust/elements/FieldList.qll bd243adc4696c60f636055a1c2da28039fe2028476c9247eb6a68003b849b757 ab63cdf410afd1e515f873b49f46bb5c2bf27e6c78fd206ccbdba064c4c0a4b2
lib/codeql/rust/elements/FnPtrType.qll c4a90dc660cf620972dc23b95494f5caf9f050eabd4bdb52fdc061f8797ba9a1 f8defc91582fa503607664668f9e2e6c2cd8b320c7c449610f21e52e332a129f
lib/codeql/rust/elements/ForExpr.qll 312804d53dd9236a2f2a15c9d6ec348b46e139a54eb5893e7e12487725df7444 fa5e20099b1179033bc209bad3548e3d1d4019c7fe0e455cec8ca1a9d48692ab
lib/codeql/rust/elements/ForExpr.qll 0cc8bfe10b8baf62a1ff65c8463cfb17ab64b41c30c9e1edb962a227df2036d9 b1be73294e6da0f49fd32177ad0b05fecf26081d5ce424f288be99a4bd59cc84
lib/codeql/rust/elements/ForType.qll 0036bed8749358c356d78c4a0eef40d73e2796284293cde5604ae70ddd6d0470 4edcaf8f7c67d42ebe3ebb1be6a7643758717d4fe88f5f648b6a1c5ff4ee4de7
lib/codeql/rust/elements/Format.qll 506172d176f4b965f428585c032464f4abe07a0e47c574f8e011d8641ec45370 653e81bf233b8729649064de64f4a7a8533f8864ac6d2ea913f347088c924c60
lib/codeql/rust/elements/FormatArgsArg.qll 5bc9b4cd1bac7131165836e93838c45452a08ea6011741cbddace3cbf9c69440 f825140e98dc9800d5c045402186793c7b21511448e2f6bf6402d1e06305219c
@@ -59,6 +59,7 @@ lib/codeql/rust/elements/InferType.qll c71184ae6aa181be94e299882503350e057493e17
lib/codeql/rust/elements/Item.qll 5c9148ff0eaeb4404c2d8156e7df0ef5753fd44ead972da05a49659ddaa25480 78446f788617e40525d4d4b489848e75f2143a90e18d40974c3bff7b1e7c825c
lib/codeql/rust/elements/ItemList.qll c33e46a9ee45ccb194a0fe5b30a6ad3bcecb0f51486c94e0191a943710a17a7d 5a69c4e7712b4529681c4406d23dc1b6b9e5b3c03552688c55addab271912ed5
lib/codeql/rust/elements/Label.qll a31d41db351af7f99a55b26cdbbc7f13b4e96b660a74e2f1cc90c17ee8df8d73 689f87cb056c8a2aefe1a0bfc2486a32feb44eb3175803c61961a6aeee53d66e
lib/codeql/rust/elements/LabelableExpr.qll 598be487cd051b004ab95cbbc3029100069dc9955851c492029d80f230e56f0d 92c49b3cfdaba07982f950e18a8d62dae4e96f5d9ae0d7d2f4292628361f0ddc
lib/codeql/rust/elements/LetElse.qll 85d16cb9cb2162493a9bacfe4b9e6a3b325d9466175b6d1a8e649bdf2191b864 c268d0878e9f82e8ede930b3825745c39ab8cd4db818eb9be6dc5ca49bee7579
lib/codeql/rust/elements/LetExpr.qll 435f233890799a9f52972a023e381bc6fe2e0b3df1e696dc98b21682a3c1d88e b34da72dd222a381e098f160551ec614ebb98eb46af35c6e1d337e173d8ec4b9
lib/codeql/rust/elements/LetStmt.qll e589d750ff87c25e28e15dab61e1a3555a45ced42158b05c991c6f5873abd86a 383484181b825cd7bc20e014fc4d5888f66e1f257502e1893f3d55aed2cdef3d
@@ -68,7 +69,8 @@ lib/codeql/rust/elements/LifetimeParam.qll db9f2c7bb32d49808993b400875e79560ac54
lib/codeql/rust/elements/LiteralExpr.qll 40b67404b7c2b81e5afabc53a2a93e0a503f687bb31a2b4bfa4e07b2d764eb8d 67ab1be2286e769fba7a50ca16748e3c141760ccaefaebae99faa71f523a43d5
lib/codeql/rust/elements/LiteralPat.qll daffb5f380a47543669c8cc92628b0e0de478c3ac82685802c63e8d75a206bed adfe9796598cf6ca4a9170c89ffd871e117f1cea6dd7dd80ecbbb947327a1a5d
lib/codeql/rust/elements/Locatable.qll 2855efa4a469b54e0ca85daa89309a8b991cded6f3f10db361010831ba1e11d3 00c3406d14603f90abea11bf074eaf2c0b623a30e29cf6afc3a247cb58b92f0f
lib/codeql/rust/elements/LoopExpr.qll 58ade0bc4a01a1cc361363682fde3ea56f4c5fbb4b28f5723ceff52ebaf897d7 fa299162c742bcf3b2211dc20821b312e3c133350c288a050eb26e6f8b5a5c78
lib/codeql/rust/elements/LoopExpr.qll ee171177650fa23eef102a9580765f4b6073a1cc41bab1ec31ad4f84ffe6c2c9 bfcf0cca4dc944270d9748a202829a38c64dfae167c0d3a4202788ceb9daf5f6
lib/codeql/rust/elements/LoopingExpr.qll 7ad7d4bbfd05adc0bb9b4ca90ff3377b8298121ca5360ffb45d5a7a1e20fe37a 964168b2045ee9bad827bba53f10a64d649b3513f2d1e3c17a1b1f11d0fc7f3a
lib/codeql/rust/elements/MacroCall.qll a39a11d387355f59af3007dcbab3282e2b9e3289c1f8f4c6b96154ddb802f8c3 88d4575e462af2aa780219ba1338a790547fdfc1d267c4b84f1b929f4bc08d05
lib/codeql/rust/elements/MacroDef.qll acb39275a1a3257084314a46ad4d8477946130f57e401c70c5949ad6aafc5c5f 6a8a8db12a3ec345fede51ca36e8c6acbdce58c5144388bb94f0706416fa152a
lib/codeql/rust/elements/MacroExpr.qll ea9fed13f610bab1a2c4541c994510e0cb806530b60beef0d0c36b23e3b620f0 ad11a6bbd3a229ad97a16049cc6b0f3c8740f9f75ea61bbf4eebb072db9b12d2
@@ -160,7 +162,7 @@ lib/codeql/rust/elements/VariantList.qll 07adfe5750b2d5b50c8629f36feba24edd84f75
lib/codeql/rust/elements/Visibility.qll d2cf0727efaf8df6b3808cb4a6b2e26d18e42db766d92e97ad3ef046d91cb9e5 8947a1e2d48b532c6455ddf143fa5b1dff28c40da1f1c6a72769fc9db7ecbaf6
lib/codeql/rust/elements/WhereClause.qll da51212766700e40713fff968078a0172a4f73eebc5425d8e0d60b03c2fe59fa 0ec036aea729b8f4af0eb8118911dce715e2eb4640ae7b5e40a007a48da03899
lib/codeql/rust/elements/WherePred.qll 4815cd8f2a536c895e1f6831bef2ee6b9ea42c4fea12df1f164de1c965795bc1 3b46806767d81218d2e21656afe39c957c364ff7067c9af3ae8bacbf7f93858b
lib/codeql/rust/elements/WhileExpr.qll 9c12c26f953163c70020669327bd8c931493ef7fb4b75e6711202c0bab1d2697 2e2c96425bcd4414c65d9069a71a5123a3a10dd1449cafc121ac08f91ea49728
lib/codeql/rust/elements/WhileExpr.qll 9e0c23057bf3fa3e050d5f6de0650f554ce576861783ea7d1e4c7d35db129ad3 b294c4f6e4dea922a4274779287edcb484409b2654a553298626ded9d1e8c5a4
lib/codeql/rust/elements/WildcardPat.qll 4f941afc5f9f8d319719312399a8f787c75a0dbb709ec7cf488f019339635aab a9140a86da752f9126e586ddb9424b23b3fb4841a5420bac48108c38bb218930
lib/codeql/rust/elements/YeetExpr.qll 4172bf70de31cab17639da6eed4a12a7afcefd7aa9182216c3811c822d3d6b17 88223aab1bef696f508e0605615d6b83e1eaef755314e6a651ae977edd3757c3
lib/codeql/rust/elements/YieldExpr.qll de2dc096a077f6c57bba9d1c2b2dcdbecce501333753b866d77c3ffbe06aa516 1f3e8949689c09ed356ff4777394fe39f2ed2b1e6c381fd391790da4f5d5c76a
@@ -184,6 +186,7 @@ lib/codeql/rust/elements/internal/AwaitExprConstructor.qll 44ff1653e73d5b9f6885c
lib/codeql/rust/elements/internal/BecomeExprConstructor.qll ba073aaa256cb8827a0307c3128d50f62b11aac0b1f324e48c95f30351a9b942 3a787ded505c3158fa4f4923f66e8ecdcb7b5f86f27f64c5412dc32dca031f18
lib/codeql/rust/elements/internal/BinaryExprConstructor.qll 7f9b17757f78b9fb7c46e21d2040a77fa50083bef4911c8464991c3d1ad91d87 a59390cd8e896c0bfbdc9ba0674e06d980ffcefa710fbc9886be52ed427e9717
lib/codeql/rust/elements/internal/BlockExprConstructor.qll 438337c807645e98a01440f3f4610d68b0567ba15c8f51dc43bf5a30c9af3696 48ce7a546910c884619762349b8ada9836284f8008298fdb0070a38f7ddf25a0
lib/codeql/rust/elements/internal/BlockExprImpl.qll 36ac09e4a6eeeec22919b62b1d004bdb5bb2527e67932c308aec383a770768d6 3b4b2a2014f6fe075c63a2d633b297566b548ef2e4343cadf067a9edbcadc876
lib/codeql/rust/elements/internal/BoxPatConstructor.qll 153f110ba25fd6c889092bfd16f73bb610fa60d6e0c8965d5f44d2446fcd48a2 9324cf0d8aa29945551bf8ab64801d598f57aab8cd4e19bcd4e9ef8a4a4e06eb
lib/codeql/rust/elements/internal/BreakExprConstructor.qll 356be043c28e0b34fdf925a119c945632ee883c6f5ebb9a27003c6a8d250afd9 bb77e66b04bb9489340e7506931559b94285c6904b6f9d2f83b214cba4f3cfd5
lib/codeql/rust/elements/internal/CallExprBaseImpl.qll d2749cc1a9d7ee8bf7f34b6c3e0238a576a68e439a8c10a503c164ff45ffcbeb ffc7b0a8841945fe6736b0e1aed7d9ed69185db03dee2b16da121325b39397c7
@@ -256,6 +259,7 @@ lib/codeql/rust/elements/internal/LifetimeParamImpl.qll 8909288801bff8d3e87096df
lib/codeql/rust/elements/internal/LiteralExprConstructor.qll 8ea3569bd50704ce7d57be790d2dfd38f4c40cb0b12e0dd60d6830e8145a686f 88d07ad3298003f314f74bd8e3d64a3094de32080ad42a7e6741c416c3856095
lib/codeql/rust/elements/internal/LiteralPatConstructor.qll b660cb428a0cba0b713fc7b07d5d2921de4a2f65a805535fb6387684c40620de 2dbc9fbc56e9de53d24265d6b13738ef5b9ced33cc3c4c1c270e04dc2fc1330f
lib/codeql/rust/elements/internal/LoopExprConstructor.qll 45f3f8f7441fcab6adc58831421679ee07bac68ac0417f3cbc90c97426cc805b f7ab3361b4a11e898126378ea277d76949466946762cd6cb5e9e9b4bb9860420
lib/codeql/rust/elements/internal/LoopingExprImpl.qll 17885c1bcf7b5a3f9c7bbad3d4d55e24372af0dedd5e7fc0efcfc0a8b2cdad70 104dc45ca399b9f6e8227ad561679f728d60170398a52b31fc90cb2a2dd3c33c
lib/codeql/rust/elements/internal/MacroCallConstructor.qll 707fee4fba1fd632cd00128f493e8919eaaea552ad653af4c1b7a138e362907d b49e7e36bf9306199f2326af042740ff858871b5c79f6aeddf3d5037044dbf1f
lib/codeql/rust/elements/internal/MacroDefConstructor.qll 382a3bdf46905d112ee491620cc94f87d584d72f49e01eb1483f749e4709c055 eb61b90d8d8d655c2b00ff576ae20c8da9709eeef754212bc64d8e1558ad05ce
lib/codeql/rust/elements/internal/MacroDefImpl.qll f26e787ffd43e8cb079db01eba04412dbf32c338938acf1bc09a2f094bbdfdfe 044f43bc94fe4b6df22afae32e9f039d1d0d9e85ad9f24b6388be71211c37ce5
@@ -420,7 +424,7 @@ lib/codeql/rust/elements/internal/generated/Attr.qll 2e7983b2c462750065ed58cc10c
lib/codeql/rust/elements/internal/generated/AwaitExpr.qll 1d71af702a1f397fb231fae3e0642b3deeba0cd5a43c1d8fabdff29cac979340 e0bfa007bdecc5a09a266d449d723ae35f5a24fbdfc11e4e48aeea3ec0c5147c
lib/codeql/rust/elements/internal/generated/BecomeExpr.qll 7a211b785a4a2f961242d1d73fd031d381aad809f7b600ce7f7f864518bb7242 17a0388680007871748cfdc6621f700a7c2817b9601e1bd817fb48561e7c63ad
lib/codeql/rust/elements/internal/generated/BinaryExpr.qll 64e9bd9c571edd6e5f3e7662b956b1d87fa0354ce6fe95da9caf25ac16b66c68 3fca09fdbe879db2ca3293618896a462e96376a2963d15cce3d5b1baac552fcb
lib/codeql/rust/elements/internal/generated/BlockExpr.qll ccfbdc7bd268735a0424ff08dcf37d0e1fed61d5fe0520593c23f2490d400438 0facad59f6aba13ee0c069b691c99f52c04b723a2bfad4da226190c3c42dcabf
lib/codeql/rust/elements/internal/generated/BlockExpr.qll 5a5ddbe34bc478a7bd9b0d07d3b6f017c2d1f20581d859251a963314e6514d1f 9804c30b8b279038b864c52557535f854bd012bacdfe8e5840f1f777c74e52df
lib/codeql/rust/elements/internal/generated/BoxPat.qll ec946a3e671ab7417e04b0207967adad004df512c570c4f0780ca5816d12d75f b0e64860855c4e85914042b1a51034899ff7cd1b2c6857188de89310a2726ea3
lib/codeql/rust/elements/internal/generated/BreakExpr.qll 0f428a8b2f4209b134c2ffc3e1c93c30bc6b0e9c9172f140cefa88c1f77d8690 957b39f38ff6befe9061f55bc0b403c2f1c366dd0cf63b874bae6f8216576d76
lib/codeql/rust/elements/internal/generated/CallExpr.qll 23ee64e3bf643cd5e6ff705181d2bb31e1aeaffecb5bdce73836172dbf15f12f 34b280139b1f8f70d78e1432392f03c971be392e8cb68d014eb325d0c101bddd
@@ -447,7 +451,7 @@ lib/codeql/rust/elements/internal/generated/ExternItemList.qll 6bc97fdae6c411cab
lib/codeql/rust/elements/internal/generated/FieldExpr.qll 3e506b5cb93793ec30f56bb637a600db869fcba6181b068516a671d55c362739 7bbf953696d763ad6b210f378f487ba85b875fa115b22c0c0508599a63633502
lib/codeql/rust/elements/internal/generated/FieldList.qll 43c13c6e3c9ba75a7a4cb870fc4f18752001584d48b9df0734055a6ebb789331 7c51b0b13eb02f1286d3365e53a976ba2655c4dbd8e735bc11c8b205c829e1ee
lib/codeql/rust/elements/internal/generated/FnPtrType.qll 748d766dbefd19a7d644734c57885eeede66897029bbfe1b87919517f43bfde2 5a7d80acc00e56594ed85026a8ea4923104d2e98c2e42db8c5bcd32ddd164e48
lib/codeql/rust/elements/internal/generated/ForExpr.qll 541b62b48911d4999f9ed64ab6c8b9910073ac4add0225761f319677328cf120 976c3a91c9eedfb1e2d9ea76ac501348643b3d23c723d7a777042258d416d091
lib/codeql/rust/elements/internal/generated/ForExpr.qll d81751e9599874a1292a0aace80b2de60ab36fc43f74ec08fbdfe044fc19e5c1 34a64586f8ffbadd44d0e747f69ab550a16149b658a9c92d9593689cb9a4f6fc
lib/codeql/rust/elements/internal/generated/ForType.qll 3d43d044a1189281f09c55caafb6c8020a836f49e2866077086101925a573cf2 646b59bfd1b428aaf7211f574c49f79cb4c6a79ca151aa0663b2b31480298721
lib/codeql/rust/elements/internal/generated/Format.qll 37ad20cf2bf363b4027a8913d095292c8a4eb8ccdf2a9965f2fb7d41930f9bfe 329b89cdd75ce951269273dd18897e32ff5cfcc94f451001c64143386c1e48dd
lib/codeql/rust/elements/internal/generated/FormatArgsArg.qll e07a1ae310f590003f1b88fada7dcf4847c99adb9d4c838d1c88e66e1da85c5f 0ef7342451fe2cb06e765fb4b33bb8c4a9b927f5edbc8feb5c6ba3655697f447
@@ -468,6 +472,7 @@ lib/codeql/rust/elements/internal/generated/InferType.qll 23ee25135c59ea5578cdf7
lib/codeql/rust/elements/internal/generated/Item.qll 25e645cb41222c21065798fb6cb0488bfef007aeb9b89717f58913f9b29d5559 3146941e55db2ff7c51ec030b4414e20d66d154cf6854b1a3fa42e74a09dfb77
lib/codeql/rust/elements/internal/generated/ItemList.qll 73c8398a96d4caa47a2dc114d76c657bd3fcc59e4c63cb397ffac4a85b8cf8ab 540a13ca68d414e3727c3d53c6b1cc97687994d572bc74b3df99ecc8b7d8e791
lib/codeql/rust/elements/internal/generated/Label.qll 6630fe16e9d2de6c759ff2684f5b9950bc8566a1525c835c131ebb26f3eea63e 671143775e811fd88ec90961837a6c0ee4db96e54f42efd80c5ae2571661f108
lib/codeql/rust/elements/internal/generated/LabelableExpr.qll 896fd165b438b60d7169e8f30fa2a94946490c4d284e1bbadfec4253b909ee6c 5c6b029ea0b22cf096df2b15fe6f9384ad3e65b50b253cae7f19a2e5ffb04a58
lib/codeql/rust/elements/internal/generated/LetElse.qll 7ca556118b5446bfc85abba8f0edd4970e029b30d414ea824a1b5f568310a76c a403540881336f9d0269cbcdb4b87107a17ab234a985247dc52a380f150a1641
lib/codeql/rust/elements/internal/generated/LetExpr.qll 9af0f89b294c8a0a751317e7074fe370339563d36c1df4911d1ea082a4df77fd 68272593d1feb88990bfbd0b8c222776f085e49694894384fc6d96e9464ba734
lib/codeql/rust/elements/internal/generated/LetStmt.qll aa1852db86ec29f857a90677f0c6b4a07f0fd965fc193d4141be95ce15862fca 40f32a37c0cc161b099fe0b4c7d713da928781d3e2c3de90db991df1d9062647
@@ -477,7 +482,8 @@ lib/codeql/rust/elements/internal/generated/LifetimeParam.qll bcbde38bfb99034e47
lib/codeql/rust/elements/internal/generated/LiteralExpr.qll f3a564d0a3ed0d915f5ab48e12246777e4972ad987cd9deaafeb94cf407b2877 2337c3d5f60361bd10f6aeca301e88255f5dffb85301cf36cbbfa1a65bfad1cd
lib/codeql/rust/elements/internal/generated/LiteralPat.qll ecc2bfe559abfce1be873fbf7b61b5728897c9afc3bb3f69551d8320d273da71 42196fb6a4a0ff9b570fd0bdbc920f24744b3f46772efbb46648af7fbfe1fbda
lib/codeql/rust/elements/internal/generated/Locatable.qll c897dc1bdd4dfcb6ded83a4a93332ca3d8f421bae02493ea2a0555023071775e b32d242f8c9480dc9b53c1e13a5cb8dcfce575b0373991c082c1db460a3e37b8
lib/codeql/rust/elements/internal/generated/LoopExpr.qll 22b755dfaf238ecea722c0c94c399992014e23481ec6fdd61f803bbec012b6f9 08731630c2dc05aa1e0ada222a6057752d9ce737329c62076708828247a358be
lib/codeql/rust/elements/internal/generated/LoopExpr.qll db6bc87e795c9852426ec661fa2c2c54106805897408b43a67f5b82fb4657afd 1492866ccf8213469be85bbdbcae0142f4e2a39df305d4c0d664229ecd1ebdb9
lib/codeql/rust/elements/internal/generated/LoopingExpr.qll 0792c38d84b8c68114da2bbdfef32ef803b696cb0fd06e10e101756d5c46976c 111fe961fad512722006323c3f2a075fddf59bd3eb5c7afc349835fcec8eb102
lib/codeql/rust/elements/internal/generated/MacroCall.qll fc8988696493992cc4fdce8c0e5610c54ee92ea52ebb05262338f8b612353f50 188a2d7a484bd402a521787371e64f6e00e928306c8d437e6b19bf890a7aa14e
lib/codeql/rust/elements/internal/generated/MacroDef.qll e9b3f07ba41aa12a8e0bd6ec1437b26a6c363065ce134b6d059478e96c2273a6 87470dea99da1a6afb3a19565291f9382e851ba864b50a995ac6f29589efbd70
lib/codeql/rust/elements/internal/generated/MacroExpr.qll 03a1daa41866f51e479ac20f51f8406d04e9946b24f3875e3cf75a6b172c3d35 1ae8ca0ee96bd2be32575d87c07cc999a6ff7770151b66c0e3406f9454153786
@@ -504,7 +510,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b
lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60
lib/codeql/rust/elements/internal/generated/ParenPat.qll ce24b8f8ecbf0f204af200317405724063887257460c80cf250c39b2fdf37185 e7c87d37e1a0ca7ea03840017e1aa9ddb7f927f1f3b6396c0305b46aeee33db6
lib/codeql/rust/elements/internal/generated/ParenType.qll 9cc954d73f8330dcac7b475f97748b63af5c8766dee9d2f2872c0a7e4c903537 c07534c8a9c683c4a9b11d490095647e420de0a0bfc23273eaf6f31b00244273
lib/codeql/rust/elements/internal/generated/ParentChild.qll b4d25c43ed44715053255c3c2f8aeb8d21826adc365f24026b2123a4f25cba86 1bc4bb0380a1a8b69055ffeac203b11b2a1b94e5ad88d1b32ff659e8feb26016
lib/codeql/rust/elements/internal/generated/ParentChild.qll 2237ba700c7d790cbbf7ad4d86889d22c6d210af62474ad8d363d79abb574722 36f9d47b002a241f0f793816ca9e6327fbbefb02268665553c56ded6012f82ec
lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4
lib/codeql/rust/elements/internal/generated/Path.qll f2b1be2f8f44001a6533533c978c4a9a8b7d64838d6f39eef5f0c0e7890611b8 d724a00a38f42429ffa8fb3bffbb5ec69e16a32ceeeb1d1f026fc7adf87424a8
lib/codeql/rust/elements/internal/generated/PathExpr.qll 2096e3c1db22ee488a761690adabfc9cfdea501c99f7c5d96c0019cb113fc506 54245ce0449c4e263173213df01e079d5168a758503a5dbd61b25ad35a311140
@@ -517,7 +523,7 @@ lib/codeql/rust/elements/internal/generated/PtrType.qll 40099c5a4041314b66932dfd
lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll ea294a3ba33fd1bc632046c4fedbcb84dcb961a8e4599969d65893b19d90e590 ea294a3ba33fd1bc632046c4fedbcb84dcb961a8e4599969d65893b19d90e590
lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9
lib/codeql/rust/elements/internal/generated/RangePat.qll efd93730de217cf50dcba5875595263a5eadf9f7e4e1272401342a094d158614 229b251b3d118932e31e78ac4dfb75f48b766f240f20d436062785606d44467b
lib/codeql/rust/elements/internal/generated/Raw.qll 5f83209cda8319c5c6c932631b60c6f2163d2d9cf7be63f63523e2206c01d004 3581039746e86365f37644e86ac2c89d67e2123aa1b039d9e0afdffc7156c96d
lib/codeql/rust/elements/internal/generated/Raw.qll 462d87edee9e0fc463f789a765e19d94c4c027a73db876ad306f918dd87e9511 33a6782598a6ba0e02e6b772b5b74ebbe609b0bc3a92180f85db7472e00aa8d9
lib/codeql/rust/elements/internal/generated/RecordExpr.qll eb6cb662e463f9260efae1a6ce874fa781172063b916ef1963f861e9942d308d 1a21cbccc8f3799ff13281e822818ebfb21d81591720a427cac3625512cb9d40
lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1
lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0
@@ -543,7 +549,7 @@ lib/codeql/rust/elements/internal/generated/Static.qll 5fbd6879858cf356d4bdaa6da
lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b
lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73
lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e
lib/codeql/rust/elements/internal/generated/Synth.qll 1ba88215c3f0640558a644534b954e4b93acb15a0f51a1e4887230f451718aa9 747eb3bec1c7245e59ea2b500604f5b4e614e4f061473d1a22fa398ee48ba080
lib/codeql/rust/elements/internal/generated/Synth.qll 0e5767568fd119df13928adf00950586f5f9f355dae520059b2d6daa7a2bda56 219b40f6458fec2cc436dc2cf80bb1dbfb34dfdbe8576606b5e25f78d36d6210
lib/codeql/rust/elements/internal/generated/SynthConstructors.qll e929c49ea60810a2bbc19ad38110b8bbaf21db54dae90393b21a3459a54abf6f e929c49ea60810a2bbc19ad38110b8bbaf21db54dae90393b21a3459a54abf6f
lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b
lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c
@@ -574,11 +580,11 @@ lib/codeql/rust/elements/internal/generated/VariantList.qll 4eb923ca341033c256ca
lib/codeql/rust/elements/internal/generated/Visibility.qll aba81820f30bed0fd2cd06831f7256af15ae32525b2a437896420b4cc067ea38 d6aed90b27124b812daf2ddd14b4e181277cbe638b4ccaab74e27681ac30e4ab
lib/codeql/rust/elements/internal/generated/WhereClause.qll d6c8f72bbec5d71c024f0d365c1c5e474f4d24ded0d34c56c1f66b1e4a384e9d ed14311d140eee00d3b26a4972f53e20d5af1bddf88fb5618e7e2d3ae1d816f3
lib/codeql/rust/elements/internal/generated/WherePred.qll 342050e824ca6eb6116488d46cfc03efa79193b4de6049e1f5d4a9fe527b3036 ed07a81de7d63f853c93cbb7291eea3d7169953e34c2f2f98b570028dd1f8cd9
lib/codeql/rust/elements/internal/generated/WhileExpr.qll fec8a9211b82a80601bf731db17409c5de6bf145295623bd86e28f96452fd91d 3916cf0c0e3b82b834727fc37809dd3e158f395bdf39971abe40b98e5f95a4d2
lib/codeql/rust/elements/internal/generated/WhileExpr.qll 7edf1f23fbf953a2baabcdbf753a20dff9cf2bc645dcf935f1e68f412971a8f7 d2fa7ada1f48f6b4566c75747584068e925be925d39d6e6ebf61d21bde3b6522
lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499
lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b
lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85
lib/codeql/rust/elements.qll 173d5ffbcc2874757033caab37559e84dbcbfed319730f8e41a4e9e10b146835 173d5ffbcc2874757033caab37559e84dbcbfed319730f8e41a4e9e10b146835
lib/codeql/rust/elements.qll 76fe494d20d2665777bcb5c5ced016a262789a0e6aa874c1a77ce4cb134422b6 76fe494d20d2665777bcb5c5ced016a262789a0e6aa874c1a77ce4cb134422b6
test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f
test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52
test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684
@@ -614,7 +620,7 @@ test/extractor-tests/generated/BinaryExpr/BinaryExpr_getAttr.ql 26d985ac4b668d78
test/extractor-tests/generated/BinaryExpr/BinaryExpr_getLhs.ql c3f19d8a60066ad6b1810291a669473c75b659cd2f6ac3ab9ed3db2203d4145c c05c5e0226e30f923155669ffc79cfe63af1ca464e8dfc85888dda5f7049711b
test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOperatorName.ql 33612159be1c111e3306009d0b04579450fc962a81119b6ea4e255d3c409b401 1a0995b298f50242217cfef81dca8ac978e19e06f90a5f4caadcb6f84460fec2
test/extractor-tests/generated/BinaryExpr/BinaryExpr_getRhs.ql 3bcd36b678e87d5c29a43b69c54c80468a89aefa7e69481b48158ae794a53160 a629dc1472b3f6fd7c608ff760e83d8e1363db81dfe9a4b2968690c2ba4925ca
test/extractor-tests/generated/BlockExpr/BlockExpr.ql 0ab66b190d4e2aa784e61088c4779ef4d08cb4453677ea087c4f9aa369494bc2 1c3b5794008114d1297695d82590220929e3974e27836b2c6062d14b73379a40
test/extractor-tests/generated/BlockExpr/BlockExpr.ql 19caa39aaa39356219dda740b7152f85e43a4f8d6295841e2c535c7e3bda7a5a bd668574ba41021e758e391d4790b871439badb2486ccf6a5aaf788ad6ae4142
test/extractor-tests/generated/BlockExpr/BlockExpr_getAttr.ql 15d4d9853d3262ce6ec629c075c60a76eb112dcafe34b71df0e09b39282223cf 792c498bc7079bb5b93034b8a87db3b275a591d78954e844821aeacffe4258ea
test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql de3c28a2677ed71ebd95207aa43ce270765f7f556283f095f1f6296622b80cbc 414ebbb2bfbe4350f933fc3d3636b49a6bb8242e200180780caf95ab8523adb0
test/extractor-tests/generated/BlockExpr/BlockExpr_getStmtList.ql 8c391dfeb69bd92c547a2417bf231cc960a8f34845802722214294728772316a f3e847fa594e9d9cf25d09a0396a10176aad1100c1977a24756ff6287a79e69e
@@ -698,7 +704,7 @@ test/extractor-tests/generated/FnPtrType/FnPtrType.ql 50b76d678582cd0b8d7cc4a765
test/extractor-tests/generated/FnPtrType/FnPtrType_getAbi.ql de1706382c2980c02dbdd295e0a2320c992afa3f19af0c2378b9980a7cd0c481 a3fa36711949d9d5ac53cc5dd39cb19b397c3f2e47c1d457df470c6e5142f9be
test/extractor-tests/generated/FnPtrType/FnPtrType_getParamList.ql 9ea393acf37919e2fd1bbc16e738440e00a56552bf80baef9bfd2a9a405afb93 3b4237b22eea569cef0081eb3ea16b2d0f01f8f070f21e16390267e9cbe0cf57
test/extractor-tests/generated/FnPtrType/FnPtrType_getRetType.ql 57f662e4778e1bf4103f061bb8085def0708528f94045c9ff4a95ce802fff13d 924b924c7d766458e956afa0963e6eb1bfc083e5f9aeae64cf2d08929f79612c
test/extractor-tests/generated/ForExpr/ForExpr.ql eff335a301b9a71292bb6da0dffdf901c7a51df9960e9250f9eb980aaaa0c7ae ce7ab100c21c6fc334a4445b2ee311ae6c67992ef659ca32c94d60ac884936e3
test/extractor-tests/generated/ForExpr/ForExpr.ql 1f8b7a9bbe7a8c077864be64dc51d91ec267c4f34f1cad80fc79902cc0af04ff ae999fb206b04ed81fa08bdd7617cbfe932c5e4109285e10108613cdebba8f7a
test/extractor-tests/generated/ForExpr/ForExpr_getAttr.ql d3399b7453e10ff48efc79ec38dd9b6e06bb472b9c39f559242d003e7f63b1d9 ba37e6bf129e1c2f9094e093bbfbf41864f2cb7725a64334f9443270dafdbfdc
test/extractor-tests/generated/ForExpr/ForExpr_getIterable.ql 90a6540f8a91cfe3ed1bdde1e680786ce5a00edbb797a8fe70bcc0507c438fcc 65c67ad5890aa502628ee73efd26bcbd4597a8bdfc9839233ede9e26393638f8
test/extractor-tests/generated/ForExpr/ForExpr_getLabel.ql ce90da75e040f448d524187357f3ceededba72407a84c1dc8e1498ed9788044d 0e23d43e0b3412fe90c6a5a4331f8da85eebe19e05b8c7d9710056857280797b
@@ -786,7 +792,7 @@ test/extractor-tests/generated/LiteralExpr/LiteralExpr_getAttr.ql 6e76da2bb7858f
test/extractor-tests/generated/LiteralExpr/LiteralExpr_getTextValue.ql 7049fec0bbbf0e048af1ff318f42f43d0f8a7354a5638dc21174c4ea725b54ce 2edc94cc0a7f58ec9808b63ddb4d20a3907c88e50bd9ffb14f0281b433f5621b
test/extractor-tests/generated/LiteralPat/LiteralPat.ql 3d3db6cad0eb13f84b69efa24a9f9a32d35c62582274d2751cc3ac54dca3b538 7feb64af87546ea64c139c61ac20176a99ad40b9949b361742a424b164fe6d54
test/extractor-tests/generated/LiteralPat/LiteralPat_getLiteral.ql 2cb03a22220e99237d4f3cd94d5090757cd6e57df708d32e80bca3964507651f 4dd9a6c1e23ad9851d9aa8c42c79535f7a2c7224bbaaff286eac7fd04b39c6f0
test/extractor-tests/generated/LoopExpr/LoopExpr.ql 636c28bff5f8c1ca0fb834f614b3215e02bdb00826fd8be26f9c4fa22c68a79a 1694c27850419d4edf366fe3f1d60fff578094adc3aeeb9691a3d6a8ec0100e1
test/extractor-tests/generated/LoopExpr/LoopExpr.ql 37b320acefa3734331f87414de270c98ab3309fe069d428550738197e3498a8c e744c25640b5c46aab53ce5114b789e13319572b0c99d0f2bc3c177849e61541
test/extractor-tests/generated/LoopExpr/LoopExpr_getAttr.ql d557c1a34ae8762b32702d6b50e79c25bc506275c33a896b6b94bbbe73d04c49 34846c9eefa0219f4a16e28b518b2afa23f372d0aa03b08d042c5a35375e0cd6
test/extractor-tests/generated/LoopExpr/LoopExpr_getLabel.ql 0b77b9d9fb5903d37bce5a2c0d6b276e6269da56fcb37b83cd931872fb88490f c7f09c526e59dcadec13ec9719980d68b8619d630caab2c26b8368b06c1f2cc0
test/extractor-tests/generated/LoopExpr/LoopExpr_getLoopBody.ql 0267f54077640f3dfeb38524577e4a1229115eeb1c839398d0c5f460c1d65129 96ec876635b8c561f7add19e57574444f630eae3df9ab9bc33ac180e61f3a7b8
@@ -1100,7 +1106,7 @@ test/extractor-tests/generated/WherePred/WherePred_getGenericParamList.ql 21c3aa
test/extractor-tests/generated/WherePred/WherePred_getLifetime.ql e08d9d6cccf634746f42a6ee583bbb3e7e9a9edbb63242e73b2bff4463df55d8 139543750c18f88d9c1ad2cdbcf1699d597cf2264bbb6b02a7e5792444e277ef
test/extractor-tests/generated/WherePred/WherePred_getTy.ql 34cee0335bbaf8946fe15e3c32449150d07a730fcca56b4faed554fbb8689e21 883976c8c27c276c402d591ebd89d076c2c4d8da4d4f738f3c860c34d4a03b97
test/extractor-tests/generated/WherePred/WherePred_getTypeBoundList.ql c78e31ff4d1822a6b76f403e5ccb8f5529b4f784e14e618833df0378adca55fc 8bb1c9b5a1cfca0f5e8335464f7439aa098063176fbd3edbaf3407169f1899e6
test/extractor-tests/generated/WhileExpr/WhileExpr.ql e061fac7584adf999d31ed0785041e2cc14b26a1c9901281f90c859335d8f614 fb1e597e28841e3b2d275d697aa6de7158db51b70a348d634291a75b25e4e80a
test/extractor-tests/generated/WhileExpr/WhileExpr.ql 61c49414f2ed786a68b79bd9a77093e4086457edb6c136cf8a94f2ac830c2f5b 7737f724a297d011c12143e009a63926812c63c08a1067b03e8677697ab00f83
test/extractor-tests/generated/WhileExpr/WhileExpr_getAttr.ql f8527130eb2492743c0e629c97db291abcefe3d35302c840fee327ab0d8f10fd b41bedd429e5566fd68a50140ff1f50b51e2c7c351cbc8253fbc126527073f7e
test/extractor-tests/generated/WhileExpr/WhileExpr_getCondition.ql 84a021806423425b24eaeb9fb9967a6aadabe823c24e77a0dfefcb3509041597 147aa8bbe4dbf9b90be2467db8207dc96aed281e722eb6b9c998442a90911a6c
test/extractor-tests/generated/WhileExpr/WhileExpr_getLabel.ql 60ef4de57d85c7df23c0518b944b3839a9b2478044326829b5bf709a8c8d7240 3916e9ff50733c58afdc09837339b72a555a043f92f1c4e09e1652866029b017

6
rust/ql/.gitattributes generated vendored
View File

@@ -61,6 +61,7 @@
/lib/codeql/rust/elements/Item.qll linguist-generated
/lib/codeql/rust/elements/ItemList.qll linguist-generated
/lib/codeql/rust/elements/Label.qll linguist-generated
/lib/codeql/rust/elements/LabelableExpr.qll linguist-generated
/lib/codeql/rust/elements/LetElse.qll linguist-generated
/lib/codeql/rust/elements/LetExpr.qll linguist-generated
/lib/codeql/rust/elements/LetStmt.qll linguist-generated
@@ -71,6 +72,7 @@
/lib/codeql/rust/elements/LiteralPat.qll linguist-generated
/lib/codeql/rust/elements/Locatable.qll linguist-generated
/lib/codeql/rust/elements/LoopExpr.qll linguist-generated
/lib/codeql/rust/elements/LoopingExpr.qll linguist-generated
/lib/codeql/rust/elements/MacroCall.qll linguist-generated
/lib/codeql/rust/elements/MacroDef.qll linguist-generated
/lib/codeql/rust/elements/MacroExpr.qll linguist-generated
@@ -186,6 +188,7 @@
/lib/codeql/rust/elements/internal/BecomeExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/BinaryExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/BlockExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/BlockExprImpl.qll linguist-generated
/lib/codeql/rust/elements/internal/BoxPatConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/BreakExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll linguist-generated
@@ -258,6 +261,7 @@
/lib/codeql/rust/elements/internal/LiteralExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/LiteralPatConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/LoopExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/LoopingExprImpl.qll linguist-generated
/lib/codeql/rust/elements/internal/MacroCallConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/MacroDefConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/MacroDefImpl.qll linguist-generated
@@ -470,6 +474,7 @@
/lib/codeql/rust/elements/internal/generated/Item.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/ItemList.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/Label.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LabelableExpr.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LetElse.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LetExpr.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LetStmt.qll linguist-generated
@@ -480,6 +485,7 @@
/lib/codeql/rust/elements/internal/generated/LiteralPat.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/Locatable.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LoopExpr.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/LoopingExpr.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/MacroCall.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/MacroDef.qll linguist-generated
/lib/codeql/rust/elements/internal/generated/MacroExpr.qll linguist-generated

View File

@@ -64,6 +64,7 @@ import codeql.rust.elements.InferType
import codeql.rust.elements.Item
import codeql.rust.elements.ItemList
import codeql.rust.elements.Label
import codeql.rust.elements.LabelableExpr
import codeql.rust.elements.LetElse
import codeql.rust.elements.LetExpr
import codeql.rust.elements.LetStmt
@@ -74,6 +75,7 @@ import codeql.rust.elements.LiteralExpr
import codeql.rust.elements.LiteralPat
import codeql.rust.elements.Locatable
import codeql.rust.elements.LoopExpr
import codeql.rust.elements.LoopingExpr
import codeql.rust.elements.MacroCall
import codeql.rust.elements.MacroDef
import codeql.rust.elements.MacroExpr

View File

@@ -5,8 +5,7 @@
private import internal.BlockExprImpl
import codeql.rust.elements.Attr
import codeql.rust.elements.Expr
import codeql.rust.elements.Label
import codeql.rust.elements.LabelableExpr
import codeql.rust.elements.StmtList
/**

View File

@@ -5,9 +5,8 @@
private import internal.ForExprImpl
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.Expr
import codeql.rust.elements.Label
import codeql.rust.elements.LoopingExpr
import codeql.rust.elements.Pat
/**

View File

@@ -0,0 +1,13 @@
// generated by codegen, do not edit
/**
* This module provides the public class `LabelableExpr`.
*/
private import internal.LabelableExprImpl
import codeql.rust.elements.Expr
import codeql.rust.elements.Label
/**
* The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
*/
final class LabelableExpr = Impl::LabelableExpr;

View File

@@ -5,9 +5,7 @@
private import internal.LoopExprImpl
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.Expr
import codeql.rust.elements.Label
import codeql.rust.elements.LoopingExpr
/**
* A loop expression. For example:

View File

@@ -0,0 +1,13 @@
// generated by codegen, do not edit
/**
* This module provides the public class `LoopingExpr`.
*/
private import internal.LoopingExprImpl
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.LabelableExpr
/**
* The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`).
*/
final class LoopingExpr = Impl::LoopingExpr;

View File

@@ -5,9 +5,8 @@
private import internal.WhileExprImpl
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.Expr
import codeql.rust.elements.Label
import codeql.rust.elements.LoopingExpr
/**
* A WhileExpr. For example:

View File

@@ -22,6 +22,6 @@ module Impl {
* ```
*/
class AwaitExpr extends Generated::AwaitExpr {
override string toString() { result = "await ..." }
override string toString() { result = "await " + this.getExpr().toAbbreviatedString() }
}
}

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class BecomeExpr extends Generated::BecomeExpr {
override string toString() { result = "become ..." }
override string toString() { result = "become " + this.getExpr().toAbbreviatedString() }
}
}

View File

@@ -1,3 +1,4 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `BlockExpr`.
*
@@ -11,7 +12,6 @@ private import codeql.rust.elements.internal.generated.BlockExpr
* be referenced directly.
*/
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A block expression. For example:
* ```rust
@@ -26,7 +26,5 @@ module Impl {
* }
* ```
*/
class BlockExpr extends Generated::BlockExpr {
override string toString() { result = "{ ... }" }
}
class BlockExpr extends Generated::BlockExpr { }
}

View File

@@ -22,6 +22,6 @@ module Impl {
* ```
*/
class BoxPat extends Generated::BoxPat {
override string toString() { result = "box ..." }
override string toString() { result = "box " + this.getPat().toAbbreviatedString() }
}
}

View File

@@ -5,6 +5,7 @@
*/
private import codeql.rust.elements.internal.generated.BreakExpr
import codeql.rust.elements.LabelableExpr
/**
* INTERNAL: This module contains the customizable definition of `BreakExpr` and should not
@@ -103,16 +104,14 @@ module Impl {
)
}
override string toString() {
exists(string label, string expr |
(
label = " " + this.getLifetime().toString()
or
not this.hasLifetime() and label = ""
) and
(if this.hasExpr() then expr = " ..." else expr = "") and
result = "break" + label + expr
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "break"
or
index = 1 and result = this.getLifetime().toString()
or
index = 2 and result = this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -23,15 +23,6 @@ module Impl {
* ```
*/
class CallExpr extends Generated::CallExpr {
override string toString() {
exists(string callee |
(
callee = this.getExpr().(PathExpr).toString()
or
not this.getExpr() instanceof PathExpr and callee = "..."
) and
result = callee + "(...)"
)
}
override string toString() { result = this.getExpr().toAbbreviatedString() + "(...)" }
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class CastExpr extends Generated::CastExpr {
override string toString() { result = "... as " + this.getTy().toString() }
override string toString() {
result = this.getExpr().toAbbreviatedString() + " as " + this.getTy().toString()
}
}
}

View File

@@ -25,6 +25,6 @@ module Impl {
* ```
*/
class ClosureExpr extends Generated::ClosureExpr {
override string toString() { result = "|...| ..." }
override string toString() { result = "|...| " + this.getBody().toAbbreviatedString() }
}
}

View File

@@ -49,15 +49,12 @@ module Impl {
* ```
*/
class ContinueExpr extends Generated::ContinueExpr {
override string toString() {
exists(string label |
(
label = " " + this.getLifetime().getText()
or
not this.hasLifetime() and label = ""
) and
result = "continue" + label
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "continue"
or
index = 1 and result = this.getLifetime().toString()
}
/**
@@ -66,7 +63,7 @@ module Impl {
* The target is either a `LoopExpr`, a `ForExpr`, or a `WhileExpr`.
*/
pragma[nomagic]
Expr getTarget() {
LoopingExpr getTarget() {
exists(string label |
result = getAContinueAncestor(this, label) and
BreakExprImpl::isLabelledLoop(result, label)

View File

@@ -14,6 +14,14 @@ module Impl {
class Element extends Generated::Element {
override string toString() { result = this.getAPrimaryQlClass() }
/**
* Returns a string suitable to be inserted into the name of the parent. Typically `"..."`,
* but may be overridden by subclasses.
*
* INTERNAL: Do not use.
*/
string toAbbreviatedString() { result = "..." }
predicate isUnknown() { none() } // compatibility with test generation, to be fixed
}
}

View File

@@ -19,6 +19,12 @@ module Impl {
* ```
*/
class FieldExpr extends Generated::FieldExpr {
override string toString() { result = "... ." + this.getNameRef().toString() }
override string toString() {
exists(string abbr, string name |
abbr = this.getExpr().toAbbreviatedString() and
name = this.getNameRef().toString() and
if abbr = "..." then result = "... ." + name else result = abbr + "." + name
)
}
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class ForExpr extends Generated::ForExpr {
override string toString() { result = "for " + this.getPat().toString() + " in ... { ... }" }
override string toStringPrefix() {
result = "for " + this.getPat().toAbbreviatedString() + " in ..."
}
}
}

View File

@@ -28,11 +28,16 @@ module Impl {
* ```
*/
class IfExpr extends Generated::IfExpr {
override string toString() {
exists(string elseString |
(if this.hasElse() then elseString = " else { ... }" else elseString = "") and
result = "if ... { ... }" + elseString
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "if"
or
index = 1 and result = this.getCondition().toAbbreviatedString()
or
index = 2 and result = "{...}"
or
index = 3 and this.hasElse() and result = "else {...}"
}
}
}

View File

@@ -20,6 +20,9 @@ module Impl {
* ```
*/
class IndexExpr extends Generated::IndexExpr {
override string toString() { result = "...[...]" }
override string toString() {
result =
this.getBase().toAbbreviatedString() + "[" + this.getIndex().toAbbreviatedString() + "]"
}
}
}

View File

@@ -0,0 +1,30 @@
/**
* This module provides a hand-modifiable wrapper around the generated class `LabelableExpr`.
*
* INTERNAL: Do not use.
*/
private import codeql.rust.elements.internal.generated.LabelableExpr
/**
* INTERNAL: This module contains the customizable definition of `LabelableExpr` and should not
* be referenced directly.
*/
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
*/
class LabelableExpr extends Generated::LabelableExpr {
override string toString() {
result = concat([this.getLabel().toString() + ":", this.toStringPrefix(), "{ ... }"], " ")
}
/**
* Get the prefix for the string representation of this element.
*
* INTERNAL: Do not use.
*/
string toStringPrefix() { none() }
}
}

View File

@@ -21,11 +21,14 @@ module Impl {
* ```
*/
class LetExpr extends Generated::LetExpr {
override string toString() {
exists(string expr |
(if this.hasExpr() then expr = " = ..." else expr = "") and
result = "let " + this.getPat().toString() + expr
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "let"
or
index = 1 and result = this.getPat().toAbbreviatedString()
or
index = 2 and result = "= " + this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -26,12 +26,16 @@ module Impl {
* ```
*/
class LetStmt extends Generated::LetStmt {
override string toString() {
exists(string expr, string elseStr |
(if this.hasInitializer() then expr = " = ..." else expr = "") and
(if this.hasLetElse() then elseStr = " else { ... }" else elseStr = "") and
result = "let " + this.getPat().toString() + expr + elseStr
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "let"
or
index = 1 and result = this.getPat().toAbbreviatedString()
or
index = 2 and result = "= " + this.getInitializer().toAbbreviatedString()
or
index = 3 and result = this.getLetElse().toString()
}
}
}

View File

@@ -27,5 +27,7 @@ module Impl {
*/
class LiteralExpr extends Generated::LiteralExpr {
override string toString() { result = this.getTextValue() }
override string toAbbreviatedString() { result = this.getTextValue() }
}
}

View File

@@ -22,6 +22,8 @@ module Impl {
* ```
*/
class LiteralPat extends Generated::LiteralPat {
override string toString() { result = this.getLiteral().toString() }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getLiteral().toString() }
}
}

View File

@@ -37,6 +37,6 @@ module Impl {
* ```
*/
class LoopExpr extends Generated::LoopExpr {
override string toString() { result = "loop {...}" }
override string toStringPrefix() { result = "loop" }
}
}

View File

@@ -0,0 +1,19 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `LoopingExpr`.
*
* INTERNAL: Do not use.
*/
private import codeql.rust.elements.internal.generated.LoopingExpr
/**
* INTERNAL: This module contains the customizable definition of `LoopingExpr` and should not
* be referenced directly.
*/
module Impl {
/**
* The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`).
*/
class LoopingExpr extends Generated::LoopingExpr { }
}

View File

@@ -28,11 +28,16 @@ module Impl {
* ```
*/
class MatchArm extends Generated::MatchArm {
override string toString() {
exists(string guard |
(if this.hasGuard() then guard = "if ... " else guard = "") and
result = this.getPat().toString() + guard + " => ..."
)
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getPat().toAbbreviatedString()
or
index = 1 and result = "if " + this.getGuard().toAbbreviatedString()
or
index = 2 and result = "=>"
or
index = 3 and result = this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -28,7 +28,9 @@ module Impl {
* ```
*/
class MatchExpr extends Generated::MatchExpr {
override string toString() { result = "match ... { ... }" }
override string toString() {
result = "match " + this.getExpr().toAbbreviatedString() + " { ... }"
}
/**
* Gets the `index`th arm of this match expression.

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class NeverType extends Generated::NeverType {
override string toString() { result = "!" }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "!" }
}
}

View File

@@ -21,7 +21,9 @@ module Impl {
* ```
*/
class OrPat extends Generated::OrPat {
override string toString() { result = "... | ..." }
override string toString() {
result = concat(int i | | this.getPat(i).toAbbreviatedString() order by i, " | ")
}
/** Gets the last pattern in this or pattern. */
pragma[nomagic]

View File

@@ -19,15 +19,12 @@ module Impl {
* ```
*/
class Param extends Generated::Param {
override string toString() {
exists(string ty |
(
ty = ": " + this.getTy().toString()
or
not this.hasTy() and ty = ""
) and
result = this.getPat().toString() + ty
)
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getPat().toAbbreviatedString()
or
index = 1 and result = ": " + this.getTy().toAbbreviatedString()
}
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenExpr extends Generated::ParenExpr {
override string toString() { result = "(...)" }
override string toString() { result = "(" + this.getExpr().toAbbreviatedString() + ")" }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenPat extends Generated::ParenPat {
override string toString() { result = "(...)" }
override string toString() { result = "(" + this.getPat().toAbbreviatedString() + ")" }
}
}

View File

@@ -19,6 +19,6 @@ module Impl {
* ```
*/
class ParenType extends Generated::ParenType {
override string toString() { result = "(...)" }
override string toString() { result = "(" + this.getTy().toAbbreviatedString() + ")" }
}
}

View File

@@ -22,6 +22,8 @@ module Impl {
* ```
*/
class PathExpr extends Generated::PathExpr {
override string toString() { result = this.getPath().toString() }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toString() }
}
}

View File

@@ -19,10 +19,14 @@ module Impl {
* ```
*/
class Path extends Generated::Path {
override string toString() {
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() {
if this.hasQualifier()
then result = this.getQualifier().toString() + "::" + this.getPart().toString()
else result = this.getPart().toString()
then
result =
this.getQualifier().toAbbreviatedString() + "::" + this.getPart().toAbbreviatedString()
else result = this.getPart().toAbbreviatedString()
}
}
}

View File

@@ -22,6 +22,8 @@ module Impl {
* ```
*/
class PathPat extends Generated::PathPat {
override string toString() { result = this.getPath().toString() }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toString() }
}
}

View File

@@ -19,7 +19,9 @@ module Impl {
* ```
*/
class PathSegment extends Generated::PathSegment {
override string toString() {
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() {
// TODO: this does not cover everything
if this.hasGenericArgList()
then result = this.getNameRef().toString() + "::<...>"

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class PathType extends Generated::PathType {
override string toString() { result = this.getPath().toString() }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = this.getPath().toString() }
}
}

View File

@@ -24,6 +24,28 @@ module Impl {
* ```
*/
class RangeExpr extends Generated::RangeExpr {
override string toString() { result = "... " + this.getOperatorName().toString() + " ..." }
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getStartAbbreviation()
or
index = 1 and result = this.getOperatorName()
or
index = 2 and result = this.getEndAbbreviation()
}
private string getStartAbbreviation() {
exists(string abbr |
abbr = this.getStart().toAbbreviatedString() and
if abbr = "..." then result = "... " else result = abbr
)
}
private string getEndAbbreviation() {
exists(string abbr |
abbr = this.getEnd().toAbbreviatedString() and
if abbr = "..." then result = " ..." else result = abbr
)
}
}
}

View File

@@ -19,11 +19,12 @@ module Impl {
* ```
*/
class RecordExprField extends Generated::RecordExprField {
override string toString() {
exists(string init |
(if this.hasExpr() then init = ": ..." else init = "") and
result = this.getNameRef().toString() + init
)
override string toString() { result = concat(int i | | this.toStringPart(i) order by i) }
private string toStringPart(int index) {
index = 0 and result = this.getNameRef().toString()
or
index = 1 and result = ": " + this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -23,12 +23,17 @@ module Impl {
*/
class RefExpr extends Generated::RefExpr {
override string toString() {
exists(string raw, string const, string mut |
(if this.isRaw() then raw = "raw " else raw = "") and
(if this.isConst() then const = "const " else const = "") and
(if this.isMut() then mut = "mut " else mut = "") and
result = "&" + raw + const + mut + "..."
)
result = "&" + concat(int i | | this.getSpecPart(i), " " order by i)
}
private string getSpecPart(int index) {
index = 0 and this.isRaw() and result = "raw"
or
index = 1 and this.isConst() and result = "const"
or
index = 2 and this.isMut() and result = "mut"
or
index = 3 and result = this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -23,10 +23,13 @@ module Impl {
*/
class RefPat extends Generated::RefPat {
override string toString() {
exists(string mut |
(if this.isMut() then mut = "mut " else mut = "") and
result = "&" + mut + "..."
)
result = "&" + concat(int i | | this.getSpecPart(i), " " order by i)
}
private string getSpecPart(int index) {
index = 0 and this.isMut() and result = "mut"
or
index = 1 and result = this.getPat().toAbbreviatedString()
}
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class RestPat extends Generated::RestPat {
override string toString() { result = ".." }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = ".." }
}
}

View File

@@ -26,8 +26,12 @@ module Impl {
* ```
*/
class ReturnExpr extends Generated::ReturnExpr {
override string toString() {
if this.hasExpr() then result = "return ..." else result = "return"
override string toString() { result = concat(int i | | this.toStringPart(i), " " order by i) }
private string toStringPart(int index) {
index = 0 and result = "return"
or
index = 1 and result = this.getExpr().toAbbreviatedString()
}
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class UnderscoreExpr extends Generated::UnderscoreExpr {
override string toString() { result = "_" }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "_" }
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class WhileExpr extends Generated::WhileExpr {
override string toString() { result = "while ... { ... }" }
override string toStringPrefix() {
result = "while " + this.getCondition().toAbbreviatedString()
}
}
}

View File

@@ -19,6 +19,8 @@ module Impl {
* ```
*/
class WildcardPat extends Generated::WildcardPat {
override string toString() { result = "_" }
override string toString() { result = this.toAbbreviatedString() }
override string toAbbreviatedString() { result = "_" }
}
}

View File

@@ -7,8 +7,7 @@
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.Attr
import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl
import codeql.rust.elements.Label
import codeql.rust.elements.internal.LabelableExprImpl::Impl as LabelableExprImpl
import codeql.rust.elements.StmtList
/**
@@ -32,7 +31,7 @@ module Generated {
* INTERNAL: Do not reference the `Generated::BlockExpr` class directly.
* Use the subclass `BlockExpr`, where the following predicates are available.
*/
class BlockExpr extends Synth::TBlockExpr, ExprImpl::Expr {
class BlockExpr extends Synth::TBlockExpr, LabelableExprImpl::LabelableExpr {
override string getAPrimaryQlClass() { result = "BlockExpr" }
/**
@@ -83,19 +82,6 @@ module Generated {
*/
predicate isUnsafe() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isUnsafe() }
/**
* Gets the label of this block expression, if it exists.
*/
Label getLabel() {
result =
Synth::convertLabelFromRaw(Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).getLabel())
}
/**
* Holds if `getLabel()` exists.
*/
final predicate hasLabel() { exists(this.getLabel()) }
/**
* Gets the statement list of this block expression, if it exists.
*/

View File

@@ -7,10 +7,8 @@
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.Expr
import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl
import codeql.rust.elements.Label
import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl
import codeql.rust.elements.Pat
/**
@@ -26,7 +24,7 @@ module Generated {
* INTERNAL: Do not reference the `Generated::ForExpr` class directly.
* Use the subclass `ForExpr`, where the following predicates are available.
*/
class ForExpr extends Synth::TForExpr, ExprImpl::Expr {
class ForExpr extends Synth::TForExpr, LoopingExprImpl::LoopingExpr {
override string getAPrimaryQlClass() { result = "ForExpr" }
/**
@@ -60,32 +58,6 @@ module Generated {
*/
final predicate hasIterable() { exists(this.getIterable()) }
/**
* Gets the label of this for expression, if it exists.
*/
Label getLabel() {
result =
Synth::convertLabelFromRaw(Synth::convertForExprToRaw(this).(Raw::ForExpr).getLabel())
}
/**
* Holds if `getLabel()` exists.
*/
final predicate hasLabel() { exists(this.getLabel()) }
/**
* Gets the loop body of this for expression, if it exists.
*/
BlockExpr getLoopBody() {
result =
Synth::convertBlockExprFromRaw(Synth::convertForExprToRaw(this).(Raw::ForExpr).getLoopBody())
}
/**
* Holds if `getLoopBody()` exists.
*/
final predicate hasLoopBody() { exists(this.getLoopBody()) }
/**
* Gets the pat of this for expression, if it exists.
*/

View File

@@ -0,0 +1,38 @@
// generated by codegen, do not edit
/**
* This module provides the generated definition of `LabelableExpr`.
* INTERNAL: Do not import directly.
*/
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl
import codeql.rust.elements.Label
/**
* INTERNAL: This module contains the fully generated definition of `LabelableExpr` and should not
* be referenced directly.
*/
module Generated {
/**
* The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
* INTERNAL: Do not reference the `Generated::LabelableExpr` class directly.
* Use the subclass `LabelableExpr`, where the following predicates are available.
*/
class LabelableExpr extends Synth::TLabelableExpr, ExprImpl::Expr {
/**
* Gets the label of this labelable expression, if it exists.
*/
Label getLabel() {
result =
Synth::convertLabelFromRaw(Synth::convertLabelableExprToRaw(this)
.(Raw::LabelableExpr)
.getLabel())
}
/**
* Holds if `getLabel()` exists.
*/
final predicate hasLabel() { exists(this.getLabel()) }
}
}

View File

@@ -7,9 +7,7 @@
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl
import codeql.rust.elements.Label
import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl
/**
* INTERNAL: This module contains the fully generated definition of `LoopExpr` and should not
@@ -42,7 +40,7 @@ module Generated {
* INTERNAL: Do not reference the `Generated::LoopExpr` class directly.
* Use the subclass `LoopExpr`, where the following predicates are available.
*/
class LoopExpr extends Synth::TLoopExpr, ExprImpl::Expr {
class LoopExpr extends Synth::TLoopExpr, LoopingExprImpl::LoopingExpr {
override string getAPrimaryQlClass() { result = "LoopExpr" }
/**
@@ -62,33 +60,5 @@ module Generated {
* Gets the number of attrs of this loop expression.
*/
final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) }
/**
* Gets the label of this loop expression, if it exists.
*/
Label getLabel() {
result =
Synth::convertLabelFromRaw(Synth::convertLoopExprToRaw(this).(Raw::LoopExpr).getLabel())
}
/**
* Holds if `getLabel()` exists.
*/
final predicate hasLabel() { exists(this.getLabel()) }
/**
* Gets the loop body of this loop expression, if it exists.
*/
BlockExpr getLoopBody() {
result =
Synth::convertBlockExprFromRaw(Synth::convertLoopExprToRaw(this)
.(Raw::LoopExpr)
.getLoopBody())
}
/**
* Holds if `getLoopBody()` exists.
*/
final predicate hasLoopBody() { exists(this.getLoopBody()) }
}
}

View File

@@ -0,0 +1,38 @@
// generated by codegen, do not edit
/**
* This module provides the generated definition of `LoopingExpr`.
* INTERNAL: Do not import directly.
*/
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.internal.LabelableExprImpl::Impl as LabelableExprImpl
/**
* INTERNAL: This module contains the fully generated definition of `LoopingExpr` and should not
* be referenced directly.
*/
module Generated {
/**
* The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`).
* INTERNAL: Do not reference the `Generated::LoopingExpr` class directly.
* Use the subclass `LoopingExpr`, where the following predicates are available.
*/
class LoopingExpr extends Synth::TLoopingExpr, LabelableExprImpl::LabelableExpr {
/**
* Gets the loop body of this looping expression, if it exists.
*/
BlockExpr getLoopBody() {
result =
Synth::convertBlockExprFromRaw(Synth::convertLoopingExprToRaw(this)
.(Raw::LoopingExpr)
.getLoopBody())
}
/**
* Holds if `getLoopBody()` exists.
*/
final predicate hasLoopBody() { exists(this.getLoopBody()) }
}
}

View File

@@ -1397,29 +1397,6 @@ private module Impl {
)
}
private Element getImmediateChildOfBlockExpr(BlockExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nAttr, int nLabel, int nStmtList |
b = 0 and
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
n = bExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nLabel = nAttr + 1 and
nStmtList = nLabel + 1 and
(
none()
or
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getLabel() and partialPredicateCall = "Label()"
or
index = nLabel and result = e.getStmtList() and partialPredicateCall = "StmtList()"
)
)
}
private Element getImmediateChildOfBoxPat(BoxPat e, int index, string partialPredicateCall) {
exists(int b, int bPat, int n, int nPat |
b = 0 and
@@ -1708,35 +1685,6 @@ private module Impl {
)
}
private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nAttr, int nIterable, int nLabel, int nLoopBody, int nPat |
b = 0 and
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
n = bExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nIterable = nAttr + 1 and
nLabel = nIterable + 1 and
nLoopBody = nLabel + 1 and
nPat = nLoopBody + 1 and
(
none()
or
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()"
or
index = nIterable and result = e.getLabel() and partialPredicateCall = "Label()"
or
index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()"
or
index = nLoopBody and result = e.getPat() and partialPredicateCall = "Pat()"
)
)
}
private Element getImmediateChildOfForType(ForType e, int index, string partialPredicateCall) {
exists(int b, int bTypeRef, int n, int nGenericParamList, int nTy |
b = 0 and
@@ -1900,6 +1848,24 @@ private module Impl {
)
}
private Element getImmediateChildOfLabelableExpr(
LabelableExpr e, int index, string partialPredicateCall
) {
exists(int b, int bExpr, int n, int nLabel |
b = 0 and
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
n = bExpr and
nLabel = n + 1 and
(
none()
or
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
or
index = n and result = e.getLabel() and partialPredicateCall = "Label()"
)
)
}
private Element getImmediateChildOfLetExpr(LetExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nAttr, int nExpr, int nPat |
b = 0 and
@@ -2034,29 +2000,6 @@ private module Impl {
)
}
private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nAttr, int nLabel, int nLoopBody |
b = 0 and
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
n = bExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nLabel = nAttr + 1 and
nLoopBody = nLabel + 1 and
(
none()
or
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getLabel() and partialPredicateCall = "Label()"
or
index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()"
)
)
}
private Element getImmediateChildOfMacroExpr(MacroExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nMacroCall |
b = 0 and
@@ -2748,32 +2691,6 @@ private module Impl {
)
}
private Element getImmediateChildOfWhileExpr(WhileExpr e, int index, string partialPredicateCall) {
exists(int b, int bExpr, int n, int nAttr, int nCondition, int nLabel, int nLoopBody |
b = 0 and
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
n = bExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nCondition = nAttr + 1 and
nLabel = nCondition + 1 and
nLoopBody = nLabel + 1 and
(
none()
or
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getCondition() and partialPredicateCall = "Condition()"
or
index = nCondition and result = e.getLabel() and partialPredicateCall = "Label()"
or
index = nLabel and result = e.getLoopBody() and partialPredicateCall = "LoopBody()"
)
)
}
private Element getImmediateChildOfWildcardPat(
WildcardPat e, int index, string partialPredicateCall
) {
@@ -2829,6 +2746,27 @@ private module Impl {
)
}
private Element getImmediateChildOfBlockExpr(BlockExpr e, int index, string partialPredicateCall) {
exists(int b, int bLabelableExpr, int n, int nAttr, int nStmtList |
b = 0 and
bLabelableExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLabelableExpr(e, i, _)) | i) and
n = bLabelableExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nStmtList = nAttr + 1 and
(
none()
or
result = getImmediateChildOfLabelableExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getStmtList() and partialPredicateCall = "StmtList()"
)
)
}
private Element getImmediateChildOfCallExpr(CallExpr e, int index, string partialPredicateCall) {
exists(int b, int bCallExprBase, int n, int nExpr |
b = 0 and
@@ -3087,6 +3025,25 @@ private module Impl {
)
}
private Element getImmediateChildOfLoopingExpr(
LoopingExpr e, int index, string partialPredicateCall
) {
exists(int b, int bLabelableExpr, int n, int nLoopBody |
b = 0 and
bLabelableExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLabelableExpr(e, i, _)) | i) and
n = bLabelableExpr and
nLoopBody = n + 1 and
(
none()
or
result = getImmediateChildOfLabelableExpr(e, index - b, partialPredicateCall)
or
index = n and result = e.getLoopBody() and partialPredicateCall = "LoopBody()"
)
)
}
private Element getImmediateChildOfMacroCall(MacroCall e, int index, string partialPredicateCall) {
exists(
int b, int bAssocItem, int bExternItem, int bItem, int n, int nAttr, int nPath,
@@ -3535,6 +3492,69 @@ private module Impl {
)
}
private Element getImmediateChildOfForExpr(ForExpr e, int index, string partialPredicateCall) {
exists(int b, int bLoopingExpr, int n, int nAttr, int nIterable, int nPat |
b = 0 and
bLoopingExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and
n = bLoopingExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nIterable = nAttr + 1 and
nPat = nIterable + 1 and
(
none()
or
result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getIterable() and partialPredicateCall = "Iterable()"
or
index = nIterable and result = e.getPat() and partialPredicateCall = "Pat()"
)
)
}
private Element getImmediateChildOfLoopExpr(LoopExpr e, int index, string partialPredicateCall) {
exists(int b, int bLoopingExpr, int n, int nAttr |
b = 0 and
bLoopingExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and
n = bLoopingExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
(
none()
or
result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
)
)
}
private Element getImmediateChildOfWhileExpr(WhileExpr e, int index, string partialPredicateCall) {
exists(int b, int bLoopingExpr, int n, int nAttr, int nCondition |
b = 0 and
bLoopingExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLoopingExpr(e, i, _)) | i) and
n = bLoopingExpr and
nAttr = n + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and
nCondition = nAttr + 1 and
(
none()
or
result = getImmediateChildOfLoopingExpr(e, index - b, partialPredicateCall)
or
result = e.getAttr(index - n) and
partialPredicateCall = "Attr(" + (index - n).toString() + ")"
or
index = nAttr and result = e.getCondition() and partialPredicateCall = "Condition()"
)
)
}
cached
Element getImmediateChild(Element e, int index, string partialAccessor) {
// why does this look more complicated than it should?
@@ -3655,8 +3675,6 @@ private module Impl {
or
result = getImmediateChildOfBinaryExpr(e, index, partialAccessor)
or
result = getImmediateChildOfBlockExpr(e, index, partialAccessor)
or
result = getImmediateChildOfBoxPat(e, index, partialAccessor)
or
result = getImmediateChildOfBreakExpr(e, index, partialAccessor)
@@ -3683,8 +3701,6 @@ private module Impl {
or
result = getImmediateChildOfFnPtrType(e, index, partialAccessor)
or
result = getImmediateChildOfForExpr(e, index, partialAccessor)
or
result = getImmediateChildOfForType(e, index, partialAccessor)
or
result = getImmediateChildOfFormatArgsExpr(e, index, partialAccessor)
@@ -3711,8 +3727,6 @@ private module Impl {
or
result = getImmediateChildOfLiteralPat(e, index, partialAccessor)
or
result = getImmediateChildOfLoopExpr(e, index, partialAccessor)
or
result = getImmediateChildOfMacroExpr(e, index, partialAccessor)
or
result = getImmediateChildOfMacroPat(e, index, partialAccessor)
@@ -3785,14 +3799,14 @@ private module Impl {
or
result = getImmediateChildOfUnderscoreExpr(e, index, partialAccessor)
or
result = getImmediateChildOfWhileExpr(e, index, partialAccessor)
or
result = getImmediateChildOfWildcardPat(e, index, partialAccessor)
or
result = getImmediateChildOfYeetExpr(e, index, partialAccessor)
or
result = getImmediateChildOfYieldExpr(e, index, partialAccessor)
or
result = getImmediateChildOfBlockExpr(e, index, partialAccessor)
or
result = getImmediateChildOfCallExpr(e, index, partialAccessor)
or
result = getImmediateChildOfConst(e, index, partialAccessor)
@@ -3834,6 +3848,12 @@ private module Impl {
result = getImmediateChildOfUnion(e, index, partialAccessor)
or
result = getImmediateChildOfUse(e, index, partialAccessor)
or
result = getImmediateChildOfForExpr(e, index, partialAccessor)
or
result = getImmediateChildOfLoopExpr(e, index, partialAccessor)
or
result = getImmediateChildOfWhileExpr(e, index, partialAccessor)
}
}

View File

@@ -1366,70 +1366,6 @@ module Raw {
Expr getRhs() { binary_expr_rhs(this, result) }
}
/**
* INTERNAL: Do not use.
* A block expression. For example:
* ```rust
* {
* let x = 42;
* }
* ```
* ```rust
* 'label: {
* let x = 42;
* x
* }
* ```
*/
class BlockExpr extends @block_expr, Expr {
override string toString() { result = "BlockExpr" }
/**
* Gets the `index`th attr of this block expression (0-based).
*/
Attr getAttr(int index) { block_expr_attrs(this, index, result) }
/**
* Holds if this block expression is async.
*/
predicate isAsync() { block_expr_is_async(this) }
/**
* Holds if this block expression is const.
*/
predicate isConst() { block_expr_is_const(this) }
/**
* Holds if this block expression is gen.
*/
predicate isGen() { block_expr_is_gen(this) }
/**
* Holds if this block expression is move.
*/
predicate isMove() { block_expr_is_move(this) }
/**
* Holds if this block expression is try.
*/
predicate isTry() { block_expr_is_try(this) }
/**
* Holds if this block expression is unsafe.
*/
predicate isUnsafe() { block_expr_is_unsafe(this) }
/**
* Gets the label of this block expression, if it exists.
*/
Label getLabel() { block_expr_labels(this, result) }
/**
* Gets the statement list of this block expression, if it exists.
*/
StmtList getStmtList() { block_expr_stmt_lists(this, result) }
}
/**
* INTERNAL: Do not use.
* A box pattern. For example:
@@ -1824,42 +1760,6 @@ module Raw {
RetType getRetType() { fn_ptr_type_ret_types(this, result) }
}
/**
* INTERNAL: Do not use.
* A ForExpr. For example:
* ```rust
* todo!()
* ```
*/
class ForExpr extends @for_expr, Expr {
override string toString() { result = "ForExpr" }
/**
* Gets the `index`th attr of this for expression (0-based).
*/
Attr getAttr(int index) { for_expr_attrs(this, index, result) }
/**
* Gets the iterable of this for expression, if it exists.
*/
Expr getIterable() { for_expr_iterables(this, result) }
/**
* Gets the label of this for expression, if it exists.
*/
Label getLabel() { for_expr_labels(this, result) }
/**
* Gets the loop body of this for expression, if it exists.
*/
BlockExpr getLoopBody() { for_expr_loop_bodies(this, result) }
/**
* Gets the pat of this for expression, if it exists.
*/
Pat getPat() { for_expr_pats(this, result) }
}
/**
* INTERNAL: Do not use.
* A ForType. For example:
@@ -2071,6 +1971,17 @@ module Raw {
string getCrateOrigin() { item_crate_origins(this, result) }
}
/**
* INTERNAL: Do not use.
* The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
*/
class LabelableExpr extends @labelable_expr, Expr {
/**
* Gets the label of this labelable expression, if it exists.
*/
Label getLabel() { labelable_expr_labels(this, result) }
}
/**
* INTERNAL: Do not use.
* A `let` expression. For example:
@@ -2231,50 +2142,6 @@ module Raw {
LiteralExpr getLiteral() { literal_pat_literals(this, result) }
}
/**
* INTERNAL: Do not use.
* A loop expression. For example:
* ```rust
* loop {
* println!("Hello, world (again)!");
* };
* ```
* ```rust
* 'label: loop {
* println!("Hello, world (once)!");
* break 'label;
* };
* ```
* ```rust
* let mut x = 0;
* loop {
* if x < 10 {
* x += 1;
* } else {
* break;
* }
* };
* ```
*/
class LoopExpr extends @loop_expr, Expr {
override string toString() { result = "LoopExpr" }
/**
* Gets the `index`th attr of this loop expression (0-based).
*/
Attr getAttr(int index) { loop_expr_attrs(this, index, result) }
/**
* Gets the label of this loop expression, if it exists.
*/
Label getLabel() { loop_expr_labels(this, result) }
/**
* Gets the loop body of this loop expression, if it exists.
*/
BlockExpr getLoopBody() { loop_expr_loop_bodies(this, result) }
}
/**
* INTERNAL: Do not use.
* A MacroExpr. For example:
@@ -3063,37 +2930,6 @@ module Raw {
Attr getAttr(int index) { underscore_expr_attrs(this, index, result) }
}
/**
* INTERNAL: Do not use.
* A WhileExpr. For example:
* ```rust
* todo!()
* ```
*/
class WhileExpr extends @while_expr, Expr {
override string toString() { result = "WhileExpr" }
/**
* Gets the `index`th attr of this while expression (0-based).
*/
Attr getAttr(int index) { while_expr_attrs(this, index, result) }
/**
* Gets the condition of this while expression, if it exists.
*/
Expr getCondition() { while_expr_conditions(this, result) }
/**
* Gets the label of this while expression, if it exists.
*/
Label getLabel() { while_expr_labels(this, result) }
/**
* Gets the loop body of this while expression, if it exists.
*/
BlockExpr getLoopBody() { while_expr_loop_bodies(this, result) }
}
/**
* INTERNAL: Do not use.
* A wildcard pattern. For example:
@@ -3152,6 +2988,65 @@ module Raw {
Expr getExpr() { yield_expr_exprs(this, result) }
}
/**
* INTERNAL: Do not use.
* A block expression. For example:
* ```rust
* {
* let x = 42;
* }
* ```
* ```rust
* 'label: {
* let x = 42;
* x
* }
* ```
*/
class BlockExpr extends @block_expr, LabelableExpr {
override string toString() { result = "BlockExpr" }
/**
* Gets the `index`th attr of this block expression (0-based).
*/
Attr getAttr(int index) { block_expr_attrs(this, index, result) }
/**
* Holds if this block expression is async.
*/
predicate isAsync() { block_expr_is_async(this) }
/**
* Holds if this block expression is const.
*/
predicate isConst() { block_expr_is_const(this) }
/**
* Holds if this block expression is gen.
*/
predicate isGen() { block_expr_is_gen(this) }
/**
* Holds if this block expression is move.
*/
predicate isMove() { block_expr_is_move(this) }
/**
* Holds if this block expression is try.
*/
predicate isTry() { block_expr_is_try(this) }
/**
* Holds if this block expression is unsafe.
*/
predicate isUnsafe() { block_expr_is_unsafe(this) }
/**
* Gets the statement list of this block expression, if it exists.
*/
StmtList getStmtList() { block_expr_stmt_lists(this, result) }
}
/**
* INTERNAL: Do not use.
* A function call expression. For example:
@@ -3458,6 +3353,17 @@ module Raw {
WhereClause getWhereClause() { impl_where_clauses(this, result) }
}
/**
* INTERNAL: Do not use.
* The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`).
*/
class LoopingExpr extends @looping_expr, LabelableExpr {
/**
* Gets the loop body of this looping expression, if it exists.
*/
BlockExpr getLoopBody() { looping_expr_loop_bodies(this, result) }
}
/**
* INTERNAL: Do not use.
* A MacroCall. For example:
@@ -3950,4 +3856,85 @@ module Raw {
*/
Visibility getVisibility() { use_visibilities(this, result) }
}
/**
* INTERNAL: Do not use.
* A ForExpr. For example:
* ```rust
* todo!()
* ```
*/
class ForExpr extends @for_expr, LoopingExpr {
override string toString() { result = "ForExpr" }
/**
* Gets the `index`th attr of this for expression (0-based).
*/
Attr getAttr(int index) { for_expr_attrs(this, index, result) }
/**
* Gets the iterable of this for expression, if it exists.
*/
Expr getIterable() { for_expr_iterables(this, result) }
/**
* Gets the pat of this for expression, if it exists.
*/
Pat getPat() { for_expr_pats(this, result) }
}
/**
* INTERNAL: Do not use.
* A loop expression. For example:
* ```rust
* loop {
* println!("Hello, world (again)!");
* };
* ```
* ```rust
* 'label: loop {
* println!("Hello, world (once)!");
* break 'label;
* };
* ```
* ```rust
* let mut x = 0;
* loop {
* if x < 10 {
* x += 1;
* } else {
* break;
* }
* };
* ```
*/
class LoopExpr extends @loop_expr, LoopingExpr {
override string toString() { result = "LoopExpr" }
/**
* Gets the `index`th attr of this loop expression (0-based).
*/
Attr getAttr(int index) { loop_expr_attrs(this, index, result) }
}
/**
* INTERNAL: Do not use.
* A WhileExpr. For example:
* ```rust
* todo!()
* ```
*/
class WhileExpr extends @while_expr, LoopingExpr {
override string toString() { result = "WhileExpr" }
/**
* Gets the `index`th attr of this while expression (0-based).
*/
Attr getAttr(int index) { while_expr_attrs(this, index, result) }
/**
* Gets the condition of this while expression, if it exists.
*/
Expr getCondition() { while_expr_conditions(this, result) }
}
}

View File

@@ -645,12 +645,12 @@ module Synth {
* INTERNAL: Do not use.
*/
class TExpr =
TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBlockExpr or
TBreakExpr or TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or
TForExpr or TFormatArgsExpr or TIfExpr or TIndexExpr or TLetExpr or TLiteralExpr or
TLoopExpr or TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExprBase or
TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or
TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr;
TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBreakExpr or
TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or
TFormatArgsExpr or TIfExpr or TIndexExpr or TLabelableExpr or TLetExpr or TLiteralExpr or
TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExprBase or TPrefixExpr or
TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or TTupleExpr or
TUnderscoreExpr or TYeetExpr or TYieldExpr;
/**
* INTERNAL: Do not use.
@@ -680,11 +680,21 @@ module Synth {
TMacroDef or TMacroRules or TModule or TStatic or TStruct or TTrait or TTraitAlias or
TTypeAlias or TUnion or TUse;
/**
* INTERNAL: Do not use.
*/
class TLabelableExpr = TBlockExpr or TLoopingExpr;
/**
* INTERNAL: Do not use.
*/
class TLocatable = TAstNode or TFormat or TFormatArgument;
/**
* INTERNAL: Do not use.
*/
class TLoopingExpr = TForExpr or TLoopExpr or TWhileExpr;
/**
* INTERNAL: Do not use.
*/
@@ -1795,8 +1805,6 @@ module Synth {
or
result = convertBinaryExprFromRaw(e)
or
result = convertBlockExprFromRaw(e)
or
result = convertBreakExprFromRaw(e)
or
result = convertCallExprBaseFromRaw(e)
@@ -1809,20 +1817,18 @@ module Synth {
or
result = convertFieldExprFromRaw(e)
or
result = convertForExprFromRaw(e)
or
result = convertFormatArgsExprFromRaw(e)
or
result = convertIfExprFromRaw(e)
or
result = convertIndexExprFromRaw(e)
or
result = convertLabelableExprFromRaw(e)
or
result = convertLetExprFromRaw(e)
or
result = convertLiteralExprFromRaw(e)
or
result = convertLoopExprFromRaw(e)
or
result = convertMacroExprFromRaw(e)
or
result = convertMatchExprFromRaw(e)
@@ -1849,8 +1855,6 @@ module Synth {
or
result = convertUnderscoreExprFromRaw(e)
or
result = convertWhileExprFromRaw(e)
or
result = convertYeetExprFromRaw(e)
or
result = convertYieldExprFromRaw(e)
@@ -1946,6 +1950,16 @@ module Synth {
result = convertUseFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TLabelableExpr`, if possible.
*/
TLabelableExpr convertLabelableExprFromRaw(Raw::Element e) {
result = convertBlockExprFromRaw(e)
or
result = convertLoopingExprFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TLocatable`, if possible.
@@ -1958,6 +1972,18 @@ module Synth {
result = convertFormatArgumentFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TLoopingExpr`, if possible.
*/
TLoopingExpr convertLoopingExprFromRaw(Raw::Element e) {
result = convertForExprFromRaw(e)
or
result = convertLoopExprFromRaw(e)
or
result = convertWhileExprFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TPat`, if possible.
@@ -3145,8 +3171,6 @@ module Synth {
or
result = convertBinaryExprToRaw(e)
or
result = convertBlockExprToRaw(e)
or
result = convertBreakExprToRaw(e)
or
result = convertCallExprBaseToRaw(e)
@@ -3159,20 +3183,18 @@ module Synth {
or
result = convertFieldExprToRaw(e)
or
result = convertForExprToRaw(e)
or
result = convertFormatArgsExprToRaw(e)
or
result = convertIfExprToRaw(e)
or
result = convertIndexExprToRaw(e)
or
result = convertLabelableExprToRaw(e)
or
result = convertLetExprToRaw(e)
or
result = convertLiteralExprToRaw(e)
or
result = convertLoopExprToRaw(e)
or
result = convertMacroExprToRaw(e)
or
result = convertMatchExprToRaw(e)
@@ -3199,8 +3221,6 @@ module Synth {
or
result = convertUnderscoreExprToRaw(e)
or
result = convertWhileExprToRaw(e)
or
result = convertYeetExprToRaw(e)
or
result = convertYieldExprToRaw(e)
@@ -3296,6 +3316,16 @@ module Synth {
result = convertUseToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TLabelableExpr` to a raw DB element, if possible.
*/
Raw::Element convertLabelableExprToRaw(TLabelableExpr e) {
result = convertBlockExprToRaw(e)
or
result = convertLoopingExprToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TLocatable` to a raw DB element, if possible.
@@ -3308,6 +3338,18 @@ module Synth {
result = convertFormatArgumentToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TLoopingExpr` to a raw DB element, if possible.
*/
Raw::Element convertLoopingExprToRaw(TLoopingExpr e) {
result = convertForExprToRaw(e)
or
result = convertLoopExprToRaw(e)
or
result = convertWhileExprToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TPat` to a raw DB element, if possible.

View File

@@ -7,10 +7,8 @@
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.Attr
import codeql.rust.elements.BlockExpr
import codeql.rust.elements.Expr
import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl
import codeql.rust.elements.Label
import codeql.rust.elements.internal.LoopingExprImpl::Impl as LoopingExprImpl
/**
* INTERNAL: This module contains the fully generated definition of `WhileExpr` and should not
@@ -25,7 +23,7 @@ module Generated {
* INTERNAL: Do not reference the `Generated::WhileExpr` class directly.
* Use the subclass `WhileExpr`, where the following predicates are available.
*/
class WhileExpr extends Synth::TWhileExpr, ExprImpl::Expr {
class WhileExpr extends Synth::TWhileExpr, LoopingExprImpl::LoopingExpr {
override string getAPrimaryQlClass() { result = "WhileExpr" }
/**
@@ -58,33 +56,5 @@ module Generated {
* Holds if `getCondition()` exists.
*/
final predicate hasCondition() { exists(this.getCondition()) }
/**
* Gets the label of this while expression, if it exists.
*/
Label getLabel() {
result =
Synth::convertLabelFromRaw(Synth::convertWhileExprToRaw(this).(Raw::WhileExpr).getLabel())
}
/**
* Holds if `getLabel()` exists.
*/
final predicate hasLabel() { exists(this.getLabel()) }
/**
* Gets the loop body of this while expression, if it exists.
*/
BlockExpr getLoopBody() {
result =
Synth::convertBlockExprFromRaw(Synth::convertWhileExprToRaw(this)
.(Raw::WhileExpr)
.getLoopBody())
}
/**
* Holds if `getLoopBody()` exists.
*/
final predicate hasLoopBody() { exists(this.getLoopBody()) }
}
}

View File

@@ -292,20 +292,18 @@ closure_binder_generic_param_lists(
| @await_expr
| @become_expr
| @binary_expr
| @block_expr
| @break_expr
| @call_expr_base
| @cast_expr
| @closure_expr
| @continue_expr
| @field_expr
| @for_expr
| @format_args_expr
| @if_expr
| @index_expr
| @labelable_expr
| @let_expr
| @literal_expr
| @loop_expr
| @macro_expr
| @match_expr
| @offset_of_expr
@@ -319,7 +317,6 @@ closure_binder_generic_param_lists(
| @try_expr
| @tuple_expr
| @underscore_expr
| @while_expr
| @yeet_expr
| @yield_expr
;
@@ -1314,59 +1311,6 @@ binary_expr_rhs(
int rhs: @expr ref
);
block_exprs(
unique int id: @block_expr
);
#keyset[id, index]
block_expr_attrs(
int id: @block_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
block_expr_is_async(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_const(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_gen(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_move(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_try(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_unsafe(
int id: @block_expr ref
);
#keyset[id]
block_expr_labels(
int id: @block_expr ref,
int label: @label ref
);
#keyset[id]
block_expr_stmt_lists(
int id: @block_expr ref,
int stmt_list: @stmt_list ref
);
box_pats(
unique int id: @box_pat
);
@@ -1650,41 +1594,6 @@ fn_ptr_type_ret_types(
int ret_type: @ret_type ref
);
for_exprs(
unique int id: @for_expr
);
#keyset[id, index]
for_expr_attrs(
int id: @for_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
for_expr_iterables(
int id: @for_expr ref,
int iterable: @expr ref
);
#keyset[id]
for_expr_labels(
int id: @for_expr ref,
int label: @label ref
);
#keyset[id]
for_expr_loop_bodies(
int id: @for_expr ref,
int loop_body: @block_expr ref
);
#keyset[id]
for_expr_pats(
int id: @for_expr ref,
int pat: @pat ref
);
for_types(
unique int id: @for_type
);
@@ -1856,6 +1765,17 @@ item_crate_origins(
string crate_origin: string ref
);
@labelable_expr =
@block_expr
| @looping_expr
;
#keyset[id]
labelable_expr_labels(
int id: @labelable_expr ref,
int label: @label ref
);
let_exprs(
unique int id: @let_expr
);
@@ -1974,29 +1894,6 @@ literal_pat_literals(
int literal: @literal_expr ref
);
loop_exprs(
unique int id: @loop_expr
);
#keyset[id, index]
loop_expr_attrs(
int id: @loop_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
loop_expr_labels(
int id: @loop_expr ref,
int label: @label ref
);
#keyset[id]
loop_expr_loop_bodies(
int id: @loop_expr ref,
int loop_body: @block_expr ref
);
macro_exprs(
unique int id: @macro_expr
);
@@ -2555,35 +2452,6 @@ underscore_expr_attrs(
int attr: @attr ref
);
while_exprs(
unique int id: @while_expr
);
#keyset[id, index]
while_expr_attrs(
int id: @while_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
while_expr_conditions(
int id: @while_expr ref,
int condition: @expr ref
);
#keyset[id]
while_expr_labels(
int id: @while_expr ref,
int label: @label ref
);
#keyset[id]
while_expr_loop_bodies(
int id: @while_expr ref,
int loop_body: @block_expr ref
);
wildcard_pats(
unique int id: @wildcard_pat
);
@@ -2622,6 +2490,53 @@ yield_expr_exprs(
int expr: @expr ref
);
block_exprs(
unique int id: @block_expr
);
#keyset[id, index]
block_expr_attrs(
int id: @block_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
block_expr_is_async(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_const(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_gen(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_move(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_try(
int id: @block_expr ref
);
#keyset[id]
block_expr_is_unsafe(
int id: @block_expr ref
);
#keyset[id]
block_expr_stmt_lists(
int id: @block_expr ref,
int stmt_list: @stmt_list ref
);
call_exprs(
unique int id: @call_expr
);
@@ -2908,6 +2823,18 @@ impl_where_clauses(
int where_clause: @where_clause ref
);
@looping_expr =
@for_expr
| @loop_expr
| @while_expr
;
#keyset[id]
looping_expr_loop_bodies(
int id: @looping_expr ref,
int loop_body: @block_expr ref
);
macro_calls(
unique int id: @macro_call
);
@@ -3368,3 +3295,54 @@ use_visibilities(
int id: @use ref,
int visibility: @visibility ref
);
for_exprs(
unique int id: @for_expr
);
#keyset[id, index]
for_expr_attrs(
int id: @for_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
for_expr_iterables(
int id: @for_expr ref,
int iterable: @expr ref
);
#keyset[id]
for_expr_pats(
int id: @for_expr ref,
int pat: @pat ref
);
loop_exprs(
unique int id: @loop_expr
);
#keyset[id, index]
loop_expr_attrs(
int id: @loop_expr ref,
int index: int ref,
int attr: @attr ref
);
while_exprs(
unique int id: @while_expr
);
#keyset[id, index]
while_expr_attrs(
int id: @while_expr ref,
int index: int ref,
int attr: @attr ref
);
#keyset[id]
while_expr_conditions(
int id: @while_expr ref,
int condition: @expr ref
);

View File

@@ -3,11 +3,12 @@ import codeql.rust.elements
import TestUtils
from
BlockExpr x, int getNumberOfAttrs, string isAsync, string isConst, string isGen, string isMove,
string isTry, string isUnsafe, string hasLabel, string hasStmtList
BlockExpr x, string hasLabel, int getNumberOfAttrs, string isAsync, string isConst, string isGen,
string isMove, string isTry, string isUnsafe, string hasStmtList
where
toBeTested(x) and
not x.isUnknown() and
(if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.isAsync() then isAsync = "yes" else isAsync = "no") and
(if x.isConst() then isConst = "yes" else isConst = "no") and
@@ -15,8 +16,7 @@ where
(if x.isMove() then isMove = "yes" else isMove = "no") and
(if x.isTry() then isTry = "yes" else isTry = "no") and
(if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and
(if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and
if x.hasStmtList() then hasStmtList = "yes" else hasStmtList = "no"
select x, "getNumberOfAttrs:", getNumberOfAttrs, "isAsync:", isAsync, "isConst:", isConst, "isGen:",
isGen, "isMove:", isMove, "isTry:", isTry, "isUnsafe:", isUnsafe, "hasLabel:", hasLabel,
select x, "hasLabel:", hasLabel, "getNumberOfAttrs:", getNumberOfAttrs, "isAsync:", isAsync,
"isConst:", isConst, "isGen:", isGen, "isMove:", isMove, "isTry:", isTry, "isUnsafe:", isUnsafe,
"hasStmtList:", hasStmtList

View File

@@ -3,15 +3,15 @@ import codeql.rust.elements
import TestUtils
from
ForExpr x, int getNumberOfAttrs, string hasIterable, string hasLabel, string hasLoopBody,
ForExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs, string hasIterable,
string hasPat
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasIterable() then hasIterable = "yes" else hasIterable = "no") and
(if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and
(if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasIterable() then hasIterable = "yes" else hasIterable = "no") and
if x.hasPat() then hasPat = "yes" else hasPat = "no"
select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasIterable:", hasIterable, "hasLabel:", hasLabel,
"hasLoopBody:", hasLoopBody, "hasPat:", hasPat
select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs,
"hasIterable:", hasIterable, "hasPat:", hasPat

View File

@@ -2,11 +2,11 @@
import codeql.rust.elements
import TestUtils
from LoopExpr x, int getNumberOfAttrs, string hasLabel, string hasLoopBody
from LoopExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and
if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no"
select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody
(if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and
getNumberOfAttrs = x.getNumberOfAttrs()
select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs

View File

@@ -2,13 +2,13 @@
import codeql.rust.elements
import TestUtils
from WhileExpr x, int getNumberOfAttrs, string hasCondition, string hasLabel, string hasLoopBody
from WhileExpr x, string hasLabel, string hasLoopBody, int getNumberOfAttrs, string hasCondition
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasCondition() then hasCondition = "yes" else hasCondition = "no") and
(if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and
if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no"
select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasCondition:", hasCondition, "hasLabel:",
hasLabel, "hasLoopBody:", hasLoopBody
(if x.hasLoopBody() then hasLoopBody = "yes" else hasLoopBody = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
if x.hasCondition() then hasCondition = "yes" else hasCondition = "no"
select x, "hasLabel:", hasLabel, "hasLoopBody:", hasLoopBody, "getNumberOfAttrs:", getNumberOfAttrs,
"hasCondition:", hasCondition

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
models
edges
| main.rs:21:13:21:21 | source(...) : unit | main.rs:22:10:22:10 | s | provenance | |
| main.rs:32:13:32:21 | source(...) : unit | main.rs:33:10:33:10 | s | provenance | |
| main.rs:21:13:21:21 | (...) ... : unit | main.rs:22:10:22:10 | s | provenance | |
| main.rs:32:13:32:21 | (...) ... : unit | main.rs:33:10:33:10 | s | provenance | |
nodes
| main.rs:17:10:17:18 | source(...) | semmle.label | source(...) |
| main.rs:21:13:21:21 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:17:10:17:18 | (...) ... | semmle.label | (...) ... |
| main.rs:21:13:21:21 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:22:10:22:10 | s | semmle.label | s |
| main.rs:32:13:32:21 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:32:13:32:21 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:33:10:33:10 | s | semmle.label | s |
subpaths
testFailures
#select
| main.rs:17:10:17:18 | source(...) | main.rs:17:10:17:18 | source(...) | main.rs:17:10:17:18 | source(...) | $@ | main.rs:17:10:17:18 | source(...) | source(...) |
| main.rs:22:10:22:10 | s | main.rs:21:13:21:21 | source(...) : unit | main.rs:22:10:22:10 | s | $@ | main.rs:21:13:21:21 | source(...) : unit | source(...) : unit |
| main.rs:33:10:33:10 | s | main.rs:32:13:32:21 | source(...) : unit | main.rs:33:10:33:10 | s | $@ | main.rs:32:13:32:21 | source(...) : unit | source(...) : unit |
| main.rs:17:10:17:18 | (...) ... | main.rs:17:10:17:18 | (...) ... | main.rs:17:10:17:18 | (...) ... | $@ | main.rs:17:10:17:18 | (...) ... | (...) ... |
| main.rs:22:10:22:10 | s | main.rs:21:13:21:21 | (...) ... : unit | main.rs:22:10:22:10 | s | $@ | main.rs:21:13:21:21 | (...) ... : unit | (...) ... : unit |
| main.rs:33:10:33:10 | s | main.rs:32:13:32:21 | (...) ... : unit | main.rs:33:10:33:10 | s | $@ | main.rs:32:13:32:21 | (...) ... : unit | (...) ... : unit |

View File

@@ -1,24 +1,24 @@
| main.rs:13:5:13:13 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:17:13:17:23 | get_data(...) | main.rs:12:1:14:1 | fn get_data |
| main.rs:18:5:18:11 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:22:5:22:15 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:26:13:26:21 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:27:5:27:14 | data_in(...) | main.rs:21:1:23:1 | fn data_in |
| main.rs:35:13:35:21 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:36:13:36:27 | pass_through(...) | main.rs:30:1:32:1 | fn pass_through |
| main.rs:37:5:37:11 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:49:9:49:15 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:55:13:55:21 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:13:5:13:13 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:17:13:17:23 | (...) ... | main.rs:12:1:14:1 | fn get_data |
| main.rs:18:5:18:11 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:22:5:22:15 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:26:13:26:21 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:27:5:27:14 | (...) ... | main.rs:21:1:23:1 | fn data_in |
| main.rs:35:13:35:21 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:36:13:36:27 | (...) ... | main.rs:30:1:32:1 | fn pass_through |
| main.rs:37:5:37:11 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:49:9:49:15 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:55:13:55:21 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:69:13:69:25 | ... .get_data(...) | main.rs:51:5:57:5 | fn get_data |
| main.rs:70:5:70:11 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:75:13:75:21 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:70:5:70:11 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:75:13:75:21 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:76:5:76:17 | ... .data_in(...) | main.rs:48:5:50:5 | fn data_in |
| main.rs:81:13:81:21 | source(...) | main.rs:1:1:3:1 | fn source |
| main.rs:81:13:81:21 | (...) ... | main.rs:1:1:3:1 | fn source |
| main.rs:82:5:82:22 | ... .data_through(...) | main.rs:58:5:64:5 | fn data_through |
| main.rs:83:5:83:11 | sink(...) | main.rs:5:1:7:1 | fn sink |
| main.rs:87:5:87:22 | data_out_of_call(...) | main.rs:16:1:19:1 | fn data_out_of_call |
| main.rs:88:5:88:21 | data_in_to_call(...) | main.rs:25:1:28:1 | fn data_in_to_call |
| main.rs:89:5:89:23 | data_through_call(...) | main.rs:34:1:38:1 | fn data_through_call |
| main.rs:91:5:91:24 | data_out_of_method(...) | main.rs:67:1:71:1 | fn data_out_of_method |
| main.rs:92:5:92:28 | data_in_to_method_call(...) | main.rs:73:1:77:1 | fn data_in_to_method_call |
| main.rs:93:5:93:25 | data_through_method(...) | main.rs:79:1:84:1 | fn data_through_method |
| main.rs:83:5:83:11 | (...) ... | main.rs:5:1:7:1 | fn sink |
| main.rs:87:5:87:22 | (...) ... | main.rs:16:1:19:1 | fn data_out_of_call |
| main.rs:88:5:88:21 | (...) ... | main.rs:25:1:28:1 | fn data_in_to_call |
| main.rs:89:5:89:23 | (...) ... | main.rs:34:1:38:1 | fn data_through_call |
| main.rs:91:5:91:24 | (...) ... | main.rs:67:1:71:1 | fn data_out_of_method |
| main.rs:92:5:92:28 | (...) ... | main.rs:73:1:77:1 | fn data_in_to_method_call |
| main.rs:93:5:93:25 | (...) ... | main.rs:79:1:84:1 | fn data_through_method |

View File

@@ -5,27 +5,27 @@
| main.rs:7:9:7:9 | s | main.rs:7:9:7:9 | [SSA] s |
| main.rs:19:9:19:9 | [SSA] s | main.rs:20:10:20:10 | s |
| main.rs:19:9:19:9 | s | main.rs:19:9:19:9 | [SSA] s |
| main.rs:19:13:19:21 | source(...) | main.rs:19:9:19:9 | s |
| main.rs:19:13:19:21 | (...) ... | main.rs:19:9:19:9 | s |
| main.rs:23:18:23:21 | [SSA] cond | main.rs:26:16:26:19 | cond |
| main.rs:23:18:23:21 | cond | main.rs:23:18:23:21 | [SSA] cond |
| main.rs:24:9:24:9 | [SSA] a | main.rs:26:23:26:23 | a |
| main.rs:24:9:24:9 | a | main.rs:24:9:24:9 | [SSA] a |
| main.rs:24:13:24:21 | source(...) | main.rs:24:9:24:9 | a |
| main.rs:24:13:24:21 | (...) ... | main.rs:24:9:24:9 | a |
| main.rs:25:9:25:9 | [SSA] b | main.rs:26:34:26:34 | b |
| main.rs:25:9:25:9 | b | main.rs:25:9:25:9 | [SSA] b |
| main.rs:25:13:25:13 | 2 | main.rs:25:9:25:9 | b |
| main.rs:26:9:26:9 | [SSA] c | main.rs:27:10:27:10 | c |
| main.rs:26:9:26:9 | c | main.rs:26:9:26:9 | [SSA] c |
| main.rs:26:13:26:36 | if ... { ... } else { ... } | main.rs:26:9:26:9 | c |
| main.rs:26:21:26:25 | { ... } | main.rs:26:13:26:36 | if ... { ... } else { ... } |
| main.rs:26:13:26:36 | ... else { ... } if {...} | main.rs:26:9:26:9 | c |
| main.rs:26:21:26:25 | { ... } | main.rs:26:13:26:36 | ... else { ... } if {...} |
| main.rs:26:23:26:23 | a | main.rs:26:21:26:25 | { ... } |
| main.rs:26:32:26:36 | { ... } | main.rs:26:13:26:36 | if ... { ... } else { ... } |
| main.rs:26:32:26:36 | { ... } | main.rs:26:13:26:36 | ... else { ... } if {...} |
| main.rs:26:34:26:34 | b | main.rs:26:32:26:36 | { ... } |
| main.rs:30:21:30:21 | [SSA] m | main.rs:32:19:32:19 | m |
| main.rs:30:21:30:21 | m | main.rs:30:21:30:21 | [SSA] m |
| main.rs:31:9:31:9 | [SSA] a | main.rs:33:20:33:20 | a |
| main.rs:31:9:31:9 | a | main.rs:31:9:31:9 | [SSA] a |
| main.rs:31:13:31:21 | source(...) | main.rs:31:9:31:9 | a |
| main.rs:31:13:31:21 | (...) ... | main.rs:31:9:31:9 | a |
| main.rs:32:9:32:9 | [SSA] b | main.rs:36:10:36:10 | b |
| main.rs:32:9:32:9 | b | main.rs:32:9:32:9 | [SSA] b |
| main.rs:32:13:35:5 | match ... { ... } | main.rs:32:9:32:9 | b |
@@ -33,14 +33,14 @@
| main.rs:34:17:34:17 | 0 | main.rs:32:13:35:5 | match ... { ... } |
| main.rs:40:9:40:9 | [SSA] a | main.rs:43:10:43:10 | a |
| main.rs:40:9:40:9 | a | main.rs:40:9:40:9 | [SSA] a |
| main.rs:40:13:42:5 | loop {...} | main.rs:40:9:40:9 | a |
| main.rs:41:9:41:15 | break ... | main.rs:40:13:42:5 | loop {...} |
| main.rs:41:15:41:15 | 1 | main.rs:41:9:41:15 | break ... |
| main.rs:40:13:42:5 | loop { ... } | main.rs:40:9:40:9 | a |
| main.rs:41:9:41:15 | 1 break | main.rs:40:13:42:5 | loop { ... } |
| main.rs:41:15:41:15 | 1 | main.rs:41:9:41:15 | 1 break |
| main.rs:44:9:44:9 | [SSA] b | main.rs:47:10:47:10 | b |
| main.rs:44:9:44:9 | b | main.rs:44:9:44:9 | [SSA] b |
| main.rs:44:13:46:5 | loop {...} | main.rs:44:9:44:9 | b |
| main.rs:45:9:45:23 | break ... | main.rs:44:13:46:5 | loop {...} |
| main.rs:45:15:45:23 | source(...) | main.rs:45:9:45:23 | break ... |
| main.rs:44:13:46:5 | loop { ... } | main.rs:44:9:44:9 | b |
| main.rs:45:9:45:23 | ... break | main.rs:44:13:46:5 | loop { ... } |
| main.rs:45:15:45:23 | (...) ... | main.rs:45:9:45:23 | ... break |
| main.rs:51:9:51:13 | [SSA] i | main.rs:52:10:52:10 | i |
| main.rs:51:9:51:13 | i | main.rs:51:9:51:13 | [SSA] i |
| main.rs:51:17:51:17 | 1 | main.rs:51:9:51:13 | i |
@@ -48,7 +48,7 @@
| main.rs:53:5:53:5 | i | main.rs:53:5:53:5 | [SSA] i |
| main.rs:61:9:61:9 | [SSA] i | main.rs:62:11:62:11 | i |
| main.rs:61:9:61:9 | i | main.rs:61:9:61:9 | [SSA] i |
| main.rs:61:13:61:31 | Box::new(...) | main.rs:61:9:61:9 | i |
| main.rs:61:13:61:31 | (...) ... | main.rs:61:9:61:9 | i |
| main.rs:66:9:66:9 | [SSA] a | main.rs:67:10:67:10 | a |
| main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | [SSA] a |
| main.rs:66:13:66:26 | TupleExpr | main.rs:66:9:66:9 | a |
@@ -70,16 +70,16 @@
| main.rs:97:38:97:38 | p | main.rs:97:9:97:34 | Point {...} |
| main.rs:104:9:104:10 | [SSA] s1 | main.rs:106:11:106:12 | s1 |
| main.rs:104:9:104:10 | s1 | main.rs:104:9:104:10 | [SSA] s1 |
| main.rs:104:14:104:28 | Some(...) | main.rs:104:9:104:10 | s1 |
| main.rs:104:14:104:28 | (...) ... | main.rs:104:9:104:10 | s1 |
| main.rs:105:9:105:10 | [SSA] s2 | main.rs:110:11:110:12 | s2 |
| main.rs:105:9:105:10 | s2 | main.rs:105:9:105:10 | [SSA] s2 |
| main.rs:105:14:105:20 | Some(...) | main.rs:105:9:105:10 | s2 |
| main.rs:105:14:105:20 | (...) ... | main.rs:105:9:105:10 | s2 |
| main.rs:107:14:107:14 | [SSA] n | main.rs:107:25:107:25 | n |
| main.rs:107:14:107:14 | n | main.rs:107:14:107:14 | [SSA] n |
| main.rs:107:20:107:26 | sink(...) | main.rs:106:5:109:5 | match ... { ... } |
| main.rs:108:17:108:23 | sink(...) | main.rs:106:5:109:5 | match ... { ... } |
| main.rs:107:20:107:26 | (...) ... | main.rs:106:5:109:5 | match ... { ... } |
| main.rs:108:17:108:23 | (...) ... | main.rs:106:5:109:5 | match ... { ... } |
| main.rs:110:5:113:5 | match ... { ... } | main.rs:103:27:114:1 | { ... } |
| main.rs:111:14:111:14 | [SSA] n | main.rs:111:25:111:25 | n |
| main.rs:111:14:111:14 | n | main.rs:111:14:111:14 | [SSA] n |
| main.rs:111:20:111:26 | sink(...) | main.rs:110:5:113:5 | match ... { ... } |
| main.rs:112:17:112:23 | sink(...) | main.rs:110:5:113:5 | match ... { ... } |
| main.rs:111:20:111:26 | (...) ... | main.rs:110:5:113:5 | match ... { ... } |
| main.rs:112:17:112:23 | (...) ... | main.rs:110:5:113:5 | match ... { ... } |

View File

@@ -1,24 +1,24 @@
models
edges
| main.rs:19:13:19:21 | source(...) : unit | main.rs:20:10:20:10 | s | provenance | |
| main.rs:24:13:24:21 | source(...) : unit | main.rs:27:10:27:10 | c | provenance | |
| main.rs:31:13:31:21 | source(...) : unit | main.rs:36:10:36:10 | b | provenance | |
| main.rs:45:15:45:23 | source(...) : unit | main.rs:47:10:47:10 | b | provenance | |
| main.rs:19:13:19:21 | (...) ... : unit | main.rs:20:10:20:10 | s | provenance | |
| main.rs:24:13:24:21 | (...) ... : unit | main.rs:27:10:27:10 | c | provenance | |
| main.rs:31:13:31:21 | (...) ... : unit | main.rs:36:10:36:10 | b | provenance | |
| main.rs:45:15:45:23 | (...) ... : unit | main.rs:47:10:47:10 | b | provenance | |
nodes
| main.rs:15:10:15:18 | source(...) | semmle.label | source(...) |
| main.rs:19:13:19:21 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:15:10:15:18 | (...) ... | semmle.label | (...) ... |
| main.rs:19:13:19:21 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:20:10:20:10 | s | semmle.label | s |
| main.rs:24:13:24:21 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:24:13:24:21 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:27:10:27:10 | c | semmle.label | c |
| main.rs:31:13:31:21 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:31:13:31:21 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:36:10:36:10 | b | semmle.label | b |
| main.rs:45:15:45:23 | source(...) : unit | semmle.label | source(...) : unit |
| main.rs:45:15:45:23 | (...) ... : unit | semmle.label | (...) ... : unit |
| main.rs:47:10:47:10 | b | semmle.label | b |
subpaths
testFailures
#select
| main.rs:15:10:15:18 | source(...) | main.rs:15:10:15:18 | source(...) | main.rs:15:10:15:18 | source(...) | $@ | main.rs:15:10:15:18 | source(...) | source(...) |
| main.rs:20:10:20:10 | s | main.rs:19:13:19:21 | source(...) : unit | main.rs:20:10:20:10 | s | $@ | main.rs:19:13:19:21 | source(...) : unit | source(...) : unit |
| main.rs:27:10:27:10 | c | main.rs:24:13:24:21 | source(...) : unit | main.rs:27:10:27:10 | c | $@ | main.rs:24:13:24:21 | source(...) : unit | source(...) : unit |
| main.rs:36:10:36:10 | b | main.rs:31:13:31:21 | source(...) : unit | main.rs:36:10:36:10 | b | $@ | main.rs:31:13:31:21 | source(...) : unit | source(...) : unit |
| main.rs:47:10:47:10 | b | main.rs:45:15:45:23 | source(...) : unit | main.rs:47:10:47:10 | b | $@ | main.rs:45:15:45:23 | source(...) : unit | source(...) : unit |
| main.rs:15:10:15:18 | (...) ... | main.rs:15:10:15:18 | (...) ... | main.rs:15:10:15:18 | (...) ... | $@ | main.rs:15:10:15:18 | (...) ... | (...) ... |
| main.rs:20:10:20:10 | s | main.rs:19:13:19:21 | (...) ... : unit | main.rs:20:10:20:10 | s | $@ | main.rs:19:13:19:21 | (...) ... : unit | (...) ... : unit |
| main.rs:27:10:27:10 | c | main.rs:24:13:24:21 | (...) ... : unit | main.rs:27:10:27:10 | c | $@ | main.rs:24:13:24:21 | (...) ... : unit | (...) ... : unit |
| main.rs:36:10:36:10 | b | main.rs:31:13:31:21 | (...) ... : unit | main.rs:36:10:36:10 | b | $@ | main.rs:31:13:31:21 | (...) ... : unit | (...) ... : unit |
| main.rs:47:10:47:10 | b | main.rs:45:15:45:23 | (...) ... : unit | main.rs:47:10:47:10 | b | $@ | main.rs:45:15:45:23 | (...) ... : unit | (...) ... : unit |

View File

@@ -1,6 +1,19 @@
from misc.codegen.lib.schemadefs import *
from .ast import *
class LabelableExpr(Expr):
"""
The base class for expressions that can be labeled (`LoopExpr`, `ForExpr`, `WhileExpr` or `BlockExpr`).
"""
label: optional[Label] | child
class LoopingExpr(LabelableExpr):
"""
The base class for expressions that loop (`LoopExpr`, `ForExpr` or `WhileExpr`).
"""
loop_body: optional["BlockExpr"] | child
@annotate(Module)
@rust.doc_test_signature(None)
@@ -151,7 +164,7 @@ class _:
"""
@annotate(BlockExpr)
@annotate(BlockExpr, replace_bases={Expr: LabelableExpr})
class _:
"""
A block expression. For example:
@@ -167,9 +180,10 @@ class _:
}
```
"""
label: drop
@annotate(LoopExpr)
@annotate(LoopExpr, replace_bases={Expr: LoopingExpr})
class _:
"""
A loop expression. For example:
@@ -195,6 +209,8 @@ class _:
};
```
"""
label: drop
loop_body: drop
class CallExprBase(Expr):
@@ -990,7 +1006,7 @@ class _:
"""
@annotate(ForExpr)
@annotate(ForExpr, replace_bases={Expr: LoopingExpr})
class _:
"""
A ForExpr. For example:
@@ -998,6 +1014,8 @@ class _:
todo!()
```
"""
label: drop
loop_body: drop
@annotate(ForType)
@@ -1744,7 +1762,7 @@ class _:
"""
@annotate(WhileExpr)
@annotate(WhileExpr, replace_bases={Expr: LoopingExpr})
class _:
"""
A WhileExpr. For example:
@@ -1752,6 +1770,8 @@ class _:
todo!()
```
"""
label: drop
loop_body: drop
@annotate(Function, add_bases=[Callable])