mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge remote-tracking branch 'upstream/main' into lifetimetest
This commit is contained in:
@@ -23,7 +23,7 @@ BinaryExpr/gen_binary_expr.rs 5ea68396dc2e3ff7fcaf5a5201636dd175dd45be36647b6ae0
|
||||
BlockExpr/gen_block_expr.rs 17b06c726e304e0efcfde8e71afd9c657860312be554366894236125cb08719e 17b06c726e304e0efcfde8e71afd9c657860312be554366894236125cb08719e
|
||||
BoxPat/gen_box_pat.rs 1493e24b732370b577ade38c47db17fa157df19f5390606a67a6040e49b501c0 1493e24b732370b577ade38c47db17fa157df19f5390606a67a6040e49b501c0
|
||||
BreakExpr/gen_break_expr.rs aacdf9df7fc51d19742b9e813835c0bd0913017e8d62765960e06b27d58b9031 aacdf9df7fc51d19742b9e813835c0bd0913017e8d62765960e06b27d58b9031
|
||||
CallExpr/gen_call_expr.rs 013a7c878996aefb25b94b68eebc4f0b1bb74ccd09e91c491980817a383e2401 013a7c878996aefb25b94b68eebc4f0b1bb74ccd09e91c491980817a383e2401
|
||||
CallExpr/gen_call_expr.rs 228705e9b0c46d34aa035da3c139a8c3e93fb144d3310592d5bad38ac97382c2 228705e9b0c46d34aa035da3c139a8c3e93fb144d3310592d5bad38ac97382c2
|
||||
CastExpr/gen_cast_expr.rs c3892211fbae4fed7cb1f25ff1679fd79d2878bf0bf2bd4b7982af23d00129f5 c3892211fbae4fed7cb1f25ff1679fd79d2878bf0bf2bd4b7982af23d00129f5
|
||||
ClosureExpr/gen_closure_expr.rs bd95408103b7f2084e526e6d35cf3319b2e9d7219aff4c80e4e6691180c549b4 bd95408103b7f2084e526e6d35cf3319b2e9d7219aff4c80e4e6691180c549b4
|
||||
Comment/gen_comment.rs 1e1f9f43161a79c096c2056e8b7f5346385ab7addcdec68c2d53b383dd3debe6 1e1f9f43161a79c096c2056e8b7f5346385ab7addcdec68c2d53b383dd3debe6
|
||||
@@ -80,7 +80,7 @@ MatchArmList/gen_match_arm_list.rs 6dcb92591c86771d2aeb762e4274d3e61a7d6c1a42da3
|
||||
MatchExpr/gen_match_expr.rs 081c5d4c78cb71ccd13fb37a93d7f525267c51b179f44b5a22ca3297897002a0 081c5d4c78cb71ccd13fb37a93d7f525267c51b179f44b5a22ca3297897002a0
|
||||
MatchGuard/gen_match_guard.rs f0e84a1f608c0361983c516a40216cea149620a36e0aed7ff39b0b7d77a9ab8a f0e84a1f608c0361983c516a40216cea149620a36e0aed7ff39b0b7d77a9ab8a
|
||||
Meta/gen_meta.rs 39172a1f7dd02fa3149e7a1fc1dc1f135aa87c84057ee721cd9b373517042b25 39172a1f7dd02fa3149e7a1fc1dc1f135aa87c84057ee721cd9b373517042b25
|
||||
MethodCallExpr/gen_method_call_expr.rs f2b4679eb1ec095981fe6bd656b632c22bf6bd0da133309da3f7ef5bd1ab4b5d f2b4679eb1ec095981fe6bd656b632c22bf6bd0da133309da3f7ef5bd1ab4b5d
|
||||
MethodCallExpr/gen_method_call_expr.rs f696e63c5302f46dcac7bc2914fe899d029996d5064ffe8252cfa173a06f9dd3 f696e63c5302f46dcac7bc2914fe899d029996d5064ffe8252cfa173a06f9dd3
|
||||
Module/gen_module.rs 815605a604fea1d9276684f8d6738a4e833eacad57ceeb27e2095fc450264fc1 815605a604fea1d9276684f8d6738a4e833eacad57ceeb27e2095fc450264fc1
|
||||
Name/gen_name.rs 8a7fe65ee632a47d12eaa313e7248ac9210e5a381e9522499ca68f94c39e72c0 8a7fe65ee632a47d12eaa313e7248ac9210e5a381e9522499ca68f94c39e72c0
|
||||
NameRef/gen_name_ref.rs c8c922e77a7d62b8272359ccdabbf7e15411f31ca85f15a3afdd94bec7ec64e7 c8c922e77a7d62b8272359ccdabbf7e15411f31ca85f15a3afdd94bec7ec64e7
|
||||
@@ -129,8 +129,8 @@ Trait/gen_trait.rs bac694993e224f9c6dd86cfb28c54846ae1b3bae45a1e58d3149c88418448
|
||||
TraitAlias/gen_trait_alias.rs 425d78a7cb87db7737ceaf713c9a62e0411537374d1bc58c5b1fb80cc25732c9 425d78a7cb87db7737ceaf713c9a62e0411537374d1bc58c5b1fb80cc25732c9
|
||||
TryExpr/gen_try_expr.rs f60198181a423661f4ed1bf6f98d475f40ada190b7b5fc6af97aa5e45ca29a1e f60198181a423661f4ed1bf6f98d475f40ada190b7b5fc6af97aa5e45ca29a1e
|
||||
TupleExpr/gen_tuple_expr.rs 27e56846b3f08c37c8a345169c2a532b2023d231d46a5bdf586bbc6d8fb36a01 27e56846b3f08c37c8a345169c2a532b2023d231d46a5bdf586bbc6d8fb36a01
|
||||
TupleField/gen_tuple_field.rs 5d6b4f356af895541f975cc1fd90116fd047fe914c2049d47f61e4a43a8c2af4 5d6b4f356af895541f975cc1fd90116fd047fe914c2049d47f61e4a43a8c2af4
|
||||
TupleFieldList/gen_tuple_field_list.rs 42f0af8c391fb9e33fe09b791e0e719cadf5143b58764f8a5d38f8d9054daca7 42f0af8c391fb9e33fe09b791e0e719cadf5143b58764f8a5d38f8d9054daca7
|
||||
TupleField/gen_tuple_field.rs 20507753ddb979a33d0e568ae5ebe466f039e7ab7b8f2e6ce15b28b3e4450615 20507753ddb979a33d0e568ae5ebe466f039e7ab7b8f2e6ce15b28b3e4450615
|
||||
TupleFieldList/gen_tuple_field_list.rs 4702b92cfca9c4db9b84cb846c5d44569ad3f3e40cd07e9015d144152c684fd0 4702b92cfca9c4db9b84cb846c5d44569ad3f3e40cd07e9015d144152c684fd0
|
||||
TuplePat/gen_tuple_pat.rs b1b0c9c5ff1b787f380644691c77807655a4f6441fc7431c90ecf78c54c26148 b1b0c9c5ff1b787f380644691c77807655a4f6441fc7431c90ecf78c54c26148
|
||||
TupleStructPat/gen_tuple_struct_pat.rs 601ca8813272d15b4c8fd7402d0d28a42a62be82865eb5e86b985ad31464ca98 601ca8813272d15b4c8fd7402d0d28a42a62be82865eb5e86b985ad31464ca98
|
||||
TupleTypeRepr/gen_tuple_type_repr.rs 64873a6a1cd5df6cd10165d7e9fa0399902b6bfbac086ef3a7ce83237b816879 64873a6a1cd5df6cd10165d7e9fa0399902b6bfbac086ef3a7ce83237b816879
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
instances
|
||||
| gen_call_expr.rs:5:5:5:11 | foo(...) |
|
||||
| gen_call_expr.rs:6:5:6:23 | foo::<...>(...) |
|
||||
| gen_call_expr.rs:7:5:7:14 | ...(...) |
|
||||
| gen_call_expr.rs:8:5:8:10 | foo(...) |
|
||||
| gen_call_expr.rs:8:5:8:11 | foo(...) |
|
||||
| gen_call_expr.rs:9:5:9:23 | foo::<...>(...) |
|
||||
| gen_call_expr.rs:10:5:10:14 | ...(...) |
|
||||
| gen_call_expr.rs:11:5:11:20 | ...::Some(...) |
|
||||
getArgList
|
||||
| gen_call_expr.rs:5:5:5:11 | foo(...) | gen_call_expr.rs:5:8:5:11 | ArgList |
|
||||
| gen_call_expr.rs:6:5:6:23 | foo::<...>(...) | gen_call_expr.rs:6:20:6:23 | ArgList |
|
||||
| gen_call_expr.rs:7:5:7:14 | ...(...) | gen_call_expr.rs:7:11:7:14 | ArgList |
|
||||
| gen_call_expr.rs:8:5:8:10 | foo(...) | gen_call_expr.rs:8:8:8:10 | ArgList |
|
||||
| gen_call_expr.rs:8:5:8:11 | foo(...) | gen_call_expr.rs:8:8:8:11 | ArgList |
|
||||
| gen_call_expr.rs:9:5:9:23 | foo::<...>(...) | gen_call_expr.rs:9:20:9:23 | ArgList |
|
||||
| gen_call_expr.rs:10:5:10:14 | ...(...) | gen_call_expr.rs:10:11:10:14 | ArgList |
|
||||
| gen_call_expr.rs:11:5:11:20 | ...::Some(...) | gen_call_expr.rs:11:17:11:20 | ArgList |
|
||||
getAttr
|
||||
getArg
|
||||
| gen_call_expr.rs:5:5:5:11 | foo(...) | 0 | gen_call_expr.rs:5:9:5:10 | 42 |
|
||||
| gen_call_expr.rs:6:5:6:23 | foo::<...>(...) | 0 | gen_call_expr.rs:6:21:6:22 | 42 |
|
||||
| gen_call_expr.rs:7:5:7:14 | ...(...) | 0 | gen_call_expr.rs:7:12:7:13 | 42 |
|
||||
| gen_call_expr.rs:8:5:8:10 | foo(...) | 0 | gen_call_expr.rs:8:9:8:9 | 1 |
|
||||
getFunction
|
||||
| gen_call_expr.rs:5:5:5:11 | foo(...) | gen_call_expr.rs:5:5:5:7 | foo |
|
||||
| gen_call_expr.rs:6:5:6:23 | foo::<...>(...) | gen_call_expr.rs:6:5:6:19 | foo::<...> |
|
||||
| gen_call_expr.rs:7:5:7:14 | ...(...) | gen_call_expr.rs:7:5:7:10 | foo[0] |
|
||||
| gen_call_expr.rs:8:5:8:10 | foo(...) | gen_call_expr.rs:8:5:8:7 | foo |
|
||||
| gen_call_expr.rs:8:5:8:11 | foo(...) | gen_call_expr.rs:8:5:8:7 | foo |
|
||||
| gen_call_expr.rs:9:5:9:23 | foo::<...>(...) | gen_call_expr.rs:9:5:9:19 | foo::<...> |
|
||||
| gen_call_expr.rs:10:5:10:14 | ...(...) | gen_call_expr.rs:10:5:10:10 | foo[0] |
|
||||
| gen_call_expr.rs:11:5:11:20 | ...::Some(...) | gen_call_expr.rs:11:5:11:16 | ...::Some |
|
||||
|
||||
@@ -12,10 +12,6 @@ query predicate getAttr(CallExpr x, int index, Attr getAttr) {
|
||||
toBeTested(x) and not x.isUnknown() and getAttr = x.getAttr(index)
|
||||
}
|
||||
|
||||
query predicate getArg(CallExpr x, int index, Expr getArg) {
|
||||
toBeTested(x) and not x.isUnknown() and getArg = x.getArg(index)
|
||||
}
|
||||
|
||||
query predicate getFunction(CallExpr x, Expr getFunction) {
|
||||
toBeTested(x) and not x.isUnknown() and getFunction = x.getFunction()
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
// generated by codegen, do not edit
|
||||
|
||||
fn test_call_expr() -> () {
|
||||
// A function call expression. For example:
|
||||
// NOTE: Consider using `Call` instead, as that excludes call expressions that are
|
||||
// instantiations of tuple structs and tuple variants.
|
||||
//
|
||||
// A call expression. For example:
|
||||
foo(42);
|
||||
foo::<u32, u64>(42);
|
||||
foo[0](42);
|
||||
foo(1) = 4;
|
||||
Option::Some(42); // tuple variant instantiation
|
||||
}
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
instances
|
||||
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) |
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) |
|
||||
| gen_method_call_expr.rs:9:5:9:13 | x.foo(...) |
|
||||
| gen_method_call_expr.rs:10:5:10:25 | x.foo(...) |
|
||||
getArgList
|
||||
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:10:5:13 | ArgList |
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:22:6:25 | ArgList |
|
||||
| gen_method_call_expr.rs:9:5:9:13 | x.foo(...) | gen_method_call_expr.rs:9:10:9:13 | ArgList |
|
||||
| gen_method_call_expr.rs:10:5:10:25 | x.foo(...) | gen_method_call_expr.rs:10:22:10:25 | ArgList |
|
||||
getAttr
|
||||
getArg
|
||||
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | 0 | gen_method_call_expr.rs:5:11:5:12 | 42 |
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | 0 | gen_method_call_expr.rs:6:23:6:24 | 42 |
|
||||
getGenericArgList
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:10:6:21 | <...> |
|
||||
| gen_method_call_expr.rs:10:5:10:25 | x.foo(...) | gen_method_call_expr.rs:10:10:10:21 | <...> |
|
||||
getIdentifier
|
||||
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:7:5:9 | foo |
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:7:6:9 | foo |
|
||||
| gen_method_call_expr.rs:9:5:9:13 | x.foo(...) | gen_method_call_expr.rs:9:7:9:9 | foo |
|
||||
| gen_method_call_expr.rs:10:5:10:25 | x.foo(...) | gen_method_call_expr.rs:10:7:10:9 | foo |
|
||||
getReceiver
|
||||
| gen_method_call_expr.rs:5:5:5:13 | x.foo(...) | gen_method_call_expr.rs:5:5:5:5 | x |
|
||||
| gen_method_call_expr.rs:6:5:6:25 | x.foo(...) | gen_method_call_expr.rs:6:5:6:5 | x |
|
||||
| gen_method_call_expr.rs:9:5:9:13 | x.foo(...) | gen_method_call_expr.rs:9:5:9:5 | x |
|
||||
| gen_method_call_expr.rs:10:5:10:25 | x.foo(...) | gen_method_call_expr.rs:10:5:10:5 | x |
|
||||
|
||||
@@ -12,10 +12,6 @@ query predicate getAttr(MethodCallExpr x, int index, Attr getAttr) {
|
||||
toBeTested(x) and not x.isUnknown() and getAttr = x.getAttr(index)
|
||||
}
|
||||
|
||||
query predicate getArg(MethodCallExpr x, int index, Expr getArg) {
|
||||
toBeTested(x) and not x.isUnknown() and getArg = x.getArg(index)
|
||||
}
|
||||
|
||||
query predicate getGenericArgList(MethodCallExpr x, GenericArgList getGenericArgList) {
|
||||
toBeTested(x) and not x.isUnknown() and getGenericArgList = x.getGenericArgList()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// generated by codegen, do not edit
|
||||
|
||||
fn test_method_call_expr() -> () {
|
||||
// NOTE: Consider using `MethodCall` instead, as that also includes calls to methods using
|
||||
// call syntax (such as `Foo::method(x)`), operation syntax (such as `x + y`), and
|
||||
// indexing syntax (such as `x[y]`).
|
||||
//
|
||||
// A method call expression. For example:
|
||||
x.foo(42);
|
||||
x.foo::<u32, u64>(42);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// generated by codegen, do not edit
|
||||
|
||||
fn test_tuple_field() -> () {
|
||||
// A field in a tuple struct or tuple enum variant.
|
||||
// A field in a tuple struct or tuple variant.
|
||||
//
|
||||
// For example:
|
||||
struct S(i32, String);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// generated by codegen, do not edit
|
||||
|
||||
fn test_tuple_field_list() -> () {
|
||||
// A list of fields in a tuple struct or tuple enum variant.
|
||||
// A list of fields in a tuple struct or tuple variant.
|
||||
//
|
||||
// For example:
|
||||
struct S(i32, String);
|
||||
|
||||
@@ -1770,7 +1770,7 @@ proc_macro.rs:
|
||||
# 16| getIdentifier(): [NameRef] items
|
||||
# 15| getMatchArmList(): [MatchArmList] MatchArmList
|
||||
# 15| getArm(0): [MatchArm] ... => ...
|
||||
# 15| getExpr(): [CallExpr] ...::RepInterp(...)
|
||||
# 15| getExpr(): [TupleStructExpr] ...::RepInterp(...)
|
||||
# 15| getArgList(): [ArgList] ArgList
|
||||
# 15| getArg(0): [VariableAccess] _x
|
||||
# 15| getPath(): [Path] _x
|
||||
|
||||
@@ -41,6 +41,9 @@ edges
|
||||
| main.rs:73:10:73:10 | [post] b [&ref] | main.rs:74:15:74:15 | b [&ref] | provenance | |
|
||||
| main.rs:73:14:73:23 | source(...) | main.rs:73:10:73:10 | [post] b [&ref] | provenance | |
|
||||
| main.rs:74:15:74:15 | b [&ref] | main.rs:74:14:74:15 | * ... | provenance | MaD:1 |
|
||||
| main.rs:90:11:90:16 | [post] &mut a [&ref] | main.rs:90:16:90:16 | [post] a | provenance | |
|
||||
| main.rs:90:16:90:16 | [post] a | main.rs:91:14:91:14 | a | provenance | |
|
||||
| main.rs:90:21:90:30 | source(...) | main.rs:90:11:90:16 | [post] &mut a [&ref] | provenance | |
|
||||
| main.rs:105:10:105:10 | [post] c [&ref] | main.rs:106:15:106:15 | c [&ref] | provenance | |
|
||||
| main.rs:105:14:105:23 | source(...) | main.rs:105:10:105:10 | [post] c [&ref] | provenance | |
|
||||
| main.rs:106:15:106:15 | c [&ref] | main.rs:106:14:106:15 | * ... | provenance | MaD:1 |
|
||||
@@ -175,6 +178,10 @@ nodes
|
||||
| main.rs:73:14:73:23 | source(...) | semmle.label | source(...) |
|
||||
| main.rs:74:14:74:15 | * ... | semmle.label | * ... |
|
||||
| main.rs:74:15:74:15 | b [&ref] | semmle.label | b [&ref] |
|
||||
| main.rs:90:11:90:16 | [post] &mut a [&ref] | semmle.label | [post] &mut a [&ref] |
|
||||
| main.rs:90:16:90:16 | [post] a | semmle.label | [post] a |
|
||||
| main.rs:90:21:90:30 | source(...) | semmle.label | source(...) |
|
||||
| main.rs:91:14:91:14 | a | semmle.label | a |
|
||||
| main.rs:105:10:105:10 | [post] c [&ref] | semmle.label | [post] c [&ref] |
|
||||
| main.rs:105:14:105:23 | source(...) | semmle.label | source(...) |
|
||||
| main.rs:106:14:106:15 | * ... | semmle.label | * ... |
|
||||
@@ -288,6 +295,7 @@ testFailures
|
||||
| main.rs:53:14:53:15 | * ... | main.rs:51:17:51:26 | source(...) | main.rs:53:14:53:15 | * ... | $@ | main.rs:51:17:51:26 | source(...) | source(...) |
|
||||
| main.rs:59:33:59:34 | * ... | main.rs:57:22:57:31 | source(...) | main.rs:59:33:59:34 | * ... | $@ | main.rs:57:22:57:31 | source(...) | source(...) |
|
||||
| main.rs:74:14:74:15 | * ... | main.rs:73:14:73:23 | source(...) | main.rs:74:14:74:15 | * ... | $@ | main.rs:73:14:73:23 | source(...) | source(...) |
|
||||
| main.rs:91:14:91:14 | a | main.rs:90:21:90:30 | source(...) | main.rs:91:14:91:14 | a | $@ | main.rs:90:21:90:30 | source(...) | source(...) |
|
||||
| main.rs:106:14:106:15 | * ... | main.rs:105:14:105:23 | source(...) | main.rs:106:14:106:15 | * ... | $@ | main.rs:105:14:105:23 | source(...) | source(...) |
|
||||
| main.rs:113:14:113:15 | * ... | main.rs:112:25:112:34 | source(...) | main.rs:113:14:113:15 | * ... | $@ | main.rs:112:25:112:34 | source(...) | source(...) |
|
||||
| main.rs:175:14:175:34 | my_number.to_number() | main.rs:174:44:174:53 | source(...) | main.rs:175:14:175:34 | my_number.to_number() | $@ | main.rs:174:44:174:53 | source(...) | source(...) |
|
||||
|
||||
@@ -88,7 +88,7 @@ mod intraprocedural_mutable_borrows {
|
||||
let mut a = 1;
|
||||
sink(a);
|
||||
*(&mut a) = source(87);
|
||||
sink(a); // $ MISSING: hasValueFlow=87
|
||||
sink(a); // $ hasValueFlow=87
|
||||
}
|
||||
|
||||
pub fn clear_through_borrow() {
|
||||
|
||||
@@ -183,7 +183,11 @@ edges
|
||||
| test.rs:389:61:389:66 | [post] buffer | test.rs:392:23:392:33 | buffer[...] | provenance | |
|
||||
| test.rs:391:23:391:28 | buffer | test.rs:391:22:391:28 | &buffer | provenance | |
|
||||
| test.rs:392:23:392:33 | buffer[...] | test.rs:392:22:392:33 | &... | provenance | |
|
||||
| test.rs:399:63:399:73 | &mut reader [&ref] | test.rs:399:63:399:73 | [post] &mut reader [&ref] | provenance | MaD:13 |
|
||||
| test.rs:399:63:399:73 | &mut reader [&ref] | test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | provenance | MaD:13 |
|
||||
| test.rs:399:63:399:73 | [post] &mut reader [&ref] | test.rs:399:68:399:73 | [post] reader | provenance | |
|
||||
| test.rs:399:68:399:73 | [post] reader | test.rs:403:31:403:36 | reader | provenance | |
|
||||
| test.rs:399:68:399:73 | [post] reader | test.rs:408:55:408:60 | reader | provenance | |
|
||||
| test.rs:399:68:399:73 | reader | test.rs:399:63:399:73 | &mut reader [&ref] | provenance | |
|
||||
| test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | test.rs:399:81:399:87 | [post] buffer1 | provenance | |
|
||||
| test.rs:399:81:399:87 | [post] buffer1 | test.rs:400:19:400:40 | buffer1[...] | provenance | |
|
||||
@@ -257,7 +261,15 @@ edges
|
||||
| test.rs:447:61:447:66 | [post] buffer | test.rs:450:23:450:33 | buffer[...] | provenance | |
|
||||
| test.rs:448:19:448:24 | buffer | test.rs:448:18:448:24 | &buffer | provenance | |
|
||||
| test.rs:450:23:450:33 | buffer[...] | test.rs:450:22:450:33 | &... | provenance | |
|
||||
| test.rs:457:63:457:74 | &mut reader2 [&ref] | test.rs:457:63:457:74 | [post] &mut reader2 [&ref] | provenance | MaD:13 |
|
||||
| test.rs:457:63:457:74 | &mut reader2 [&ref] | test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | provenance | MaD:13 |
|
||||
| test.rs:457:63:457:74 | [post] &mut reader2 [&ref] | test.rs:457:68:457:74 | [post] reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:461:31:461:37 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:467:44:467:50 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:479:26:479:32 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:486:31:486:37 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:493:31:493:37 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | test.rs:500:31:500:37 | reader2 | provenance | |
|
||||
| test.rs:457:68:457:74 | reader2 | test.rs:457:63:457:74 | &mut reader2 [&ref] | provenance | |
|
||||
| test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | test.rs:457:82:457:88 | [post] buffer1 | provenance | |
|
||||
| test.rs:457:82:457:88 | [post] buffer1 | test.rs:458:19:458:40 | buffer1[...] | provenance | |
|
||||
@@ -461,6 +473,8 @@ nodes
|
||||
| test.rs:392:22:392:33 | &... | semmle.label | &... |
|
||||
| test.rs:392:23:392:33 | buffer[...] | semmle.label | buffer[...] |
|
||||
| test.rs:399:63:399:73 | &mut reader [&ref] | semmle.label | &mut reader [&ref] |
|
||||
| test.rs:399:63:399:73 | [post] &mut reader [&ref] | semmle.label | [post] &mut reader [&ref] |
|
||||
| test.rs:399:68:399:73 | [post] reader | semmle.label | [post] reader |
|
||||
| test.rs:399:68:399:73 | reader | semmle.label | reader |
|
||||
| test.rs:399:76:399:87 | [post] &mut buffer1 [&ref] | semmle.label | [post] &mut buffer1 [&ref] |
|
||||
| test.rs:399:81:399:87 | [post] buffer1 | semmle.label | [post] buffer1 |
|
||||
@@ -529,6 +543,8 @@ nodes
|
||||
| test.rs:450:22:450:33 | &... | semmle.label | &... |
|
||||
| test.rs:450:23:450:33 | buffer[...] | semmle.label | buffer[...] |
|
||||
| test.rs:457:63:457:74 | &mut reader2 [&ref] | semmle.label | &mut reader2 [&ref] |
|
||||
| test.rs:457:63:457:74 | [post] &mut reader2 [&ref] | semmle.label | [post] &mut reader2 [&ref] |
|
||||
| test.rs:457:68:457:74 | [post] reader2 | semmle.label | [post] reader2 |
|
||||
| test.rs:457:68:457:74 | reader2 | semmle.label | reader2 |
|
||||
| test.rs:457:77:457:88 | [post] &mut buffer1 [&ref] | semmle.label | [post] &mut buffer1 [&ref] |
|
||||
| test.rs:457:82:457:88 | [post] buffer1 | semmle.label | [post] buffer1 |
|
||||
|
||||
@@ -10,37 +10,45 @@
|
||||
| test_cookie.rs:21:28:21:34 | [0; 64] | test_cookie.rs:21:28:21:34 | [0; 64] | test_cookie.rs:22:16:22:24 | ...::from | This hard-coded value is used as $@. | test_cookie.rs:22:16:22:24 | ...::from | a key |
|
||||
| test_cookie.rs:38:28:38:36 | [0u8; 64] | test_cookie.rs:38:28:38:36 | [0u8; 64] | test_cookie.rs:42:14:42:32 | ...::from | This hard-coded value is used as $@. | test_cookie.rs:42:14:42:32 | ...::from | a key |
|
||||
| test_cookie.rs:49:23:49:25 | 0u8 | test_cookie.rs:49:23:49:25 | 0u8 | test_cookie.rs:53:14:53:32 | ...::from | This hard-coded value is used as $@. | test_cookie.rs:53:14:53:32 | ...::from | a key |
|
||||
| test_heuristic.rs:44:31:44:38 | [0u8; 16] | test_heuristic.rs:44:31:44:38 | [0u8; 16] | test_heuristic.rs:45:41:45:48 | const_iv | This hard-coded value is used as $@. | test_heuristic.rs:45:41:45:48 | const_iv | an initialization vector |
|
||||
| test_heuristic.rs:63:30:63:37 | "secret" | test_heuristic.rs:63:30:63:37 | "secret" | test_heuristic.rs:63:30:63:37 | "secret" | This hard-coded value is used as $@. | test_heuristic.rs:63:30:63:37 | "secret" | a password |
|
||||
| test_heuristic.rs:64:20:64:27 | [0u8; 16] | test_heuristic.rs:64:20:64:27 | [0u8; 16] | test_heuristic.rs:64:19:64:27 | &... | This hard-coded value is used as $@. | test_heuristic.rs:64:19:64:27 | &... | a nonce |
|
||||
| test_heuristic.rs:65:31:65:38 | [0u8; 16] | test_heuristic.rs:65:31:65:38 | [0u8; 16] | test_heuristic.rs:65:30:65:38 | &... | This hard-coded value is used as $@. | test_heuristic.rs:65:30:65:38 | &... | a salt |
|
||||
| test_heuristic.rs:67:22:67:22 | 0 | test_heuristic.rs:67:22:67:22 | 0 | test_heuristic.rs:67:22:67:22 | 0 | This hard-coded value is used as $@. | test_heuristic.rs:67:22:67:22 | 0 | a salt |
|
||||
| test_heuristic.rs:69:32:69:32 | 1 | test_heuristic.rs:69:32:69:32 | 1 | test_heuristic.rs:69:22:69:32 | ... + ... | This hard-coded value is used as $@. | test_heuristic.rs:69:22:69:32 | ... + ... | a salt |
|
||||
| test_heuristic.rs:70:34:70:35 | 32 | test_heuristic.rs:70:34:70:35 | 32 | test_heuristic.rs:70:22:70:62 | ... ^ ... | This hard-coded value is used as $@. | test_heuristic.rs:70:22:70:62 | ... ^ ... | a salt |
|
||||
| test_heuristic.rs:70:52:70:61 | 0xFFFFFFFF | test_heuristic.rs:70:52:70:61 | 0xFFFFFFFF | test_heuristic.rs:70:22:70:62 | ... ^ ... | This hard-coded value is used as $@. | test_heuristic.rs:70:22:70:62 | ... ^ ... | a salt |
|
||||
edges
|
||||
| test_cipher.rs:18:9:18:14 | const1 [&ref] | test_cipher.rs:19:73:19:78 | const1 [&ref] | provenance | |
|
||||
| test_cipher.rs:18:28:18:36 | &... [&ref] | test_cipher.rs:18:9:18:14 | const1 [&ref] | provenance | |
|
||||
| test_cipher.rs:18:29:18:36 | [0u8; 16] | test_cipher.rs:18:28:18:36 | &... [&ref] | provenance | |
|
||||
| test_cipher.rs:19:49:19:79 | ...::from_slice(...) [&ref] | test_cipher.rs:19:30:19:47 | ...::new | provenance | MaD:3 Sink:MaD:3 |
|
||||
| test_cipher.rs:19:73:19:78 | const1 [&ref] | test_cipher.rs:19:49:19:79 | ...::from_slice(...) [&ref] | provenance | MaD:9 |
|
||||
| test_cipher.rs:19:73:19:78 | const1 [&ref] | test_cipher.rs:19:49:19:79 | ...::from_slice(...) [&ref] | provenance | MaD:10 |
|
||||
| test_cipher.rs:25:9:25:14 | const4 [&ref] | test_cipher.rs:26:66:26:71 | const4 [&ref] | provenance | |
|
||||
| test_cipher.rs:25:28:25:36 | &... [&ref] | test_cipher.rs:25:9:25:14 | const4 [&ref] | provenance | |
|
||||
| test_cipher.rs:25:29:25:36 | [0u8; 16] | test_cipher.rs:25:28:25:36 | &... [&ref] | provenance | |
|
||||
| test_cipher.rs:26:42:26:72 | ...::from_slice(...) [&ref] | test_cipher.rs:26:30:26:40 | ...::new | provenance | MaD:4 Sink:MaD:4 |
|
||||
| test_cipher.rs:26:66:26:71 | const4 [&ref] | test_cipher.rs:26:42:26:72 | ...::from_slice(...) [&ref] | provenance | MaD:9 |
|
||||
| test_cipher.rs:26:66:26:71 | const4 [&ref] | test_cipher.rs:26:42:26:72 | ...::from_slice(...) [&ref] | provenance | MaD:10 |
|
||||
| test_cipher.rs:29:9:29:14 | const5 [&ref] | test_cipher.rs:30:95:30:100 | const5 [&ref] | provenance | |
|
||||
| test_cipher.rs:29:28:29:36 | &... [&ref] | test_cipher.rs:29:9:29:14 | const5 [&ref] | provenance | |
|
||||
| test_cipher.rs:29:29:29:36 | [0u8; 16] | test_cipher.rs:29:28:29:36 | &... [&ref] | provenance | |
|
||||
| test_cipher.rs:30:72:30:101 | ...::from_slice(...) [&ref] | test_cipher.rs:30:30:30:40 | ...::new | provenance | MaD:5 Sink:MaD:5 |
|
||||
| test_cipher.rs:30:95:30:100 | const5 [&ref] | test_cipher.rs:30:72:30:101 | ...::from_slice(...) [&ref] | provenance | MaD:9 |
|
||||
| test_cipher.rs:30:95:30:100 | const5 [&ref] | test_cipher.rs:30:72:30:101 | ...::from_slice(...) [&ref] | provenance | MaD:10 |
|
||||
| test_cipher.rs:37:9:37:14 | const7 | test_cipher.rs:38:74:38:79 | const7 | provenance | |
|
||||
| test_cipher.rs:37:27:37:74 | [...] | test_cipher.rs:37:9:37:14 | const7 | provenance | |
|
||||
| test_cipher.rs:38:49:38:80 | ...::from_slice(...) [&ref] | test_cipher.rs:38:30:38:47 | ...::new | provenance | MaD:3 Sink:MaD:3 |
|
||||
| test_cipher.rs:38:73:38:79 | &const7 [&ref] | test_cipher.rs:38:49:38:80 | ...::from_slice(...) [&ref] | provenance | MaD:9 |
|
||||
| test_cipher.rs:38:73:38:79 | &const7 [&ref] | test_cipher.rs:38:49:38:80 | ...::from_slice(...) [&ref] | provenance | MaD:10 |
|
||||
| test_cipher.rs:38:74:38:79 | const7 | test_cipher.rs:38:73:38:79 | &const7 [&ref] | provenance | |
|
||||
| test_cipher.rs:41:9:41:14 | const8 [&ref] | test_cipher.rs:42:73:42:78 | const8 [&ref] | provenance | |
|
||||
| test_cipher.rs:41:28:41:76 | &... [&ref] | test_cipher.rs:41:9:41:14 | const8 [&ref] | provenance | |
|
||||
| test_cipher.rs:41:29:41:76 | [...] | test_cipher.rs:41:28:41:76 | &... [&ref] | provenance | |
|
||||
| test_cipher.rs:42:49:42:79 | ...::from_slice(...) [&ref] | test_cipher.rs:42:30:42:47 | ...::new | provenance | MaD:3 Sink:MaD:3 |
|
||||
| test_cipher.rs:42:73:42:78 | const8 [&ref] | test_cipher.rs:42:49:42:79 | ...::from_slice(...) [&ref] | provenance | MaD:9 |
|
||||
| test_cipher.rs:42:73:42:78 | const8 [&ref] | test_cipher.rs:42:49:42:79 | ...::from_slice(...) [&ref] | provenance | MaD:10 |
|
||||
| test_cipher.rs:50:9:50:15 | const10 [element] | test_cipher.rs:51:75:51:81 | const10 [element] | provenance | |
|
||||
| test_cipher.rs:50:37:50:52 | ...::zeroed | test_cipher.rs:50:37:50:54 | ...::zeroed(...) [element] | provenance | Src:MaD:7 |
|
||||
| test_cipher.rs:50:37:50:54 | ...::zeroed(...) [element] | test_cipher.rs:50:9:50:15 | const10 [element] | provenance | |
|
||||
| test_cipher.rs:51:50:51:82 | ...::from_slice(...) [&ref, element] | test_cipher.rs:51:31:51:48 | ...::new | provenance | MaD:3 Sink:MaD:3 Sink:MaD:3 |
|
||||
| test_cipher.rs:51:74:51:81 | &const10 [&ref, element] | test_cipher.rs:51:50:51:82 | ...::from_slice(...) [&ref, element] | provenance | MaD:9 |
|
||||
| test_cipher.rs:51:74:51:81 | &const10 [&ref, element] | test_cipher.rs:51:50:51:82 | ...::from_slice(...) [&ref, element] | provenance | MaD:10 |
|
||||
| test_cipher.rs:51:75:51:81 | const10 [element] | test_cipher.rs:51:74:51:81 | &const10 [&ref, element] | provenance | |
|
||||
| test_cipher.rs:73:9:73:14 | const2 [&ref] | test_cipher.rs:74:46:74:51 | const2 [&ref] | provenance | |
|
||||
| test_cipher.rs:73:18:73:26 | &... [&ref] | test_cipher.rs:73:9:73:14 | const2 [&ref] | provenance | |
|
||||
@@ -59,9 +67,19 @@ edges
|
||||
| test_cookie.rs:38:28:38:36 | [0u8; 64] | test_cookie.rs:38:18:38:37 | ...::from(...) | provenance | MaD:8 |
|
||||
| test_cookie.rs:42:34:42:39 | array2 | test_cookie.rs:42:14:42:32 | ...::from | provenance | MaD:2 Sink:MaD:2 |
|
||||
| test_cookie.rs:49:9:49:14 | array3 [element] | test_cookie.rs:53:34:53:39 | array3 [element] | provenance | |
|
||||
| test_cookie.rs:49:23:49:25 | 0u8 | test_cookie.rs:49:23:49:29 | ...::from_elem(...) [element] | provenance | MaD:10 |
|
||||
| test_cookie.rs:49:23:49:25 | 0u8 | test_cookie.rs:49:23:49:29 | ...::from_elem(...) [element] | provenance | MaD:11 |
|
||||
| test_cookie.rs:49:23:49:29 | ...::from_elem(...) [element] | test_cookie.rs:49:9:49:14 | array3 [element] | provenance | |
|
||||
| test_cookie.rs:53:34:53:39 | array3 [element] | test_cookie.rs:53:14:53:32 | ...::from | provenance | MaD:2 Sink:MaD:2 |
|
||||
| test_heuristic.rs:44:9:44:16 | const_iv [&ref] | test_heuristic.rs:45:41:45:48 | const_iv | provenance | |
|
||||
| test_heuristic.rs:44:30:44:38 | &... [&ref] | test_heuristic.rs:44:9:44:16 | const_iv [&ref] | provenance | |
|
||||
| test_heuristic.rs:44:31:44:38 | [0u8; 16] | test_heuristic.rs:44:30:44:38 | &... [&ref] | provenance | |
|
||||
| test_heuristic.rs:64:20:64:27 | [0u8; 16] | test_heuristic.rs:64:19:64:27 | &... | provenance | |
|
||||
| test_heuristic.rs:65:31:65:38 | [0u8; 16] | test_heuristic.rs:65:30:65:38 | &... | provenance | |
|
||||
| test_heuristic.rs:69:32:69:32 | 1 | test_heuristic.rs:69:22:69:32 | ... + ... | provenance | |
|
||||
| test_heuristic.rs:70:23:70:35 | ... << ... | test_heuristic.rs:70:22:70:62 | ... ^ ... | provenance | |
|
||||
| test_heuristic.rs:70:34:70:35 | 32 | test_heuristic.rs:70:22:70:62 | ... ^ ... | provenance | |
|
||||
| test_heuristic.rs:70:34:70:35 | 32 | test_heuristic.rs:70:23:70:35 | ... << ... | provenance | MaD:9 |
|
||||
| test_heuristic.rs:70:52:70:61 | 0xFFFFFFFF | test_heuristic.rs:70:22:70:62 | ... ^ ... | provenance | |
|
||||
models
|
||||
| 1 | Sink: <_ as crypto_common::KeyInit>::new_from_slice; Argument[0]; credentials-key |
|
||||
| 2 | Sink: <biscotti::crypto::master::Key>::from; Argument[0]; credentials-key |
|
||||
@@ -71,8 +89,9 @@ models
|
||||
| 6 | Sink: <cookie::secure::key::Key>::from; Argument[0].Reference; credentials-key |
|
||||
| 7 | Source: core::mem::zeroed; ReturnValue.Element; constant-source |
|
||||
| 8 | Summary: <_ as core::convert::From>::from; Argument[0]; ReturnValue; taint |
|
||||
| 9 | Summary: <generic_array::GenericArray>::from_slice; Argument[0].Reference; ReturnValue.Reference; value |
|
||||
| 10 | Summary: alloc::vec::from_elem; Argument[0]; ReturnValue.Element; value |
|
||||
| 9 | Summary: <core::u64 as core::ops::bit::Shl>::shl; Argument[0]; ReturnValue; taint |
|
||||
| 10 | Summary: <generic_array::GenericArray>::from_slice; Argument[0].Reference; ReturnValue.Reference; value |
|
||||
| 11 | Summary: alloc::vec::from_elem; Argument[0]; ReturnValue.Element; value |
|
||||
nodes
|
||||
| test_cipher.rs:18:9:18:14 | const1 [&ref] | semmle.label | const1 [&ref] |
|
||||
| test_cipher.rs:18:28:18:36 | &... [&ref] | semmle.label | &... [&ref] |
|
||||
@@ -136,4 +155,20 @@ nodes
|
||||
| test_cookie.rs:49:23:49:29 | ...::from_elem(...) [element] | semmle.label | ...::from_elem(...) [element] |
|
||||
| test_cookie.rs:53:14:53:32 | ...::from | semmle.label | ...::from |
|
||||
| test_cookie.rs:53:34:53:39 | array3 [element] | semmle.label | array3 [element] |
|
||||
| test_heuristic.rs:44:9:44:16 | const_iv [&ref] | semmle.label | const_iv [&ref] |
|
||||
| test_heuristic.rs:44:30:44:38 | &... [&ref] | semmle.label | &... [&ref] |
|
||||
| test_heuristic.rs:44:31:44:38 | [0u8; 16] | semmle.label | [0u8; 16] |
|
||||
| test_heuristic.rs:45:41:45:48 | const_iv | semmle.label | const_iv |
|
||||
| test_heuristic.rs:63:30:63:37 | "secret" | semmle.label | "secret" |
|
||||
| test_heuristic.rs:64:19:64:27 | &... | semmle.label | &... |
|
||||
| test_heuristic.rs:64:20:64:27 | [0u8; 16] | semmle.label | [0u8; 16] |
|
||||
| test_heuristic.rs:65:30:65:38 | &... | semmle.label | &... |
|
||||
| test_heuristic.rs:65:31:65:38 | [0u8; 16] | semmle.label | [0u8; 16] |
|
||||
| test_heuristic.rs:67:22:67:22 | 0 | semmle.label | 0 |
|
||||
| test_heuristic.rs:69:22:69:32 | ... + ... | semmle.label | ... + ... |
|
||||
| test_heuristic.rs:69:32:69:32 | 1 | semmle.label | 1 |
|
||||
| test_heuristic.rs:70:22:70:62 | ... ^ ... | semmle.label | ... ^ ... |
|
||||
| test_heuristic.rs:70:23:70:35 | ... << ... | semmle.label | ... << ... |
|
||||
| test_heuristic.rs:70:34:70:35 | 32 | semmle.label | 32 |
|
||||
| test_heuristic.rs:70:52:70:61 | 0xFFFFFFFF | semmle.label | 0xFFFFFFFF |
|
||||
subpaths
|
||||
|
||||
71
rust/ql/test/query-tests/security/CWE-798/test_heuristic.rs
Normal file
71
rust/ql/test/query-tests/security/CWE-798/test_heuristic.rs
Normal file
@@ -0,0 +1,71 @@
|
||||
|
||||
// --- tests ---
|
||||
|
||||
fn encrypt_with(plaintext: &str, key: &[u8;16], iv: &[u8;16]) {
|
||||
// ...
|
||||
}
|
||||
|
||||
fn encrypt2(plaintext: &str, crypto_key: &[u8;16], iv_bytes: &[u8;16]) {
|
||||
// ...
|
||||
}
|
||||
|
||||
fn database_op(text: &str, primary_key: &str, pivot: &str) {
|
||||
// note: this one has nothing to do with encryption, but has
|
||||
// `key` and `iv` contained within the parameter names.
|
||||
}
|
||||
|
||||
struct MyCryptor {
|
||||
}
|
||||
|
||||
impl MyCryptor {
|
||||
fn new(password: &str) -> MyCryptor {
|
||||
MyCryptor { }
|
||||
}
|
||||
|
||||
fn set_nonce(&self, nonce: &[u8;16]) {
|
||||
// ...
|
||||
}
|
||||
|
||||
fn encrypt(&self, plaintext: &str, salt: &[u8;16]) {
|
||||
// ...
|
||||
}
|
||||
|
||||
fn set_salt_u64(&self, salt: u64) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
fn test(var_string: &str, var_data: &[u8;16], var_u64: u64) {
|
||||
encrypt_with("plaintext", var_data, var_data);
|
||||
|
||||
let const_key: &[u8;16] = &[0u8;16]; // $ MISSING: Alert[rust/hard-coded-cryptographic-value]
|
||||
encrypt_with("plaintext", const_key, var_data); // $ MISSING: Sink
|
||||
|
||||
let const_iv: &[u8;16] = &[0u8;16]; // $ Alert[rust/hard-coded-cryptographic-value]
|
||||
encrypt_with("plaintext", var_data, const_iv); // $ Sink
|
||||
|
||||
encrypt2("plaintext", var_data, var_data);
|
||||
|
||||
let const_key2: &[u8;16] = &[1u8;16]; // $ MISSING: Alert[rust/hard-coded-cryptographic-value]
|
||||
encrypt2("plaintext", const_key2, var_data); // $ MISSING: Sink
|
||||
|
||||
let const_iv: &[u8;16] = &[1u8;16]; // $ MISSING: Alert[rust/hard-coded-cryptographic-value]
|
||||
encrypt2("plaintext", var_data, const_iv); // $ MISSING: Sink
|
||||
|
||||
let const_key_str = "primary_key";
|
||||
let const_pivot_str = "pivot";
|
||||
database_op("text", const_key_str, const_pivot_str);
|
||||
|
||||
let mc1 = MyCryptor::new(var_string);
|
||||
mc1.set_nonce(var_data);
|
||||
mc1.encrypt("plaintext", var_data);
|
||||
|
||||
let mc2 = MyCryptor::new("secret"); // $ Alert[rust/hard-coded-cryptographic-value]
|
||||
mc2.set_nonce(&[0u8;16]); // $ Alert[rust/hard-coded-cryptographic-value]
|
||||
mc2.encrypt("plaintext", &[0u8;16]); // $ Alert[rust/hard-coded-cryptographic-value]
|
||||
|
||||
mc2.set_salt_u64(0); // $ Alert[rust/hard-coded-cryptographic-value]
|
||||
mc2.set_salt_u64(var_u64);
|
||||
mc2.set_salt_u64(var_u64 + 1); // $ SPURIOUS: Alert[rust/hard-coded-cryptographic-value]
|
||||
mc2.set_salt_u64((var_u64 << 32) ^ (var_u64 & 0xFFFFFFFF)); // $ SPURIOUS: Alert[rust/hard-coded-cryptographic-value]
|
||||
}
|
||||
@@ -299,8 +299,7 @@ impl<T> MyOption<T> {
|
||||
}
|
||||
|
||||
// summary=<test::option::MyOption>::insert;Argument[0];Argument[self].Reference.Field[test::option::MyOption::MySome(0)];value;dfc-generated
|
||||
// This summary is currently missing because of access path limit
|
||||
// summary-MISSING=<test::option::MyOption>::insert;Argument[0];ReturnValue.Reference;value;dfc-generated
|
||||
// summary=<test::option::MyOption>::insert;Argument[0];ReturnValue.Reference;value;dfc-generated
|
||||
// The content of `self` is overwritten so it does not flow to the return value.
|
||||
// SPURIOUS-summary=<test::option::MyOption>::insert;Argument[self].Reference.Field[test::option::MyOption::MySome(0)];ReturnValue.Reference;value;dfc-generated
|
||||
pub fn insert(&mut self, value: T) -> &mut T {
|
||||
@@ -311,8 +310,7 @@ impl<T> MyOption<T> {
|
||||
}
|
||||
|
||||
// summary=<test::option::MyOption>::get_or_insert;Argument[0];Argument[self].Reference.Field[test::option::MyOption::MySome(0)];value;dfc-generated
|
||||
// This summary is currently missing because of access path limit
|
||||
// summary-MISSING=<test::option::MyOption>::get_or_insert;Argument[0];ReturnValue.Reference;value;dfc-generated
|
||||
// summary=<test::option::MyOption>::get_or_insert;Argument[0];ReturnValue.Reference;value;dfc-generated
|
||||
// summary=<test::option::MyOption>::get_or_insert;Argument[self].Reference.Field[test::option::MyOption::MySome(0)];ReturnValue.Reference;value;dfc-generated
|
||||
pub fn get_or_insert(&mut self, value: T) -> &mut T {
|
||||
self.get_or_insert_with(|| value)
|
||||
@@ -328,7 +326,7 @@ impl<T> MyOption<T> {
|
||||
|
||||
// summary=<test::option::MyOption>::get_or_insert_with;Argument[self].Reference.Field[test::option::MyOption::MySome(0)];ReturnValue.Reference;value;dfc-generated
|
||||
// summary=<test::option::MyOption>::get_or_insert_with;Argument[0].ReturnValue;Argument[self].Reference.Field[test::option::MyOption::MySome(0)];value;dfc-generated
|
||||
// SPURIOUS-summary=<test::option::MyOption>::get_or_insert_with;Argument[0];Argument[self].Reference.Field[test::option::MyOption::MySome(0)];value;dfc-generated
|
||||
// summary=<test::option::MyOption>::get_or_insert_with;Argument[0].ReturnValue;ReturnValue.Reference;value;dfc-generated
|
||||
pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut T
|
||||
where
|
||||
F: FnOnce() -> T,
|
||||
|
||||
Reference in New Issue
Block a user