mirror of
https://github.com/github/codeql.git
synced 2026-05-29 18:41:27 +02:00
Rust: Drop locations for downgraded comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -39,7 +39,7 @@ private predicate metaTokenTree(Element id, Element tokenTree) {
|
||||
token_tree_meta_token_trees(id, tokenTree)
|
||||
}
|
||||
|
||||
private predicate deletedElement(Element id) {
|
||||
private predicate deletedAstNode(Element id) {
|
||||
wrapperConstArg(id) or
|
||||
unsafeInnerMeta(id) or
|
||||
cfg_atoms(id) or
|
||||
@@ -48,6 +48,12 @@ private predicate deletedElement(Element id) {
|
||||
try_block_modifiers(id)
|
||||
}
|
||||
|
||||
private predicate deletedElement(Element id) {
|
||||
deletedAstNode(id)
|
||||
or
|
||||
exists(Element parent, string text | comments(id, parent, text) and deletedAstNode(parent))
|
||||
}
|
||||
|
||||
query predicate new_block_expr_is_try(Element id) {
|
||||
exists(Element modifier | block_expr_try_block_modifiers(id, modifier) and try_block_modifier_is_try(modifier))
|
||||
}
|
||||
@@ -69,7 +75,7 @@ query predicate new_const_arg_exprs(Element id, Element expr) {
|
||||
}
|
||||
|
||||
query predicate new_comments(Element id, Element parent, string text) {
|
||||
comments(id, parent, text) and not deletedElement(parent)
|
||||
comments(id, parent, text) and not deletedAstNode(parent)
|
||||
}
|
||||
|
||||
query predicate new_struct_field_defaults(Element id, Element expr) {
|
||||
|
||||
Reference in New Issue
Block a user