mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Address review comment
This commit is contained in:
@@ -2826,20 +2826,10 @@ private AssociatedTypeTypeParameter getFutureOutputTypeParameter() {
|
|||||||
result.getTypeAlias() = any(FutureTrait ft).getOutputType()
|
result.getTypeAlias() = any(FutureTrait ft).getOutputType()
|
||||||
}
|
}
|
||||||
|
|
||||||
private predicate isReturnExprCfgAncestor(AstNode n) {
|
|
||||||
n instanceof ReturnExpr
|
|
||||||
or
|
|
||||||
exists(AstNode mid |
|
|
||||||
isReturnExprCfgAncestor(mid) and
|
|
||||||
n = mid.getParentNode() and
|
|
||||||
n.getEnclosingCfgScope() = mid.getEnclosingCfgScope()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
pragma[nomagic]
|
pragma[nomagic]
|
||||||
predicate isUnitBlockExpr(BlockExpr be) {
|
predicate isUnitBlockExpr(BlockExpr be) {
|
||||||
not be.getStmtList().hasTailExpr() and
|
not be.getStmtList().hasTailExpr() and
|
||||||
not isReturnExprCfgAncestor(be) and
|
not be = any(Callable c).getBody() and
|
||||||
not be.hasLabel()
|
not be.hasLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2865,7 +2865,7 @@ mod block_types {
|
|||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn f4(cond: bool) -> i32 {
|
fn f4(cond: bool) -> i32 {
|
||||||
let a = { // $ MISSING: certainType=a:()
|
let a = { // $ certainType=a:()
|
||||||
if cond {
|
if cond {
|
||||||
return 12;
|
return 12;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6476,8 +6476,11 @@ inferType
|
|||||||
| main.rs:2863:16:2863:16 | 0 | | {EXTERNAL LOCATION} | i32 |
|
| main.rs:2863:16:2863:16 | 0 | | {EXTERNAL LOCATION} | i32 |
|
||||||
| main.rs:2867:11:2867:14 | cond | | {EXTERNAL LOCATION} | bool |
|
| main.rs:2867:11:2867:14 | cond | | {EXTERNAL LOCATION} | bool |
|
||||||
| main.rs:2867:30:2875:5 | { ... } | | {EXTERNAL LOCATION} | i32 |
|
| main.rs:2867:30:2875:5 | { ... } | | {EXTERNAL LOCATION} | i32 |
|
||||||
|
| main.rs:2868:13:2868:13 | a | | file://:0:0:0:0 | () |
|
||||||
|
| main.rs:2868:17:2872:9 | { ... } | | file://:0:0:0:0 | () |
|
||||||
| main.rs:2869:13:2871:13 | if cond {...} | | file://:0:0:0:0 | () |
|
| main.rs:2869:13:2871:13 | if cond {...} | | file://:0:0:0:0 | () |
|
||||||
| main.rs:2869:16:2869:19 | cond | | {EXTERNAL LOCATION} | bool |
|
| main.rs:2869:16:2869:19 | cond | | {EXTERNAL LOCATION} | bool |
|
||||||
|
| main.rs:2869:21:2871:13 | { ... } | | file://:0:0:0:0 | () |
|
||||||
| main.rs:2870:24:2870:25 | 12 | | {EXTERNAL LOCATION} | i32 |
|
| main.rs:2870:24:2870:25 | 12 | | {EXTERNAL LOCATION} | i32 |
|
||||||
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | | file://:0:0:0:0 | & |
|
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | | file://:0:0:0:0 | & |
|
||||||
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | &T | {EXTERNAL LOCATION} | str |
|
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | &T | {EXTERNAL LOCATION} | str |
|
||||||
@@ -6485,6 +6488,7 @@ inferType
|
|||||||
| main.rs:2873:18:2873:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
|
| main.rs:2873:18:2873:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
|
||||||
| main.rs:2873:18:2873:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
|
| main.rs:2873:18:2873:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
|
||||||
| main.rs:2873:18:2873:29 | { ... } | | file://:0:0:0:0 | () |
|
| main.rs:2873:18:2873:29 | { ... } | | file://:0:0:0:0 | () |
|
||||||
|
| main.rs:2873:29:2873:29 | a | | file://:0:0:0:0 | () |
|
||||||
| main.rs:2874:9:2874:9 | 0 | | {EXTERNAL LOCATION} | i32 |
|
| main.rs:2874:9:2874:9 | 0 | | {EXTERNAL LOCATION} | i32 |
|
||||||
| main.rs:2883:11:2918:1 | { ... } | | file://:0:0:0:0 | () |
|
| main.rs:2883:11:2918:1 | { ... } | | file://:0:0:0:0 | () |
|
||||||
| main.rs:2884:5:2884:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
| main.rs:2884:5:2884:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||||
|
|||||||
Reference in New Issue
Block a user