Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
979704d
Fix not applicable on statement for convert_to_guarded_return
A4-Tacks Oct 26, 2025
c0ecf1a
Implement Span::line() and Span::column() for proc-macro server
tilladam Jan 2, 2026
fd1457d
Merge pull request #21405 from tilladam/master
Veykril Jan 5, 2026
4fbc520
perf: Re-use scratch allocations for `try_evaluate_obligations`
Veykril Jan 5, 2026
978d75e
Merge pull request #21407 from Veykril/push-wlvmrkvowrlr
Veykril Jan 5, 2026
4699fdc
Fix loses exists guard for move_guard
A4-Tacks Jan 6, 2026
a978fdc
fix: use crates where ADT was defined in deref_chain of trait_applica…
sshcrack Jan 6, 2026
6cc9e5c
Document `Query`
Veykril Jan 7, 2026
1af7813
Document `WithFixture`
Veykril Jan 7, 2026
ad02093
feat: Allow rust paths in symbol search
Veykril Jan 7, 2026
dc64aef
fix: Properly lower `SelfOnly` predicates
ShoyuVanilla Jan 4, 2026
74c3f3a
Merge pull request #21414 from sshcrack/master
ShoyuVanilla Jan 7, 2026
e2b5072
Add ProjectJsonTargetSpec.project_root
cormacrelf Dec 2, 2025
ff94498
project-model: Helpers for traversing dep graph in ProjectJson
cormacrelf Dec 2, 2025
3083bde
project-model: Don't do O(n) clones as well as O(n) search
cormacrelf Dec 2, 2025
ac64177
project-model: Return crate by reference
cormacrelf Sep 4, 2024
3b97d38
Fix misuse of ?
cormacrelf Dec 2, 2025
327ea18
flycheck: Make the flycheckable unit a flycheck::PackageSpecifier enum
cormacrelf Sep 4, 2024
95a07db
project-model: Introduce RunnableKind::Flycheck
cormacrelf Sep 4, 2024
2a899bb
flycheck: Use RunnableKind::Flycheck from ProjectJson to flycheck
cormacrelf Sep 4, 2024
7f608da
flycheck: Support {label} in check_overrideCommand as well as $saved_…
cormacrelf Sep 4, 2024
4e61c60
flycheck: Always flycheck single crate if there is a build label from…
cormacrelf Sep 4, 2024
778de45
flycheck: Add display_command to pretty-print flycheck command being …
cormacrelf Sep 4, 2024
53a371c
flycheck: notifications show full command when configured in a rust-p…
cormacrelf Sep 4, 2024
3fdb78c
flycheck: Rename FlycheckConfig::CargoCommand to Automatic
cormacrelf Dec 3, 2025
2d58177
Fix RunnableKind::Run label interpolation
cormacrelf Dec 3, 2025
71e2ded
doc: Update docs for runnables to include run/flycheck
cormacrelf Dec 3, 2025
422597f
doc: make example for workspace.discoverConfig actually work
cormacrelf Dec 3, 2025
f06a6b9
doc: overhaul non-cargo build system docs
cormacrelf Dec 3, 2025
b02e975
Fix hir-ty clippy issue
cormacrelf Jan 7, 2026
be1e357
Merge pull request #21399 from ShoyuVanilla/self-only-preds
ChayimFriedman2 Jan 7, 2026
6a9de22
Prepare for merging from rust-lang/rust
invalid-email-address Jan 8, 2026
09c878a
Merge ref '548e586795f6' from rust-lang/rust
invalid-email-address Jan 8, 2026
e22a450
Merge pull request #21419 from rust-lang/rustc-pull
lnicola Jan 8, 2026
d68a73a
Merge pull request #18043 from cormacrelf/feature/rust-project-discovery
Veykril Jan 8, 2026
5d8a7da
Fixes for builtin derive expansions
ChayimFriedman2 Jan 8, 2026
d87c468
Merge pull request #21421 from ChayimFriedman2/no-derive-register
ChayimFriedman2 Jan 8, 2026
459d77e
Publish smol_str v0.3.5
ChayimFriedman2 Jan 8, 2026
3e1dd59
Merge pull request #21422 from ChayimFriedman2/new-smol-str
ChayimFriedman2 Jan 8, 2026
26be33a
Fix not disable string escape highlights
A4-Tacks Jan 8, 2026
491c320
Merge pull request #21420 from A4-Tacks/disable-string-hl
ChayimFriedman2 Jan 9, 2026
e80fbd4
Fix lifetimes len diagnostics for fn pointers
ChayimFriedman2 Jan 9, 2026
e52695c
internal: Include private definitions in generated rustdoc
Wilfred Jan 9, 2026
66ba447
Merge pull request #21433 from Wilfred/rustdoc_private_items
ChayimFriedman2 Jan 9, 2026
998a5ac
Remove code made redundant by method resolution rewrite
ChayimFriedman2 Jan 9, 2026
bcf059c
Fix issue with ignore attribute for tests where the attribute has a v…
cry-inc Jan 9, 2026
4f7e395
Merge pull request #21432 from ChayimFriedman2/fn-ptr-lifetime-diag
ShoyuVanilla Jan 10, 2026
c825a50
Cleanup
Veykril Jan 10, 2026
2c356a3
Merge pull request #21415 from Veykril/push-qusurvyqwmxt
Veykril Jan 10, 2026
25c0131
Merge pull request #21434 from ChayimFriedman2/traits-mix
ShoyuVanilla Jan 10, 2026
4e18f1d
Abstract proc-macro-srv input and output away
Veykril Jan 10, 2026
366b80e
Merge pull request #21438 from Veykril/push-prppzzzllqso
Veykril Jan 10, 2026
27fef0c
internal: Landing integration test infra for proc-macro-srv-cli
Veykril Jan 10, 2026
83c635a
Merge pull request #21436 from cry-inc/bugfix/fix-ignore-attribute-wi…
ChayimFriedman2 Jan 10, 2026
e40bd1c
Add inherit attributes for extract_function assist
A4-Tacks Jan 11, 2026
8150413
add byte range subrequest/response
Shourya742 Jan 7, 2026
e909b4b
update proc-macro-srv to include byte-range
Shourya742 Jan 7, 2026
e68a654
add byte range to main loop and direct the request via callback and d…
Shourya742 Jan 7, 2026
78d243c
add comment on incrementality of subrequest
Shourya742 Jan 8, 2026
d30f7c9
add write read imports
Shourya742 Jan 11, 2026
581444f
Merge pull request #21416 from Shourya742/2026-01-07-add-byte-range
Veykril Jan 11, 2026
33f0f80
add make corresponding constructor methods in SyntaxFactory
Shourya742 Jan 11, 2026
16d74e7
migrate generate_mut_trait_impl to new SyntaxEditor
Shourya742 Jan 11, 2026
594ca4b
Prepare for merging from rust-lang/rust
invalid-email-address Jan 12, 2026
0f0951f
Merge ref '44a5b55557c2' from rust-lang/rust
invalid-email-address Jan 12, 2026
80acef1
Format code
invalid-email-address Jan 12, 2026
b4d49de
Merge pull request #21439 from Veykril/push-okkmmxmnwyxm
Veykril Jan 12, 2026
294a0af
Disable `unused_variables` and `unused_mut` warnings
ChayimFriedman2 Jan 12, 2026
19aae35
Create a new `SymbolKind::CrateRoot`
Veykril Jan 12, 2026
5f6d385
Fix crate root search in world symbols duplicating root entries
Veykril Jan 12, 2026
8cbceb4
Merge pull request #21446 from Veykril/veykril/push-wnuyntxqruqm
Veykril Jan 12, 2026
febc131
Merge pull request #21444 from rust-lang/rustc-pull
lnicola Jan 12, 2026
55f6901
Fix lowering with supertrait predicates
Wilfred Dec 29, 2025
e6e5e5d
Merge pull request #21364 from Wilfred/fix_cycle_projections
ChayimFriedman2 Jan 12, 2026
01ebc28
smol_str: update changelog 0.3.5
alexheretic Jan 12, 2026
c20e6a1
Fix not complete `mut` and `raw` in `&x.foo()`
A4-Tacks Jan 12, 2026
21790ef
Merge pull request #21445 from ChayimFriedman2/disable-mir-warnings
Veykril Jan 12, 2026
62e777c
Fix overlapping cfg attributes for wasm32-unknown-emscripten target
robertoaloi Jan 12, 2026
bc7f853
Merge pull request #21448 from alexheretic/smol-str-changelog-0.3.5
ChayimFriedman2 Jan 12, 2026
dc029f0
Merge pull request #21450 from robertoaloi/wasm32-overlapping-cfg
lnicola Jan 12, 2026
3950a27
Merge pull request #21443 from Shourya742/2026-01-11-migrate-get_mut_…
ShoyuVanilla Jan 13, 2026
1a2200a
Merge pull request #21451 from A4-Tacks/comp-ref-mut-before-method-call
ShoyuVanilla Jan 13, 2026
38fb3a7
Merge pull request #21412 from A4-Tacks/move-guard-exist
ShoyuVanilla Jan 13, 2026
58b85be
Merge pull request #20946 from A4-Tacks/to-guarded-in-stmt
ShoyuVanilla Jan 13, 2026
467b4e4
Merge pull request #21442 from A4-Tacks/extract-func-attrs
ShoyuVanilla Jan 13, 2026
2c32c0e
Make `naked_asm!()` always return `!`
ChayimFriedman2 Jan 13, 2026
a215480
Migrate `unwrap_block` assist to use SyntaxEditor
A4-Tacks Jan 13, 2026
8d983e9
Merge pull request #21456 from ChayimFriedman2/naked-asm
Veykril Jan 13, 2026
8fb704c
fix: Hide renamed imports from macros in symbol index
Veykril Jan 13, 2026
c3dfd5d
Merge pull request #21459 from Veykril/push-oqtvruwxtsyn
Veykril Jan 13, 2026
8f953de
feat: Implement support for `feature(new_range)`
Veykril Jan 13, 2026
6948a66
fix: Sync cast checks to rustc again
ShoyuVanilla Jan 13, 2026
332287d
Merge pull request #21462 from ShoyuVanilla/cast-fix
ChayimFriedman2 Jan 13, 2026
6b21796
Merge pull request #21458 from A4-Tacks/migrate-unwrap-block
ShoyuVanilla Jan 14, 2026
05939a8
Fix false positive precedence in `(2 as i32) < 3`
A4-Tacks Jan 14, 2026
4b5b42c
remove postcard from legacy
Shourya742 Jan 14, 2026
31817f6
remove flatten from ExpandMacro message in bidirectional messages
Shourya742 Jan 14, 2026
3f9de55
Merge pull request #21466 from Shourya742/2026-01-14-remove-postcard-…
Veykril Jan 14, 2026
98e1f71
Bump camino to 1.2.2
robertoaloi Jan 14, 2026
0d8aa89
fix: Fix path symbol search not respecting re-exports
Veykril Jan 14, 2026
1790ab0
Merge pull request #21464 from Veykril/push-myvkmuxpzkvp
Veykril Jan 14, 2026
6ecee2a
internal: Improve docs for discoverConfig
Wilfred Jan 14, 2026
77f372f
Merge pull request #21467 from robertoaloi/ra-upgrade
lnicola Jan 14, 2026
c31add0
Prepare for merging from rust-lang/rust
invalid-email-address Jan 15, 2026
52159b6
Merge ref 'b6fdaf2a1573' from rust-lang/rust
invalid-email-address Jan 15, 2026
5c1acd6
Merge pull request #21471 from rust-lang/rustc-pull
lnicola Jan 15, 2026
70f4111
Merge pull request #21465 from A4-Tacks/prec-cast-before-angle
ShoyuVanilla Jan 15, 2026
d859656
fix: lookup flycheck by ID instead of vector index
lukasoyen Jan 15, 2026
3387a58
fN::BITS constants for feature float_bits_const
tyhdefu Jan 14, 2026
c6ec8ea
Merge pull request #21475 from lukasoyen/fix-flycheck-indexing
ShoyuVanilla Jan 16, 2026
4870a5f
add worker abstraction
Shourya742 Jan 1, 2026
98d4496
add termination flag to procmacroserverprocess
Shourya742 Jan 1, 2026
9fb5d34
add pool of processes
Shourya742 Jan 1, 2026
c685aa9
direct client calls via pool
Shourya742 Jan 2, 2026
82e758a
add better process picker and improve loading dylib
Shourya742 Jan 2, 2026
922bc7e
rename process to pool in ProcMacro struct
Shourya742 Jan 2, 2026
c4c336a
keep it clean and tidy
Shourya742 Jan 2, 2026
c8a3551
change callback from FnMut to Fn as we only transform messages and no…
Shourya742 Jan 3, 2026
66bca6a
propagate error from load dylibs
Shourya742 Jan 3, 2026
09c91b7
pick workers which have not exited
Shourya742 Jan 3, 2026
0936597
add version to pool
Shourya742 Jan 3, 2026
263015a
remove expand from pool
Shourya742 Jan 4, 2026
e3e7c29
remove default pool size from pool
Shourya742 Jan 5, 2026
96ecd17
add num process in config
Shourya742 Jan 5, 2026
9d5e600
add proc_macro_processes in load config
Shourya742 Jan 5, 2026
721361f
update all cli workflows
Shourya742 Jan 5, 2026
0587cbd
optimize pick_process to short circuit and return as early as possibl…
Shourya742 Jan 5, 2026
b49417e
fix test and update some autogen files
Shourya742 Jan 5, 2026
a81da31
rename from proc_macro_processes to procMacro_processes
Shourya742 Jan 5, 2026
8da5de0
rebased changes
Shourya742 Jan 11, 2026
c31698b
Improve move_guard redundanted block
A4-Tacks Jan 17, 2026
060c6f1
Merge pull request #21468 from Wilfred/improve_discover_docs
lnicola Jan 18, 2026
cbad6dd
fix: Do not show sysroot dependencies in symbol search
Veykril Jan 16, 2026
bfbee86
feat: Trigger flycheck if non-workspace files get modified
Veykril Jan 16, 2026
8f12958
Merge pull request #21483 from Veykril/push-vswqqvzqyvnv
Veykril Jan 18, 2026
7bbe902
Merge pull request #21484 from Veykril/push-uoxwkwottnqn
Veykril Jan 18, 2026
ebcbff2
Do not mix the order of builtin/regular derives in "Expand macro recu…
ChayimFriedman2 Jan 19, 2026
4dad9b9
Insert type vars and normalize for the type of a used `static`
ChayimFriedman2 Jan 19, 2026
1285b1b
Ensure correct capturing of async fn params even when they use weird …
ChayimFriedman2 Jan 19, 2026
ad7d5ea
Merge pull request #21385 from Shourya742/2026-01-01-parallelize-proc…
lnicola Jan 19, 2026
740eb6b
remove non-describing field annotation from bidirectional message def…
Shourya742 Jan 15, 2026
ffa2dad
remove serialize from Expn Globals
Shourya742 Jan 18, 2026
8fd5569
add bidirectional flow
Shourya742 Jan 18, 2026
ee35fd6
add bidirectional test
Shourya742 Jan 18, 2026
a151d7d
adapt json test
Shourya742 Jan 18, 2026
095b013
rename send and drive to request and receive and remove auto*
Shourya742 Jan 18, 2026
29aad04
Cache `Clauses::empty()`
ChayimFriedman2 Jan 19, 2026
a894e85
Merge pull request #21493 from ChayimFriedman2/perf-fixup
ChayimFriedman2 Jan 19, 2026
ab0853b
Merge pull request #21491 from ChayimFriedman2/static-insert-var
ShoyuVanilla Jan 19, 2026
dbee105
Merge pull request #21492 from ChayimFriedman2/async-fn
ShoyuVanilla Jan 20, 2026
92903fa
Merge pull request #21485 from A4-Tacks/move-guard-clean-block
ShoyuVanilla Jan 20, 2026
e07da1f
feat(hir-ty): add method references_only_ty_error to detect type errors
ileixe Jan 20, 2026
61b9b33
Fix demorgan applicable on pattern conditional
A4-Tacks Jan 20, 2026
c177a39
Merge pull request #21497 from ileixe/issue-21315
ShoyuVanilla Jan 20, 2026
8e937d4
Bump notify from 8.0.0. to 8.2.0
robertoaloi Jan 21, 2026
fd80a3e
Merge pull request #21490 from ChayimFriedman2/expand-derive-builtin
Veykril Jan 21, 2026
c8edb52
Merge pull request #21499 from A4-Tacks/not-demorgan-pattern
lnicola Jan 21, 2026
6753155
Prepare for merging from rust-lang/rust
invalid-email-address Jan 22, 2026
ee0fabd
Merge ref '004d710faff5' from rust-lang/rust
invalid-email-address Jan 22, 2026
42d9942
Merge pull request #21506 from rust-lang/rustc-pull
lnicola Jan 22, 2026
4e9e37e
internal: Add tests for rust-lang/rust#146972
Veykril Jan 23, 2026
b5bb005
Merge pull request #21509 from Veykril/push-zwownxpqxrnw
Veykril Jan 23, 2026
bd91c88
Improve extract_function name
A4-Tacks Jan 24, 2026
3f39593
fix: Fix incorrect continue for convert_range_for_to_while
A4-Tacks Jan 24, 2026
af21cbe
Merge pull request #21479 from Shourya742/2026-01-15-add-bidirectiona…
Veykril Jan 24, 2026
a443498
Merge pull request #21501 from robertoaloi/ra-bump-notify
Veykril Jan 24, 2026
cb603ad
internal: Use parser expect where possible
pksunkara Jan 25, 2026
45ef766
Merge pull request #21518 from pksunkara/pavan/jj/uwxtukzt
Veykril Jan 25, 2026
2a3614b
correct ungrammar path in patch
Shourya742 Jan 26, 2026
4fae402
Merge pull request #21523 from Shourya742/2026-01-26-correct-ungramma…
ChayimFriedman2 Jan 26, 2026
803b7cc
Merge pull request #21514 from A4-Tacks/range-for-to-while-handle-con…
ChayimFriedman2 Jan 26, 2026
9fd291e
Fix not complete 'else' before tuple
A4-Tacks Jan 19, 2026
acfb441
Merge pull request #21495 from A4-Tacks/comp-else-before-tuple
ChayimFriedman2 Jan 26, 2026
2f49df3
Improve filter predicate to length cond
A4-Tacks Jan 26, 2026
38bb09e
Fix rust-src installation command in FAQ
edwin0cheng Jan 26, 2026
d7136ca
Merge pull request #21524 from edwin0cheng/patch-1
lnicola Jan 26, 2026
b75c58d
Implement default field values `..` syntax
kouhe3 Jan 5, 2026
e0ebb92
Merge pull request #21513 from A4-Tacks/extract-fun-name
ChayimFriedman2 Jan 26, 2026
6531c75
Merge pull request #21408 from kouhe3/default_field_values
ChayimFriedman2 Jan 26, 2026
2c2602b
Fix macro matching of `meta` then `=>` or `==`
ChayimFriedman2 Jan 26, 2026
cd8fe54
Fix semicolon for toggle_macro_delimiter
A4-Tacks Jan 25, 2026
0828abf
Merge pull request #21522 from A4-Tacks/tog-macro-delim-semicolon
ChayimFriedman2 Jan 26, 2026
d02e33d
Handle `Self::EnumVariant` and `Self` on traits in doclinks
ChayimFriedman2 Jan 26, 2026
6664fc6
minor: Downgrade noisy log
Veykril Jan 27, 2026
cce824a
Merge pull request #21531 from Veykril/push-usuormvursms
Veykril Jan 27, 2026
4430fd8
Merge pull request #21527 from ChayimFriedman2/builtin-macro-name
ShoyuVanilla Jan 27, 2026
c48186e
Fix a panic where an opaque was constrained to an impossible type in …
ChayimFriedman2 Jan 27, 2026
c420ed5
fix: Do not panic if rust-analyzer fails to spawn the discover command
Veykril Jan 27, 2026
b28e6f0
Merge pull request #21534 from Veykril/push-polxrwlzrzrx
Veykril Jan 27, 2026
bf12b8b
Fix linking of proc-macro-srv-cli
lnicola Jan 27, 2026
f1d10bb
Merge pull request #21535 from lnicola/proc-macro-srv-cli-link
ChayimFriedman2 Jan 27, 2026
3491099
Prepare for merging from rust-lang/rust
lnicola Jan 27, 2026
46969c8
Merge ref '94a0cd15f597' from rust-lang/rust
lnicola Jan 27, 2026
1f72a25
Fix sysroot-abi build
lnicola Jan 27, 2026
7d2eec2
Merge pull request #21537 from lnicola/sync-from-rust
lnicola Jan 27, 2026
b801df5
Prepare for merging from rust-lang/rust
invalid-email-address Jan 29, 2026
cf03d5e
Merge ref 'ba284f468cd2' from rust-lang/rust
invalid-email-address Jan 29, 2026
3e6b275
fix: complete inferred type in static
A4-Tacks Jan 29, 2026
fbaca55
Merge pull request #21528 from ChayimFriedman2/doclink-fixes
Veykril Jan 29, 2026
c2532c1
Merge pull request #21542 from A4-Tacks/inferred-static
Veykril Jan 29, 2026
d99fbb9
Merge pull request #21533 from ChayimFriedman2/autoderef-panic
Veykril Jan 29, 2026
a365493
Merge pull request #21541 from rust-lang/rustc-pull
lnicola Jan 29, 2026
2b0ce42
remove codec and framing
Shourya742 Jan 29, 2026
06c0fde
move json and postcard as top level api's
Shourya742 Jan 29, 2026
dfb22b9
adapt proc-macro-api to remove codec abstraction
Shourya742 Jan 29, 2026
0bab96e
adapt proc-macro-srv-cli and test
Shourya742 Jan 29, 2026
be833ca
remove postcard dep from proc-macro-srv-cli
Shourya742 Jan 30, 2026
617ac8c
correct visibility of transport layer
Shourya742 Jan 30, 2026
85f2923
fix: Fix diagnostics being leaked when diagnostics panic
Veykril Jan 30, 2026
b6e4f13
Merge pull request #21555 from Veykril/push-vlrmztunpmtm
Veykril Jan 30, 2026
cc24765
Merge pull request #21460 from Veykril/push-vyqmuvkouywu
Veykril Jan 31, 2026
cc65ee5
Merge pull request #21548 from Shourya742/2026-01-29-decouple-codec-w…
Veykril Jan 31, 2026
7bb1563
fix: fix `handle_explain` to always respect `--color always`
JayanAXHF Jan 31, 2026
a3e94c8
test: add tests to ensure that `--color always` is always respected
JayanAXHF Jan 31, 2026
5c8d7db
add cancel variant to SubResponse
Shourya742 Jan 6, 2026
fb2cb46
catch unwind on client side, and accordingly send Cancel subResponse …
Shourya742 Jan 6, 2026
d2ac252
add proc-macro-client error variant
Shourya742 Jan 6, 2026
26bc8cb
make sure we panic in callback so the srv panics and stops
Shourya742 Jan 6, 2026
4892459
don't kill server on cancellation
Shourya742 Jan 6, 2026
8d2811a
remove repititive error block in callbacks
Shourya742 Jan 9, 2026
724606d
add error variant for cancelled expansion
Shourya742 Jan 9, 2026
a37aa50
adapt ByteRange to new roundtrip
Shourya742 Jan 11, 2026
50e2330
add suggested changes: have a internal error variant, comment on unw…
Shourya742 Jan 11, 2026
9838073
replace panic_any with resume_unwind on Client panic cancelled message
Shourya742 Jan 18, 2026
fcb5572
correct handler generic input
Shourya742 Feb 1, 2026
f429252
Merge pull request #21410 from Shourya742/2026-01-06-improve-bidirect…
Veykril Feb 1, 2026
16b79b3
fix: Fix upvar analysis of nested closures
Veykril Feb 1, 2026
9aebf04
Merge pull request #21564 from Veykril/push-kvlytkymtvks
Veykril Feb 1, 2026
8fa27e0
Also exclude proc-macro-srv-cli from stage 0 tests
lnicola Feb 2, 2026
a802e7c
Remove `with_no_trimmed_paths` use in query macro
Zoxc Feb 2, 2026
f14e3ee
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefe…
Enselic Jan 15, 2026
c07f10c
Convert to inline diagnostics in `rustc_driver_impl`
JonathanBrouwer Feb 1, 2026
e9ec12a
Fix postcard test too
lnicola Jan 27, 2026
e58538c
Rename `collect_active_jobs` to several distinct names
Zalathar Feb 1, 2026
c4a254f
Rollup merge of #152008 - lnicola:sync-from-ra, r=lnicola
Zalathar Feb 3, 2026
37ece9c
Rollup merge of #151109 - tyhdefu:float_bits_const, r=tgross35
Zalathar Feb 3, 2026
f69082d
Rollup merge of #151976 - Zalathar:collect-active-jobs, r=nnethercote
Zalathar Feb 3, 2026
6d064d9
Rollup merge of #151691 - Enselic:dylib-only-for-prefer-dynamic-v2, r…
Zalathar Feb 3, 2026
63303aa
Rollup merge of #151919 - JayanAXHF:fix_color_always, r=nnethercote
Zalathar Feb 3, 2026
04ebb63
Rollup merge of #152017 - Zoxc:query-rem-with_no_trimmed_paths, r=lqd
Zalathar Feb 3, 2026
b0552e6
Rollup merge of #152028 - JonathanBrouwer:diag_driver_impl, r=jdonsze…
Zalathar Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
flycheck: Use RunnableKind::Flycheck from ProjectJson to flycheck
This adds a substitution helper to get the right behaviour re {label} and $saved_file.
  • Loading branch information
