Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
1fe56fa
Provide access to `RootDatabase`'s `LineIndex` for the proc macro pro…
ChayimFriedman2 Apr 27, 2026
6fe0073
Add some Result methods to minicore
A4-Tacks May 10, 2026
35be753
fix: add param on result methods for replace_method_eager_lazy
A4-Tacks May 10, 2026
02e8f23
Merge pull request #22338 from lnicola/sync-from-rust
lnicola May 11, 2026
f16851b
Less conjuration magic
Veykril Apr 21, 2026
660f8a0
Merge pull request #22119 from Veykril/veykril/push-nkqzszrqyumu
Veykril May 11, 2026
e3f5ff4
Make interneds return their loc by ref
ChayimFriedman2 May 10, 2026
59eeffe
Encode the name instead of index in `EnumVariantId`
ChayimFriedman2 May 10, 2026
11a2443
Remove `Option` from enum variants diagnostics
ChayimFriedman2 May 10, 2026
c0a4eb3
Provide better incrementality for modules
ChayimFriedman2 May 8, 2026
140fd7c
Implement `pattern_type` macro
Veykril Apr 13, 2026
ea35b15
fix: handle usages in macro for extract_function
A4-Tacks May 12, 2026
a3443c6
feat: add diagnostic for E0029
WaterWhisperer May 12, 2026
1bae2d4
Replace cfg-if with std::cfg_select
lnicola May 12, 2026
cb666fc
Merge pull request #22349 from lnicola/cfg-select
lnicola May 12, 2026
5e17c49
Merge pull request #22347 from WaterWhisperer/diagnostic-range-pat-e0029
ChayimFriedman2 May 12, 2026
3a03280
Merge pull request #22329 from ChayimFriedman2/intern-ref
Veykril May 13, 2026
465c577
Fix assit `qualify_path` error when number of path segments greater t…
WeiTheShinobi May 13, 2026
7ef1b16
feat: add diagnostic for E0638
WaterWhisperer May 13, 2026
06fe1cd
Merge pull request #22355 from WaterWhisperer/diagnostic-non-exhausti…
ChayimFriedman2 May 13, 2026
0374c68
fix: duplicated words in stdx/assert.rs and ide/inject.rs doc-comments
quyentonndbs May 14, 2026
dd65cb4
Merge pull request #22356 from quyentonndbs/fix/duplicated-words-in-s…
lnicola May 14, 2026
a16343f
fix: show Run lens for fn main in bench targets
MavenRain May 14, 2026
f908c16
Show `const` in the signature help if applicable
SomeoneToIgnore May 14, 2026
fc18d32
Merge pull request #22191 from ChayimFriedman2/line-column
Veykril May 14, 2026
491aa8d
Merge pull request #22357 from MavenRain/fix-bench-run-lens
ChayimFriedman2 May 14, 2026
3f8b72e
Merge pull request #22358 from SomeoneToIgnore/const-signature
ChayimFriedman2 May 14, 2026
bcfee19
Merge pull request #22354 from WeiTheShinobi/qualify_path_lose_path_seg
A4-Tacks May 14, 2026
d252be7
Merge pull request #22344 from A4-Tacks/extract-fn-ref-in-macro
ChayimFriedman2 May 15, 2026
b775d2b
minor: no add newline when `.lete` not in tail_expr
A4-Tacks May 12, 2026
8e6a614
Remove unused FixupError
mu001999 May 15, 2026
68ef6ed
fix: no lint unsized adt self_ty missing bounded assoc
A4-Tacks May 14, 2026
a02bb2e
Merge pull request #22365 from mu001999-contrib/cleanup/dead-code
ChayimFriedman2 May 15, 2026
573f492
Merge pull request #22345 from A4-Tacks/lete-no-newline
A4-Tacks May 15, 2026
862da81
Migrate replace_method_eager_lazy to SyntaxEditor
A4-Tacks May 15, 2026
06cb941
Added param uses placeholder
A4-Tacks May 15, 2026
c03ef40
Merge pull request #22335 from A4-Tacks/lazy-method-param
ChayimFriedman2 May 15, 2026
97d3cc5
Merge pull request #22363 from A4-Tacks/adt-unsized-ty-missing
ChayimFriedman2 May 15, 2026
6982ceb
Merge pull request #22082 from Veykril/push-plvylxqznwky
ChayimFriedman2 May 15, 2026
7395257
Lower OR pattern types
ChayimFriedman2 May 15, 2026
94b5aa9
fix: only ref match non-unknown value items
A4-Tacks May 15, 2026
221bb54
Lower half-open, open and exclusive ranges in pattern types correctly
ChayimFriedman2 May 15, 2026
e54bd48
Compute layout for pattern types
ChayimFriedman2 May 15, 2026
e240d8e
fix: no use sad pattern on happy arm with guard
A4-Tacks May 15, 2026
df37dde
method-resolution: emit error for method calls with illegal Sized b…
MavenRain May 15, 2026
11d0de3
Merge pull request #22372 from MavenRain/fix-illegal-sized-bound
ChayimFriedman2 May 15, 2026
cb0bb00
Migrate inline_call assist to SyntaxFactory
lukasmatta May 15, 2026
1b81d40
fix: not complete same name inherent deref methods
A4-Tacks May 16, 2026
3819dbf
feat: add diagnostic for E0614
WaterWhisperer May 16, 2026
dea77b5
Merge pull request #22380 from WaterWhisperer/diag-E0614
ChayimFriedman2 May 16, 2026
1f32a7a
Merge pull request #22368 from ChayimFriedman2/pat-ty
ChayimFriedman2 May 16, 2026
459d1ed
Revert "decide not to resolve a FIXME"
ada4a May 16, 2026
c53984d
feat(ide-diagnostics): add handler for functional record update in de…
ada4a Apr 28, 2026
9ffe496
Merge pull request #22352 from lukasmatta/migrate-inline-call-syntax-…
ChayimFriedman2 May 16, 2026
cae8643
Merge pull request #22379 from ada4a/diag-fru-in-destructuring-assign…
lnicola May 16, 2026
61d77ca
Show `unsafe` in the signature help if applicable
SomeoneToIgnore May 16, 2026
3a44312
Merge pull request #22381 from SomeoneToIgnore/unsafe-signature
ChayimFriedman2 May 16, 2026
cf94374
misc improvements
ada4a Apr 30, 2026
0db8553
internal: update generated lints
workflows-rust-analyzer[bot] May 17, 2026
cc9e6e7
Have a specific error for unimplemented builtin macros
ChayimFriedman2 May 17, 2026
41b1abe
Handle TyKind::{Pat,UnsafeBinder} in has_drop_glue
DaniPopes May 17, 2026
3a6792b
Merge pull request #22384 from DaniPopes/never-drop-glue
ChayimFriedman2 May 17, 2026
4e1b8c9
Do not mark enum variants as assoc items in symbol table
ChayimFriedman2 May 17, 2026
d1568f0
Include enum variants in the import map
ChayimFriedman2 May 17, 2026
aebaad5
fix: no complete module colons before exists colons
A4-Tacks May 17, 2026
d1b5f66
Fix deref iterate order and multiple private in derefs
A4-Tacks May 17, 2026
0c8234e
Merge pull request #22386 from A4-Tacks/no-colon-before-colon
ChayimFriedman2 May 17, 2026
504ee8b
Merge pull request #22376 from A4-Tacks/method-hide-same-name
ChayimFriedman2 May 17, 2026
edf0804
Merge pull request #22382 from rust-lang/ci/gen-lints
lnicola May 17, 2026
102b1a8
Prepare for merging from rust-lang/rust
lnicola May 17, 2026
7574278
Merge ref 'ba0949ab7459' from rust-lang/rust
lnicola May 17, 2026
b5d2a9e
Merge pull request #22389 from lnicola/sync-from-rust
lnicola May 17, 2026
4053e24
Ignore workspace/diagnostic/refresh in slow tests
lnicola May 17, 2026
74a6981
Merge pull request #22391 from lnicola/ignore-diagnostics-refresh
ChayimFriedman2 May 17, 2026
2ce2758
Merge pull request #22367 from A4-Tacks/ref-match-only-value
ChayimFriedman2 May 17, 2026
71565e6
feat(diagnostics): add handler for E0040
ada4a Apr 30, 2026
bbf6de7
Merge pull request #22378 from ada4a/e0040
ChayimFriedman2 May 17, 2026
b2c2e6f
Support named consts in range pattern types
ChayimFriedman2 May 17, 2026
42e5f53
Do not consider the path of the macro in a macro call to be inside a …
ChayimFriedman2 May 18, 2026
f5dc299
fix: complete ref_match in macro
A4-Tacks May 17, 2026
23bd200
Merge pull request #22399 from A4-Tacks/ref-match-in-macro-call
ChayimFriedman2 May 18, 2026
a1e3a46
feat: add diagnostic for E0608
WaterWhisperer May 19, 2026
ce96d6e
fix: remove lang-item guard and update test
WaterWhisperer May 19, 2026
abcce8e
Merge pull request #22404 from WaterWhisperer/diag-E0608
ChayimFriedman2 May 19, 2026
0d1fe7e
resolve merge conflicts
hallmason17 May 19, 2026
766bc0d
remove unneeded test feature
hallmason17 May 19, 2026
4a11664
clearer diagnostic message, fix formatting
hallmason17 May 19, 2026
01392a2
Merge pull request #22406 from hallmason17/feature/mut_ref_binding
ChayimFriedman2 May 19, 2026
e5db923
Merge pull request #22397 from ChayimFriedman2/mac-call-path
A4-Tacks May 19, 2026
6d31099
Merge pull request #22322 from ChayimFriedman2/module-inc
Veykril May 20, 2026
8cebbb6
fix: do not complete semicolon in match-expr place
A4-Tacks May 20, 2026
8ec5e94
Merge pull request #22385 from ChayimFriedman2/import-variant
Veykril May 20, 2026
f61dcdd
Do not autoref in method probe in path mode
ChayimFriedman2 May 17, 2026
bf434ef
Merge pull request #22392 from ChayimFriedman2/path-probe-autoref
ChayimFriedman2 May 20, 2026
ed8a73b
Merge pull request #22369 from A4-Tacks/iflet-with-match-happy-with-g…
ChayimFriedman2 May 20, 2026
08c6f71
Merge pull request #22408 from A4-Tacks/no-semi-match-expr
ChayimFriedman2 May 20, 2026
ee7196d
allow wildcard params in foreign fn declarations
youngspe May 21, 2026
c70dad7
feat: completions imports exclude supports sub items
A4-Tacks May 20, 2026
db47597
inline collect_pat_top
youngspe May 21, 2026
2800da7
Add format! call to print repo in error
itsjunetime May 21, 2026
ded1572
fix: use grouped annotation for add_label_to_loop
A4-Tacks May 22, 2026
e1c240a
Merge pull request #22418 from itsjunetime/add_fmt_to_err_context
A4-Tacks May 22, 2026
1bdb0ec
Merge pull request #22383 from ChayimFriedman2/unimplemented-builtin
Veykril May 22, 2026
d858f8e
Merge pull request #22396 from ChayimFriedman2/pat-ty-const
Veykril May 22, 2026
d1a1ffd
Emit diagnostic for rest array patterns without fixed-length arrays
Abusalah0 May 22, 2026
c309395
Remove redundant rename
A4-Tacks May 23, 2026
57aa060
fix: normalize expected tuple struct pat field
A4-Tacks May 23, 2026
bb63b77
fix(cfg): correct separator index in CfgDiff disable loop
shulaoda May 23, 2026
e61601c
fix(test-utils): drain inactive_regions by inactive_line_region
shulaoda May 23, 2026
13e4b71
Merge pull request #22425 from A4-Tacks/expected-tuple-normalize-ty
flodiebold May 23, 2026
0bcb7c0
Merge pull request #22424 from Abusalah0/diag-array-pattern-without-f…
lnicola May 23, 2026
a64445a
Merge pull request #22419 from A4-Tacks/add-loop-label-group
lnicola May 23, 2026
e8ae147
Actually ignore workspace/diagnostic/refresh
lnicola May 23, 2026
5f79040
fix(hir-ty): saturate float-to-uint cast in const eval
shulaoda May 23, 2026
60401bc
Merge pull request #22430 from shulaoda/05-23-fix_hir-ty_saturate_flo…
lnicola May 23, 2026
b9dae9f
Filter package-scoped features
mkeeter May 23, 2026
50cee51
Merge pull request #22428 from lnicola/slow-tests-diagnostics-take-2
ChayimFriedman2 May 23, 2026
7ab5409
Merge pull request #22415 from youngspe/extern-wildcard-param
ChayimFriedman2 May 23, 2026
7205364
Make `trait_environment()` take `GenericDefId` and not `ExpressionSto…
ChayimFriedman2 May 1, 2026
1775ddc
Refactor handling of generic params in `hir::Type`
ChayimFriedman2 May 3, 2026
f91506d
Merge pull request #22252 from ChayimFriedman2/hir-types
ChayimFriedman2 May 23, 2026
d0af86a
Merge pull request #22432 from mkeeter/package-feature-scope
ChayimFriedman2 May 23, 2026
d607c56
internal: update generated lints
workflows-rust-analyzer[bot] May 24, 2026
0f40f8b
Revert is_exclude_flyimport condition changes
A4-Tacks May 21, 2026
403e1ff
Add nested modules doc and fix typo
A4-Tacks May 24, 2026
456a1ac
fix: no suggest ref match when expected generic ref
A4-Tacks May 20, 2026
4b55abc
Merge pull request #22436 from rust-lang/ci/gen-lints
lnicola May 24, 2026
c787753
Rename test highlight not exclude module it self
A4-Tacks May 24, 2026
3222171
fix: add import for function-like macros in extract_module assist
Albab-Hasan May 24, 2026
6fa4220
Merge pull request #22416 from A4-Tacks/exclude-module-items
ChayimFriedman2 May 24, 2026
697ea43
Cleanup bidirection proc-macro-srv protocol a bit
Veykril May 22, 2026
986b5d3
Merge pull request #22420 from Veykril/veykril/push-vpqmplstnrxx
Veykril May 24, 2026
8719de9
fix: Fix `SyntaxContext::root`s technically overlapping valid interneds
Veykril Feb 2, 2026
67b6172
Merge pull request #21566 from Veykril/push-rvmyysvknmyk
Veykril May 25, 2026
84ad9dc
Merge pull request #22437 from Albab-Hasan/extract-module-macro-import
Veykril May 25, 2026
a8f0bc6
Merge pull request #22426 from shulaoda/05-23-fix_cfg_correct_separat…
Veykril May 25, 2026
e96c4ce
Merge pull request #22427 from shulaoda/05-23-fix_test-utils_drain_in…
Veykril May 25, 2026
2267c11
fix: Fix extract variable in token tree replace range
A4-Tacks May 25, 2026
10821c2
fix: analysis expected ty in enum variant
A4-Tacks May 25, 2026
2e1fd86
fix: flip coerce_never type_mismatch tys
A4-Tacks May 25, 2026
7e47226
Merge pull request #22451 from A4-Tacks/type-mismatch-flip
ChayimFriedman2 May 25, 2026
91dab6c
Merge pull request #22409 from A4-Tacks/no-suggest-ref-generic-ref
ChayimFriedman2 May 25, 2026
d4a3643
minor: no suggest ref match for unit type
A4-Tacks May 25, 2026
aba3211
Merge pull request #22453 from A4-Tacks/no-ref-match-unit
ChayimFriedman2 May 25, 2026
a2a3be2
Add a fixme comment
A4-Tacks May 25, 2026
23ef545
Merge pull request #22449 from A4-Tacks/expect-enum-struct-pat-ty
A4-Tacks May 25, 2026
4f1c8b3
fix: Add type_match score for struct_pat
A4-Tacks May 25, 2026
6d337b9
Merge pull request #22452 from A4-Tacks/pattern-score
ChayimFriedman2 May 25, 2026
b5d6c33
feat: add diagnostic for E0033
WaterWhisperer May 20, 2026
88364c4
Merge pull request #22411 from WaterWhisperer/diag-E0033
ChayimFriedman2 May 26, 2026
cf8235c
misc improvements
ada4a Apr 30, 2026
eb46510
fix(assists/add_reference_here): _modify_ the reference type when dea…
ada4a Apr 9, 2026
268293b
switch to text-based edit
ada4a May 11, 2026
68af99a
Merge pull request #22342 from ada4a/13047-ref-t-to-refmut-t
Veykril May 26, 2026
1f0c9a0
internal: Improve syntax mapping in for loop desugaring
Veykril May 27, 2026
482a1b4
Merge pull request #22465 from Veykril/push-loxpxnnrkruk
Veykril May 27, 2026
a4bff5f
fix: no complete functional update in non last
A4-Tacks May 28, 2026
2e41d53
use editor make in derive_macro
Shourya742 May 28, 2026
fa6c05d
use editor make in edits
Shourya742 May 28, 2026
de0e7b3
Merge pull request #22477 from Shourya742/2026-05-28-remove-make-cons…
ChayimFriedman2 May 28, 2026
cec1e06
Fix Clippy 1.96.0
ChayimFriedman2 May 28, 2026
5037fbc
Merge pull request #22480 from ChayimFriedman2/fix-clippy
ChayimFriedman2 May 28, 2026
e0cf072
Port block and loop inference from rustc
ChayimFriedman2 May 7, 2026
fa6ab77
Improve detection of diverging expressions
ChayimFriedman2 May 27, 2026
fbdd7e2
Merge pull request #22473 from ChayimFriedman2/labelled-break
ChayimFriedman2 May 28, 2026
a775005
Merge pull request #22476 from A4-Tacks/no-func-update-before-field
ChayimFriedman2 May 29, 2026
95c5de0
Add lifetime_param to syntaxFactory
Shourya742 May 29, 2026
d7dc411
remove make constructor from rename
Shourya742 May 29, 2026
e452c62
remove make from prettify_macro_expansion and add factory to dollar_c…
Shourya742 May 29, 2026
64c4a41
Merge pull request #22484 from Shourya742/2026-05-29-remove-make-from…
ChayimFriedman2 May 29, 2026
370fd86
Merge pull request #22447 from A4-Tacks/extract-var-in-macro-rep-ins
ChayimFriedman2 May 29, 2026
e0c85c2
Intern MIR projections using the new ty interning infrastructure
flodiebold Dec 2, 2025
75ab156
Merge pull request #22474 from flodiebold/intern-mir-projections
flodiebold May 29, 2026
5c9c7c3
internal: Make `MemDocs` cheap to clone for snapshotting
Veykril May 30, 2026
add64c4
Better release builds with more debug info
Veykril May 30, 2026
844964a
Merge pull request #22493 from Veykril/push-spvolvvvusxu
Veykril May 30, 2026
50901dd
Merge pull request #22492 from Veykril/push-onsxmumorqlz
Veykril May 30, 2026
76cee22
minor: Fix garbage collection running too frequently
Veykril May 30, 2026
e76b8cf
Merge pull request #22494 from Veykril/push-ozktuvyllzpx
Veykril May 30, 2026
9b544b7
Also consider library features internal
ChayimFriedman2 May 30, 2026
b0e633f
Merge pull request #22498 from ChayimFriedman2/libs-internal-feat
ChayimFriedman2 May 30, 2026
2c2d90a
internal: update generated lints
workflows-rust-analyzer[bot] May 31, 2026
60676c8
Merge pull request #22499 from rust-lang/ci/gen-lints
lnicola May 31, 2026
00ecc6e
Always use crates from sysroot in proc-macro-srv
bjorn3 May 31, 2026
5a22cb9
Remove outdated comment
bjorn3 May 31, 2026
7419223
Merge pull request #22500 from bjorn3/proc-macro-srv_sysroot_crates
Veykril May 31, 2026
abc0c86
Fix proc-macro-srv CI job depending on salsa
Veykril May 31, 2026
9926218
Merge pull request #22501 from Veykril/veykril/push-mzzzxorknrxr
Veykril May 31, 2026
55e1f1e
Revert "Merge pull request rust-lang/rust-analyzer#22492 from Veykril…
lnicola May 31, 2026
897c3d1
Merge pull request #22502 from lnicola/less-debug
ChayimFriedman2 May 31, 2026
e182874
Try to improve completion ranking
ChayimFriedman2 May 31, 2026
c4ab4a5
fix: use add deref in assign instead add `&mut` for value
A4-Tacks May 26, 2026
f2baaff
Add missing early return
A4-Tacks May 27, 2026
5ffa3d4
Remove redundant filter
A4-Tacks May 31, 2026
e04ef6b
Enable salsa feature for syntax-bridge
Veykril Jun 1, 2026
1582b39
Merge pull request #22504 from Veykril/veykril/push-yuuqyxytkkno
Veykril Jun 1, 2026
c274353
Merge pull request #22503 from ChayimFriedman2/lower-variant
Veykril Jun 1, 2026
2035cde
Kill proc-macro-srv processes on shutdown
Veykril Jun 1, 2026
0c8788b
Merge pull request #22506 from Veykril/push-snorzkqtonqz
Veykril Jun 1, 2026
08b5b88
Merge pull request #22457 from A4-Tacks/add-deref-assign
A4-Tacks Jun 1, 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
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Rust toolchain
run: |
RUSTC_VERSION=$(cat rust-version)
rustup-toolchain-install-master ${RUSTC_VERSION} -c cargo -c rust-src -c rustfmt
rustup-toolchain-install-master ${RUSTC_VERSION} -c cargo -c rust-src -c rustfmt -c rustc-dev -c llvm-tools
rustup default ${RUSTC_VERSION}

# Emulate a nightly toolchain, because the toolchain installed above does not have "nightly"
Expand All @@ -72,7 +72,7 @@ jobs:
run: cargo test --features sysroot-abi -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet

- name: Check salsa dependency
run: "! (cargo tree -p proc-macro-srv-cli | grep -q salsa)"
run: "! (cargo tree -p proc-macro-srv-cli -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -i salsa)"

rust:
if: github.repository == 'rust-lang/rust-analyzer'
Expand Down
2 changes: 0 additions & 2 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,6 @@ dependencies = [
"object",
"paths",
"proc-macro-test",
"ra-ap-rustc_lexer",
"span",
"temp-dir",
]
Expand Down Expand Up @@ -1939,7 +1938,6 @@ dependencies = [
name = "profile"
version = "0.0.0"
dependencies = [
"cfg-if",
"libc",
"perf-event",
"tikv-jemalloc-ctl",
Expand Down
4 changes: 4 additions & 0 deletions src/tools/rust-analyzer/crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern crate rustc_driver as _;

pub use salsa;
pub use salsa_macros;
use span::TextSize;

// FIXME: Rename this crate, base db is non descriptive
mod change;
Expand Down Expand Up @@ -49,6 +50,7 @@ macro_rules! impl_intern_key {
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
#[derive(PartialOrd, Ord)]
pub struct $id {
#[returns(ref)]
pub loc: $loc,
}

Expand Down Expand Up @@ -280,6 +282,8 @@ pub trait SourceDatabase: salsa::Database {
fn crates_map(&self) -> Arc<CratesMap>;

fn nonce_and_revision(&self) -> (Nonce, salsa::Revision);

fn line_column(&self, file: FileId, offset: TextSize) -> Result<(u32, u32), ()>;
}

static NEXT_NONCE: AtomicUsize = AtomicUsize::new(0);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/cfg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl fmt::Display for CfgDiff {
for (i, atom) in self.disable.iter().enumerate() {
let sep = match i {
0 => "",
_ if i == self.enable.len() - 1 => " and ",
_ if i == self.disable.len() - 1 => " and ",
_ => ", ",
};
f.write_str(sep)?;
Expand Down
4 changes: 4 additions & 0 deletions src/tools/rust-analyzer/crates/cfg/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ fn hints() {

check_enable_hints("#![cfg(test)]", &opts, &[]);
check_enable_hints("#![cfg(not(test))]", &opts, &["disable test"]);

opts.insert_atom(Symbol::intern("a"));
opts.insert_atom(Symbol::intern("b"));
check_enable_hints("#![cfg(all(not(a), not(b)))]", &opts, &["disable a and b"]);
}

/// Tests that we don't suggest hints for cfgs that express an inconsistent formula.
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/crates/hir-def/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use hir_expand::{
use triomphe::Arc;

use crate::{
AssocItemId, AttrDefId, Macro2Loc, MacroExpander, MacroId, MacroRulesLoc, MacroRulesLocFlags,
TraitId,
AssocItemId, AttrDefId, MacroExpander, MacroId, MacroRulesLocFlags, TraitId,
attrs::AttrFlags,
item_tree::{ItemTree, file_item_tree},
nameres::crate_def_map,
Expand Down Expand Up @@ -76,12 +75,13 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId {
MacroExpander::BuiltInAttr(it) => MacroDefKind::BuiltInAttr(in_file, it),
MacroExpander::BuiltInDerive(it) => MacroDefKind::BuiltInDerive(in_file, it),
MacroExpander::BuiltInEager(it) => MacroDefKind::BuiltInEager(in_file, it),
MacroExpander::UnimplementedBuiltIn => MacroDefKind::UnimplementedBuiltIn(in_file),
}
};

match id {
MacroId::Macro2Id(it) => {
let loc: Macro2Loc = it.lookup(db);
let loc = it.lookup(db);

MacroDefId {
krate: loc.container.krate(db),
Expand All @@ -92,7 +92,7 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId {
}
}
MacroId::MacroRulesId(it) => {
let loc: MacroRulesLoc = it.lookup(db);
let loc = it.lookup(db);

MacroDefId {
krate: loc.container.krate(db),
Expand Down
9 changes: 7 additions & 2 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ pub enum ExpressionStoreDiagnostics {
AwaitOutsideOfAsync { node: InFile<AstPtr<ast::AwaitExpr>>, location: String },
UndeclaredLabel { node: InFile<AstPtr<ast::Lifetime>>, name: Name },
PatternArgInExternFn { node: InFile<AstPtr<ast::Pat>> },
FruInDestructuringAssignment { node: InFile<AstPtr<ast::Expr>> },
}

impl ExpressionStoreBuilder {
Expand Down Expand Up @@ -616,7 +617,7 @@ impl ExpressionStore {
visitor.on_expr_opt(*end);
}
Pat::Lit(expr) | Pat::ConstBlock(expr) | Pat::Expr(expr) => visitor.on_expr(*expr),
Pat::Path(_) | Pat::Wild | Pat::Missing | Pat::Rest => {}
Pat::Path(_) | Pat::Wild | Pat::Missing | Pat::Rest | Pat::NotNull => {}
&Pat::Bind { subpat, id: _ } => visitor.on_pat_opt(subpat),
Pat::Or(args) | Pat::Tuple { args, ellipsis: _ } => visitor.on_pats(args),
Pat::TupleStruct { args, ellipsis: _, path } => {
Expand Down Expand Up @@ -719,7 +720,7 @@ impl ExpressionStore {
}
visitor.on_expr_opt(*tail);
}
Expr::Loop { body, label: _ } => visitor.on_expr(*body),
Expr::Loop { body, label: _, source: _ } => visitor.on_expr(*body),
Expr::Call { callee, args } => {
visitor.on_expr(*callee);
visitor.on_exprs(args);
Expand Down Expand Up @@ -855,6 +856,10 @@ impl ExpressionStore {
pub fn visit_type_ref_children(&self, type_ref: TypeRefId, mut visitor: impl StoreVisitor) {
match &self[type_ref] {
TypeRef::Never | TypeRef::Placeholder | TypeRef::TypeParam(_) | TypeRef::Error => {}
&TypeRef::PatternType(ty, pat) => {
visitor.on_type(ty);
visitor.on_pat(pat)
}
TypeRef::Tuple(types) => visitor.on_types(types),
TypeRef::Path(path) => visitor.on_path(path),
TypeRef::RawPtr(inner, _) | TypeRef::Slice(inner) => visitor.on_type(*inner),
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use syntax::ast;
use triomphe::Arc;

use crate::{
DefWithBodyId, HasModule,
DefWithBodyId, ExpressionStoreOwnerId, HasModule,
db::DefDatabase,
expr_store::{
ExpressionStore, ExpressionStoreSourceMap, SelfParamPtr, lower::lower_body, pretty,
Expand Down Expand Up @@ -160,12 +160,12 @@ impl Body {
pub fn pretty_print_pat(
&self,
db: &dyn DefDatabase,
owner: DefWithBodyId,
owner: ExpressionStoreOwnerId,
pat: PatId,
oneline: bool,
edition: Edition,
) -> String {
pretty::print_pat_hir(db, self, owner.into(), pat, oneline, edition)
pretty::print_pat_hir(db, self, owner, pat, oneline, edition)
}
}

Expand Down
Loading
Loading