Commit Graph

212 Commits

Author SHA1 Message Date
Paolo Tranquilli
d8dad7dff0 Merge branch 'main' into redsun82/rust-trait-path 2025-02-24 14:12:53 +01:00
Paolo Tranquilli
8ef2029f3d Merge pull request #18756 from github/redsun82/rust-config
Rust: expose more rust-analyzer config knobs
2025-02-24 12:51:37 +01:00
Paolo Tranquilli
689e7b8440 Rust: fix <X as Y> path extraction
This works around a quirk in rust-analyzer's AST generation machinery,
where for an `<X as Y>` path there might be no way to directly get `Y`
from the path segment.
2025-02-24 10:38:15 +01:00
Paolo Tranquilli
45baceb2f5 Merge pull request #18821 from github/redsun82/rust-license
Rust: add licensing information to crates and extractor pack
2025-02-20 22:20:40 +01:00
Paolo Tranquilli
1038f7c035 Rust: add licensing information to crates and extractor pack 2025-02-20 10:22:17 +01:00
Paolo Tranquilli
d0461e2c08 Merge branch 'main' into redsun82/rust-config 2025-02-19 17:09:04 +01:00
Paolo Tranquilli
755140152c Rust: support glob members in workspaces 2025-02-17 15:09:35 +01:00
Paolo Tranquilli
e1f92b466f Merge pull request #18608 from github/aibaars/tracing
Rust: use tracing/tracing-subscriber for logging
2025-02-14 10:36:54 +01:00
Paolo Tranquilli
a6f58c9fd2 Rust: add option for proc macro server 2025-02-13 15:37:54 +01:00
Paolo Tranquilli
3dd7f23d5a Merge branch 'redsun82/rust-avoid-linecol-panic' into redsun82/rust-config 2025-02-12 17:02:19 +01:00
Paolo Tranquilli
234d63bb97 Rust: avoid panic from line_index crate
We found out we can stumble upon a `line_index.line_col` panic,
specifically when reporting a macro parse error.

This replaces `line_col` with safer `try_line_col`, and deals more
gracefully with the error.
2025-02-12 16:52:36 +01:00
Arthur Baars
18cf39d063 Rust: add verbosity and flamegraph as extractor options 2025-02-12 15:29:27 +01:00
Paolo Tranquilli
1bd384564d Rust: expose more rust-analyzer config knobs 2025-02-12 14:14:43 +01:00
Arthur Baars
64f0908d0d Rust: keep FlushGuard in a variable 2025-02-12 10:27:34 +01:00
Arthur Baars
5621eecc86 Rust: config: replace verbose with verbosity 2025-02-12 10:27:33 +01:00
Arthur Baars
3218faee6c Rust: make flame_log a config option 2025-02-12 10:27:32 +01:00
Arthur Baars
0442d24204 Rust: drop tracing:: qualifiers 2025-02-12 10:27:30 +01:00
Arthur Baars
c602e82ac4 Rust: use tracing-subscriber 2025-02-12 10:27:29 +01:00
Arthur Baars
8d96c87abe Rust: add UseTree::is_star 2025-01-28 16:12:25 +01:00
Paolo Tranquilli
e6cb376ad8 Rust: fix typo 2025-01-17 12:31:48 +01:00
Paolo Tranquilli
bbaff8b199 Rust: cleanup workspace aggregation 2025-01-17 12:19:56 +01:00
Paolo Tranquilli
3c064284b0 Rust: aggregate projects into workspaces 2025-01-15 17:17:19 +01:00
Tom Hvitved
ed07da4327 Rust: Include nested .rs files in codeql test run 2025-01-14 14:35:34 +01:00
Paolo Tranquilli
7988729ee6 Rust: run sysroot discovery once 2025-01-13 16:13:55 +01:00
Paolo Tranquilli
cae7236f61 Rust: update dependencies 2025-01-13 12:43:43 +01:00
Paolo Tranquilli
6ded99ccb1 Merge branch 'main' into redsun82/cargo-upgrade 2025-01-09 16:05:48 +01:00
Paolo Tranquilli
4f79199498 Rust: replace std::fs::canonicalize with dunce::canonicalize
Rust-analyzer turned out to be quite picky about paths, where
`//?/`-prefixed paths can lead to flaky failures. See

https://github.com/rust-lang/rust-analyzer/issues/18894

for details.

