mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Rust: rename MatchExpr.expr to scrutinee in all layers
This doesn't require `ql.name` and is simpler while we don't have to write upgrade scripts. The `ql.name` mechanism might get useful once we do have to write upgrade scripts, as that doesn't change the dbscheme.
This commit is contained in:
2
rust/extractor/src/generated/.generated.list
generated
2
rust/extractor/src/generated/.generated.list
generated
@@ -1,2 +1,2 @@
|
||||
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
|
||||
top.rs 4504ceb7e13020d5b19a4b938395fa2d5d804a962743985efe8563903448ae0c 4504ceb7e13020d5b19a4b938395fa2d5d804a962743985efe8563903448ae0c
|
||||
top.rs abab6a736e75f9eabbe31deef4de782fc05f0c053798a01d410fffc859515278 abab6a736e75f9eabbe31deef4de782fc05f0c053798a01d410fffc859515278
|
||||
|
||||
6
rust/extractor/src/generated/top.rs
generated
6
rust/extractor/src/generated/top.rs
generated
@@ -5530,7 +5530,7 @@ impl From<trap::Label<MacroType>> for trap::Label<TypeRef> {
|
||||
pub struct MatchExpr {
|
||||
pub id: trap::TrapId<MatchExpr>,
|
||||
pub attrs: Vec<trap::Label<Attr>>,
|
||||
pub expr: Option<trap::Label<Expr>>,
|
||||
pub scrutinee: Option<trap::Label<Expr>>,
|
||||
pub match_arm_list: Option<trap::Label<MatchArmList>>,
|
||||
}
|
||||
|
||||
@@ -5544,8 +5544,8 @@ impl trap::TrapEntry for MatchExpr {
|
||||
for (i, v) in self.attrs.into_iter().enumerate() {
|
||||
out.add_tuple("match_expr_attrs", vec![id.into(), i.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.expr {
|
||||
out.add_tuple("match_expr_exprs", vec![id.into(), v.into()]);
|
||||
if let Some(v) = self.scrutinee {
|
||||
out.add_tuple("match_expr_scrutinees", vec![id.into(), v.into()]);
|
||||
}
|
||||
if let Some(v) = self.match_arm_list {
|
||||
out.add_tuple("match_expr_match_arm_lists", vec![id.into(), v.into()]);
|
||||
|
||||
4
rust/extractor/src/translate/generated.rs
generated
4
rust/extractor/src/translate/generated.rs
generated
@@ -1224,12 +1224,12 @@ impl Translator<'_> {
|
||||
|
||||
pub(crate) fn emit_match_expr(&mut self, node: ast::MatchExpr) -> Label<generated::MatchExpr> {
|
||||
let attrs = node.attrs().map(|x| self.emit_attr(x)).collect();
|
||||
let expr = node.expr().map(|x| self.emit_expr(x));
|
||||
let scrutinee = node.expr().map(|x| self.emit_expr(x));
|
||||
let match_arm_list = node.match_arm_list().map(|x| self.emit_match_arm_list(x));
|
||||
let label = self.trap.emit(generated::MatchExpr {
|
||||
id: TrapId::Star,
|
||||
attrs,
|
||||
expr,
|
||||
scrutinee,
|
||||
match_arm_list,
|
||||
});
|
||||
self.emit_location(label, &node);
|
||||
|
||||
Reference in New Issue
Block a user