-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rust: introduce ExtractedFile::hasSemantics and ::isSkippedByCompilation
#20655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| category: minorAnalysis | ||
| --- | ||
| * Added `ExtractedFile::hasSemantics` and `ExtractedFile::isSkippedByCompilation` predicates. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| | Cargo.toml:0:0:0:0 | Cargo.toml | fromSource: no | | ||
| | a_file.rs:0:0:0:0 | a_file.rs | fromSource: yes | | ||
| | another_file.rs:0:0:0:0 | another_file.rs | fromSource: yes | | ||
| | lib.rs:0:0:0:0 | lib.rs | fromSource: yes | | ||
| | nested.rs:0:0:0:0 | nested.rs | fromSource: yes | | ||
| | nested/file.rs:0:0:0:0 | nested/file.rs | fromSource: yes | | ||
| | Cargo.toml:0:0:0:0 | Cargo.toml | fromSource: no | hasSemantics: no | isSkippedByCompilation: no | | ||
| | a_file.rs:0:0:0:0 | a_file.rs | fromSource: yes | hasSemantics: yes | isSkippedByCompilation: no | | ||
| | another_file.rs:0:0:0:0 | another_file.rs | fromSource: yes | hasSemantics: yes | isSkippedByCompilation: no | | ||
| | bad_cargo/Cargo.toml:0:0:0:0 | bad_cargo/Cargo.toml | fromSource: no | hasSemantics: no | isSkippedByCompilation: no | | ||
| | bad_cargo/src/no_semantics.rs:0:0:0:0 | bad_cargo/src/no_semantics.rs | fromSource: yes | hasSemantics: no | isSkippedByCompilation: no | | ||
| | lib.rs:0:0:0:0 | lib.rs | fromSource: yes | hasSemantics: yes | isSkippedByCompilation: no | | ||
| | nested.rs:0:0:0:0 | nested.rs | fromSource: yes | hasSemantics: yes | isSkippedByCompilation: no | | ||
| | nested/file.rs:0:0:0:0 | nested/file.rs | fromSource: yes | hasSemantics: yes | isSkippedByCompilation: no | | ||
| | nested/not_compiled.rs:0:0:0:0 | nested/not_compiled.rs | fromSource: yes | hasSemantics: no | isSkippedByCompilation: yes | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my education: what (in the Cargo setup) makes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not pulled in as a module. By default:
If a file is not mentioned by a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, so it's
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,15 @@ | ||
| import rust | ||
|
|
||
| from File f, string fromSource | ||
| from File f, string fromSource, string hasSemantics, string isSkippedByCompilation | ||
| where | ||
| exists(f.getRelativePath()) and | ||
| if f.fromSource() then fromSource = "fromSource: yes" else fromSource = "fromSource: no" | ||
| select f, fromSource | ||
| (if f.fromSource() then fromSource = "fromSource: yes" else fromSource = "fromSource: no") and | ||
| ( | ||
| if f.(ExtractedFile).hasSemantics() | ||
| then hasSemantics = "hasSemantics: yes" | ||
| else hasSemantics = "hasSemantics: no" | ||
| ) and | ||
| if f.(ExtractedFile).isSkippedByCompilation() | ||
| then isSkippedByCompilation = "isSkippedByCompilation: yes" | ||
| else isSkippedByCompilation = "isSkippedByCompilation: no" | ||
| select f, fromSource, hasSemantics, isSkippedByCompilation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| !/Cargo.toml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| wrong |
Uh oh!
There was an error while loading. Please reload this page.