This makes paths always be canonicalized with `dunce`. Previously,
`dunce` was used as a fallback, but that stopped working somewhere
after version 0.0.248 of rust-analyzer.
2025-01-09 15:43:15 +01:00
Paolo Tranquilli
cd95cc8f94 Rust: update rust-analyzer to 0.0.257 2025-01-09 15:34:07 +01:00
Paolo Tranquilli
53b0a3464d Merge branch 'main' into redsun82/rust-ast-generator-mustache 2025-01-08 17:09:39 +01:00
Paolo Tranquilli
3bf2416e56 Merge pull request #18313 from github/redsun82/rust-mute-warnings-in-uncompiled-blocks
Rust: exclude extraction of code excluded by `cfg`
2025-01-08 17:03:29 +01:00
Paolo Tranquilli
c7a9889606 Rust: update rust-analyzer 2025-01-08 11:14:08 +01:00
Paolo Tranquilli
d2c7decd02 Rust/Ruby: upgrade all cargo dependencies excluding rust-analyzer
The rust-analyzer update will need more work as it seems to break rust
analysis on windows.

This was carried out using `cargo upgrade` from `cargo-edit`:
* getting exclusions options for rust-analyzer with
   ```bash
   cargo upgrade -i --dry-run | grep -o 'ra_ap_\S\+' | sort -u | sed 's/^/--exclude=/' > /tmp/exclude
   ```
* running
   ```bash
   cargo upgrade -i $(cat /tmp/exclude)
   misc/bazel/3rdparty/update_cargo_deps.sh
   ```
2025-01-08 09:57:11 +01:00
Paolo Tranquilli
b390fac105 Rust: make ast-generator use mustache templates
This simplifies the code and decouples the code template from the data
that is fed into it.
2025-01-07 18:05:59 +01:00
Paolo Tranquilli
b4811906ea Rust: address review 2025-01-07 13:05:19 +01:00
Paolo Tranquilli
10d8aa454b Merge branch 'main' into redsun82/rust-mute-warnings-in-uncompiled-blocks 2025-01-06 10:01:57 +01:00
Paolo Tranquilli
485586f780 Rust: reinstate extraction of test code
Users will still be able to opt out:
* for unit tests, by providing the `cargo_cfg_overrides=-test` extractor
  option
* for integration tests, by excluding the test files from the analysis
  using `paths-ignore` in the codescanning configuration file

We may want to revisit whether we want a single option for both. Also
further work will be needed to restrict our security queries to non-test
code on the QL side.
2024-12-20 14:12:41 +01:00
Paolo Tranquilli
218bc8069b Rust: exclude extraction of code excluded by cfg 2024-12-18 13:34:40 +01:00
Arthur Baars
71959f5faa Rust: address clippy warnings 2024-12-18 13:00:13 +01:00
Arthur Baars
029e2604a3 Rust: //rust/codegen 2024-12-17 14:07:44 +01:00
Arthur Baars
3928efe05f Rust: update rust.ungram 2024-12-17 14:05:12 +01:00
Paolo Tranquilli
4c4a8d7619 Rust: extract isRef for SelfParam 2024-12-16 14:24:56 +01:00
Paolo Tranquilli
08de0b40ed Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-04 14:35:10 +01:00
Paolo Tranquilli
31b9b3adaa Merge branch 'main' into redsun82/rust-perf-measures 2024-12-04 10:50:37 +01:00
Paolo Tranquilli
59ea563d2a Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-04 10:44:11 +01:00
Paolo Tranquilli
e30a429c3d Rust: revert TupleStructPat.toString improvements 2024-12-04 10:34:28 +01:00
Paolo Tranquilli
53503002a1 Merge branch 'main' into redsun82/rust-tweaks 2024-12-04 09:35:01 +01:00
Paolo Tranquilli
353f1cafe6 Rust: distinguish [a, b] from [a; b]
This splits the `ArrayExpr` class into `ArrayListExpr` and `ArrayRepeatExpr`.
This uses the `synth.from_class` machinery to integrate seamlessly into the
generated code, by hiding the extracted `ArrayExpr` behind an internal class
and replacing it with a hierarchy of those two classes under a new
`ArrayExpr` class.
2024-12-03 15:09:20 +01:00
Paolo Tranquilli
ebe38bca23 Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-03 12:19:08 +01:00
Paolo Tranquilli
db18d1046b Rust: rename getTy -> getTypeRepr 2024-12-03 11:17:08 +01:00
Paolo Tranquilli
e89cf303e7 Rust: rename TypeRef -> TypeRepr 2024-12-02 17:58:40 +01:00