mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Rust: Type inference for macro expressions
This commit is contained in:
@@ -265,6 +265,8 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat
|
||||
n1 = be.getLhs() and
|
||||
n2 = be.getRhs()
|
||||
)
|
||||
or
|
||||
n1 = n2.(MacroExpr).getMacroCall().getMacroCallExpansion()
|
||||
)
|
||||
or
|
||||
n1 = n2.(RefExpr).getExpr() and
|
||||
|
||||
@@ -1812,7 +1812,7 @@ mod indexers {
|
||||
|
||||
mod macros {
|
||||
pub fn f() {
|
||||
let x = format!("Hello, {}", "World!"); // $ MISSING: type=x:String
|
||||
let x = format!("Hello, {}", "World!"); // $ MISSING: type=x:String -- needs https://github.com/github/codeql/pull/19658
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1021,8 +1021,12 @@ inferType
|
||||
| main.rs:912:19:912:22 | self | Snd | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:913:43:913:82 | MacroExpr | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:913:50:913:81 | "PairNone has no second elemen... | | {EXTERNAL LOCATION} | str |
|
||||
| main.rs:913:50:913:81 | MacroExpr | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:913:50:913:81 | { ... } | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:914:43:914:81 | MacroExpr | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:914:50:914:80 | "PairFst has no second element... | | {EXTERNAL LOCATION} | str |
|
||||
| main.rs:914:50:914:80 | MacroExpr | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:914:50:914:80 | { ... } | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:915:37:915:39 | snd | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:915:45:915:47 | snd | | main.rs:910:15:910:17 | Snd |
|
||||
| main.rs:916:41:916:43 | snd | | main.rs:910:15:910:17 | Snd |
|
||||
|
||||
Reference in New Issue
Block a user