cormacrelf committed Jan 7, 2026
commit 2a899bb119bd9e33eadce3b7179cb1b8bc49fd78
226 changes: 222 additions & 4 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use ide_db::FxHashSet;
use itertools::Itertools;
use paths::{AbsPath, AbsPathBuf, Utf8Path, Utf8PathBuf};
use project_model::TargetDirectoryConfig;
use project_model::project_json;
use rustc_hash::FxHashMap;
use serde::Deserialize as _;
use serde_derive::Deserialize;
Expand Down Expand Up @@ -89,6 +90,24 @@ impl CargoOptions {
}
}

/// The flycheck config from a rust-project.json file or discoverConfig JSON output.
#[derive(Debug, Default)]
pub(crate) struct FlycheckConfigJson {
/// The template with [project_json::RunnableKind::Flycheck]
pub single_template: Option<project_json::Runnable>,
}

impl FlycheckConfigJson {
pub(crate) fn any_configured(&self) -> bool {
// self.workspace_template.is_some() ||
self.single_template.is_some()
}
}

/// The flycheck config from rust-analyzer's own configuration.
///
/// We rely on this when rust-project.json does not specify a flycheck runnable
///
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) enum FlycheckConfig {
CargoCommand {
Expand Down Expand Up @@ -128,7 +147,7 @@ impl fmt::Display for FlycheckConfig {
// in the IDE (e.g. in the VS Code status bar).
let display_args = args
.iter()
.map(|arg| if arg == SAVED_FILE_PLACEHOLDER { "..." } else { arg })
.map(|arg| if arg == SAVED_FILE_PLACEHOLDER_DOLLAR { "..." } else { arg })
.collect::<Vec<_>>();

write!(f, "{command} {}", display_args.join(" "))
Expand Down Expand Up @@ -156,6 +175,7 @@ impl FlycheckHandle {
generation: Arc<AtomicUsize>,
sender: Sender<FlycheckMessage>,
config: FlycheckConfig,
config_json: FlycheckConfigJson,
sysroot_root: Option<AbsPathBuf>,
workspace_root: AbsPathBuf,
manifest_path: Option<AbsPathBuf>,
Expand All @@ -166,6 +186,7 @@ impl FlycheckHandle {
generation.load(Ordering::Relaxed),
sender,
config,
config_json,
sysroot_root,
workspace_root,
manifest_path,
Expand Down Expand Up @@ -341,6 +362,8 @@ struct FlycheckActor {
generation: DiagnosticsGeneration,
sender: Sender<FlycheckMessage>,
config: FlycheckConfig,
config_json: FlycheckConfigJson,

manifest_path: Option<AbsPathBuf>,
ws_target_dir: Option<Utf8PathBuf>,
/// Either the workspace root of the workspace we are flychecking,
Expand Down Expand Up @@ -373,14 +396,74 @@ enum Event {
CheckEvent(Option<CargoCheckMessage>),
}

pub(crate) const SAVED_FILE_PLACEHOLDER: &str = "$saved_file";
/// This is stable behaviour. Don't change.
const SAVED_FILE_PLACEHOLDER_DOLLAR: &str = "$saved_file";
const LABEL_INLINE: &str = "{label}";
const SAVED_FILE_INLINE: &str = "{saved_file}";

struct Substitutions<'a> {
label: Option<&'a str>,
saved_file: Option<&'a str>,
}

impl<'a> Substitutions<'a> {
/// If you have a runnable, and it has {label} in it somewhere, treat it as a template that
/// may be unsatisfied if you do not provide a label to substitute into it. Returns None in
/// that situation. Otherwise performs the requested substitutions.
///
/// Same for {saved_file}.
///
#[allow(clippy::disallowed_types)] /* generic parameter allows for FxHashMap */
fn substitute<H>(
self,
template: &project_json::Runnable,
extra_env: &std::collections::HashMap<String, Option<String>, H>,
) -> Option<Command> {
let mut cmd = toolchain::command(&template.program, &template.cwd, extra_env);
for arg in &template.args {
if let Some(ix) = arg.find(LABEL_INLINE) {
if let Some(label) = self.label {
let mut arg = arg.to_string();
arg.replace_range(ix..ix + LABEL_INLINE.len(), label);
cmd.arg(arg);
continue;
} else {
return None;
}
}
if let Some(ix) = arg.find(SAVED_FILE_INLINE) {
if let Some(saved_file) = self.saved_file {
let mut arg = arg.to_string();
arg.replace_range(ix..ix + SAVED_FILE_INLINE.len(), saved_file);
cmd.arg(arg);
continue;
} else {
return None;
}
}
// Legacy syntax: full argument match
if arg == SAVED_FILE_PLACEHOLDER_DOLLAR {
if let Some(saved_file) = self.saved_file {
cmd.arg(saved_file);
continue;
} else {
return None;
}
}
cmd.arg(arg);
}
cmd.current_dir(&template.cwd);
Some(cmd)
}
}

impl FlycheckActor {
fn new(
id: usize,
generation: DiagnosticsGeneration,
sender: Sender<FlycheckMessage>,
config: FlycheckConfig,
config_json: FlycheckConfigJson,
sysroot_root: Option<AbsPathBuf>,
workspace_root: AbsPathBuf,
manifest_path: Option<AbsPathBuf>,
Expand All @@ -392,6 +475,7 @@ impl FlycheckActor {
generation,
sender,
config,
config_json,
sysroot_root,
root: Arc::new(workspace_root),
scope: FlycheckScope::Workspace,
Expand Down Expand Up @@ -672,6 +756,29 @@ impl FlycheckActor {
self.diagnostics_received = DiagnosticsReceived::No;
}

fn explicit_check_command(
&self,
scope: &FlycheckScope,
saved_file: Option<&AbsPath>,
) -> Option<Command> {
let label = match scope {
// We could add a runnable like "RunnableKind::FlycheckWorkspace". But generally
// if you're not running cargo, it's because your workspace is too big to check
// all at once. You can always use `check_overrideCommand` with no {label}.
FlycheckScope::Workspace => return None,
FlycheckScope::Package { package: PackageSpecifier::BuildInfo { label }, .. } => {
label.as_str()
}
FlycheckScope::Package {
package: PackageSpecifier::Cargo { package_id: label },
..
} => &label.repr,
};
let template = self.config_json.single_template.as_ref()?;
let subs = Substitutions { label: Some(label), saved_file: saved_file.map(|x| x.as_str()) };
subs.substitute(template, &FxHashMap::default())
}

/// Construct a `Command` object for checking the user's code. If the user
/// has specified a custom command with placeholders that we cannot fill,
/// return None.
Expand All @@ -683,6 +790,20 @@ impl FlycheckActor {
) -> Option<Command> {
match &self.config {
FlycheckConfig::CargoCommand { command, options, ansi_color_output } => {
// Only use the rust-project.json's flycheck config when no check_overrideCommand
// is configured. In the FlycheckConcig::CustomCommand branch we will still do
// label substitution, but on the overrideCommand instead.
//
// There needs to be SOME way to override what your discoverConfig tool says,
// because to change the flycheck runnable there you may have to literally
// recompile the tool.
if self.config_json.any_configured() {
// Completely handle according to rust-project.json.
// We don't consider this to be "using cargo" so we will not apply any of the
// CargoOptions to the command.
return self.explicit_check_command(scope, saved_file);
}

let mut cmd =
toolchain::command(Tool::Cargo.path(), &*self.root, &options.extra_env);
if let Some(sysroot_root) = &self.sysroot_root
Expand Down Expand Up @@ -757,15 +878,15 @@ impl FlycheckActor {
// we're saving a file, replace the placeholder in the arguments.
if let Some(saved_file) = saved_file {
for arg in args {
if arg == SAVED_FILE_PLACEHOLDER {
if arg == SAVED_FILE_PLACEHOLDER_DOLLAR {
cmd.arg(saved_file);
} else {
cmd.arg(arg);
}
}
} else {
for arg in args {
if arg == SAVED_FILE_PLACEHOLDER {
if arg == SAVED_FILE_PLACEHOLDER_DOLLAR {
// The custom command has a $saved_file placeholder,
// but we had an IDE event that wasn't a file save. Do nothing.
return None;
Expand Down Expand Up @@ -837,3 +958,100 @@ enum JsonMessage {
Cargo(cargo_metadata::Message),
Rustc(Diagnostic),
}

#[cfg(test)]
mod tests {
use ide_db::FxHashMap;
use itertools::Itertools;
use paths::Utf8Path;
use project_model::project_json;

use crate::flycheck::Substitutions;

#[test]
fn test_substitutions() {
let label = ":label";
let saved_file = "file.rs";

// Runnable says it needs both; you need both.
assert_eq!(test_substitute(None, None, "{label} {saved_file}").as_deref(), None);
assert_eq!(test_substitute(Some(label), None, "{label} {saved_file}").as_deref(), None);
assert_eq!(
test_substitute(None, Some(saved_file), "{label} {saved_file}").as_deref(),
None
);
assert_eq!(
test_substitute(Some(label), Some(saved_file), "{label} {saved_file}").as_deref(),
Some("build :label file.rs")
);

// Only need label? only need label.
assert_eq!(test_substitute(None, None, "{label}").as_deref(), None);
assert_eq!(test_substitute(Some(label), None, "{label}").as_deref(), Some("build :label"),);
assert_eq!(test_substitute(None, Some(saved_file), "{label}").as_deref(), None,);
assert_eq!(
test_substitute(Some(label), Some(saved_file), "{label}").as_deref(),
Some("build :label"),
);

// Only need saved_file
assert_eq!(test_substitute(None, None, "{saved_file}").as_deref(), None);
assert_eq!(test_substitute(Some(label), None, "{saved_file}").as_deref(), None);
assert_eq!(
test_substitute(None, Some(saved_file), "{saved_file}").as_deref(),
Some("build file.rs")
);
assert_eq!(
test_substitute(Some(label), Some(saved_file), "{saved_file}").as_deref(),
Some("build file.rs")
);

// Need neither
assert_eq!(test_substitute(None, None, "xxx").as_deref(), Some("build xxx"));
assert_eq!(test_substitute(Some(label), None, "xxx").as_deref(), Some("build xxx"));
assert_eq!(test_substitute(None, Some(saved_file), "xxx").as_deref(), Some("build xxx"));
assert_eq!(
test_substitute(Some(label), Some(saved_file), "xxx").as_deref(),
Some("build xxx")
);

// {label} mid-argument substitution
assert_eq!(
test_substitute(Some(label), None, "--label={label}").as_deref(),
Some("build --label=:label")
);

// {saved_file} mid-argument substitution
assert_eq!(
test_substitute(None, Some(saved_file), "--saved={saved_file}").as_deref(),
Some("build --saved=file.rs")
);

// $saved_file legacy support (no mid-argument substitution, we never supported that)
assert_eq!(
test_substitute(None, Some(saved_file), "$saved_file").as_deref(),
Some("build file.rs")
);

fn test_substitute(
label: Option<&str>,
saved_file: Option<&str>,
args: &str,
) -> Option<String> {
Substitutions { label, saved_file }
.substitute(
&project_json::Runnable {
program: "build".to_owned(),
args: Vec::from_iter(args.split_whitespace().map(ToOwned::to_owned)),
cwd: Utf8Path::new("/path").to_owned(),
kind: project_json::RunnableKind::Flycheck,
},
&FxHashMap::default(),
)
.map(|command| {
command.get_args().map(|x| x.to_string_lossy()).collect_vec().join(" ")
})
.map(|args| format!("build {}", args))
}
}
}
19 changes: 16 additions & 3 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use load_cargo::{ProjectFolders, load_proc_macro};
use lsp_types::FileSystemWatcher;
use paths::Utf8Path;
use proc_macro_api::ProcMacroClient;
use project_model::{ManifestPath, ProjectWorkspace, ProjectWorkspaceKind, WorkspaceBuildScripts};
use project_model::{
ManifestPath, ProjectWorkspace, ProjectWorkspaceKind, WorkspaceBuildScripts, project_json,
};
use stdx::{format_to, thread::ThreadIntent};
use triomphe::Arc;
use vfs::{AbsPath, AbsPathBuf, ChangeKind};
Expand Down Expand Up @@ -875,6 +877,7 @@ impl GlobalState {
generation.clone(),
sender.clone(),
config,
crate::flycheck::FlycheckConfigJson::default(),
None,
self.config.root_path().clone(),
None,
Expand All @@ -894,16 +897,25 @@ impl GlobalState {
cargo: Some((cargo, _, _)),
..
} => (
crate::flycheck::FlycheckConfigJson::default(),
cargo.workspace_root(),
Some(cargo.manifest_path()),
Some(cargo.target_directory()),
),
ProjectWorkspaceKind::Json(project) => {
let config_json = crate::flycheck::FlycheckConfigJson {
single_template: project
.runnable_template(project_json::RunnableKind::Flycheck)
.cloned(),
};
// Enable flychecks for json projects if a custom flycheck command was supplied
// in the workspace configuration.
match config {
_ if config_json.any_configured() => {
(config_json, project.path(), None, None)
}
FlycheckConfig::CustomCommand { .. } => {
(project.path(), None, None)
(config_json, project.path(), None, None)
}
_ => return None,
}
Expand All @@ -913,12 +925,13 @@ impl GlobalState {
ws.sysroot.root().map(ToOwned::to_owned),
))
})
.map(|(id, (root, manifest_path, target_dir), sysroot_root)| {
.map(|(id, (config_json, root, manifest_path, target_dir), sysroot_root)| {
FlycheckHandle::spawn(
id,
generation.clone(),
sender.clone(),
config.clone(),
config_json,
sysroot_root,
root.to_path_buf(),
manifest_path.map(|it| it.to_path_buf()),
Expand Down