mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: fix duplicate asm! expressions
This commit is contained in:
@@ -1404,17 +1404,25 @@ class _:
|
||||
"""
|
||||
|
||||
|
||||
@annotate(MacroBlockExpr, replace_bases={AstNode: Expr}, cfg=True)
|
||||
@rust.doc_test_signature(None)
|
||||
class _:
|
||||
class MacroBlockExpr(Expr):
|
||||
"""
|
||||
A sequence of statements generated by a `MacroCall`. For example:
|
||||
```rust
|
||||
fn main() {
|
||||
println!("Hello, world!"); // This macro expands into a list of statements
|
||||
macro_rules! my_macro {
|
||||
() => {
|
||||
let mut x = 40;
|
||||
x += 2;
|
||||
x
|
||||
};
|
||||
}
|
||||
|
||||
my_macro!(); // this macro expands to a sequence of statements (and an expression)
|
||||
```
|
||||
"""
|
||||
__cfg__ = True
|
||||
|
||||
statements: list[Stmt] | child
|
||||
tail_expr: optional[Expr] | child
|
||||
|
||||
|
||||
@annotate(MacroTypeRepr)
|
||||
|
||||
4
rust/schema/ast.py
generated
4
rust/schema/ast.py
generated
@@ -399,10 +399,6 @@ class MacroRules(Item, ):
|
||||
token_tree: optional["TokenTree"] | child
|
||||
visibility: optional["Visibility"] | child
|
||||
|
||||
class MacroBlockExpr(AstNode, ):
|
||||
tail_expr: optional["Expr"] | child
|
||||
statements: list["Stmt"] | child
|
||||
|
||||
class MacroTypeRepr(TypeRepr, ):
|
||||
macro_call: optional["MacroCall"] | child
|
||||
|
||||
|
||||
Reference in New Issue
Block a user