mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +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)
|
||||
|
||||
Reference in New Issue
Block a user