Skip to content

Commit fb8b79e

Browse files
committed
Rust: Skip model generation for functions with semicolon in canonical path
1 parent d66c12b commit fb8b79e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ private predicate relevant(Function api) {
1515
// Only include functions that have a resolved path.
1616
api.hasCrateOrigin() and
1717
api.hasExtendedCanonicalPath() and
18+
// A canonical path can contain `;` as the syntax for array types use `;`. For
19+
// instance `<[Foo; 1] as Bar>::baz`. This does not work with the shared model
20+
// generator and it is not clear if this will also be the case when we move to
21+
// QL created canoonical paths, so for now we just exclude functions with
22+
// `;`s.
23+
not exists(api.getExtendedCanonicalPath().indexOf(";")) and
1824
(
1925
// This excludes closures (these are not exported API endpoints) and
20-
// functions without a `pub` visiblity. A function can be `pub` without
26+
// functions without a `pub` visibility. A function can be `pub` without
2127
// ultimately being exported by a crate, so this is an overapproximation.
2228
api.hasVisibility()
2329
or

0 commit comments

Comments
 (0)