Skip to content
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

Convert rust-analyzer to an in-tree tool #99603

Merged
merged 10,000 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
30680df
Auto merge of #12679 - a-kenji:fix-typos-hir, r=lnicola
bors Jul 2, 2022
d101439
Auto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykril
bors Jul 2, 2022
afdbd6c
fix: infer lhs first on ordinary assignment expressions
lowr Jul 2, 2022
649e1f5
fix: report type mismatch on identifier in destructuring assignments
lowr Jul 2, 2022
d1ac462
Auto merge of #12680 - lowr:fix/12428-regression, r=Veykril
bors Jul 2, 2022
0039d6f
fix: Extract Function produces duplicate fn names
DorianListens Jun 30, 2022
cc0bb71
Auto merge of #12662 - DorianListens:dscheidt/extract-function-duplic…
bors Jul 2, 2022
e394000
fix: Extract function from trait impl
DorianListens Jul 1, 2022
212f84a
Bump crossbeam-channel
lnicola Jul 2, 2022
416787d
Bump anyhow
lnicola Jul 2, 2022
c7c314d
Bump quote
lnicola Jul 2, 2022
e6fcb23
Bump either
lnicola Jul 3, 2022
2af61bc
Bump pulldown-cmark-to-cmark
lnicola Jul 3, 2022
791f2a0
Bump smallvec
lnicola Jul 3, 2022
87572be
Bump serde
lnicola Jul 3, 2022
b24ece5
Bump serde_json
lnicola Jul 3, 2022
6669f38
Bump indexmap
lnicola Jul 3, 2022
2d3f0b4
Bump semver
lnicola Jul 3, 2022
9e7ca80
Bump cargo_metadata
lnicola Jul 3, 2022
a3011e5
Bump arbitrary and derive_arbitrary
lnicola Jul 3, 2022
5381811
Bump tracing-subscriber
lnicola Jul 3, 2022
e05e6c6
Bump object
lnicola Jul 3, 2022
78beb4c
Bump chalk
lnicola Jul 3, 2022
993a19a
Bump the rest of the deps
lnicola Jul 3, 2022
75b2232
Auto merge of #12681 - lnicola:bump-deps, r=lnicola
bors Jul 3, 2022
ccf854b
Improve documentation for buildScripts.overrideCommand / checkOnSave.…
flodiebold Jul 4, 2022
5235732
Add back restartServerOnConfigChange option
flodiebold Jul 4, 2022
e1a8c0b
Auto merge of #12687 - flodiebold:override-docs, r=flodiebold
bors Jul 4, 2022
db49ac8
internal: Record all macro definitions in ItemScope
Veykril Jul 5, 2022
383ee6a
internal: Update inert attribute list
Veykril Jul 5, 2022
6edf624
Auto merge of #12690 - Veykril:inert-attrs, r=Veykril
bors Jul 5, 2022
976d07e
fix: Fix unresolved proc macro diagnostics pointing to macro expansions
Veykril Jul 5, 2022
2926ca0
Remove useless bors.toml
Rustin170506 Jul 5, 2022
0d9737a
Fix project root assert
Rustin170506 Jul 5, 2022
441e659
Complete associated type only in trait generic arg
xuhongxu96 Jul 5, 2022
fee5555
Auto merge of #12694 - hi-rustin:rustin-patch-bors, r=jonas-schievink
bors Jul 5, 2022
b9ba9fa
Add str_ref_to_string fix
Rustin170506 Jul 5, 2022
0f2eba5
Show only assoc type args in the correct arg pos
xuhongxu96 Jul 6, 2022
ad5a851
Code: use different schemes for the custom views
lnicola Jul 6, 2022
00194ad
Auto merge of #12702 - lnicola:vscode-schemes, r=lnicola
bors Jul 6, 2022
75fb3de
Handle generic args per arg index
xuhongxu96 Jul 6, 2022
0360ed5
check arg_idx >= n_params only if arg_idx >= n_required_params
xuhongxu96 Jul 6, 2022
d2fd137
Use `SmallVec` to slightly shrink `ModPath` size
Jul 6, 2022
c46570e
Auto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink
bors Jul 6, 2022
3248601
fix default type param value position
xuhongxu96 Jul 6, 2022
c296e77
Auto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink
bors Jul 6, 2022
f0af913
publish workflow: Fix names for existing crates
davidlattimore Jul 8, 2022
6f819e3
Remove unnecessary unsafe from format_args expansion
davidlattimore Jul 8, 2022
09abd76
Auto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola
bors Jul 8, 2022
6c6ae96
Update remaining GitHub URLs
Jul 8, 2022
df4ed94
Auto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink
bors Jul 8, 2022
7181a39
Auto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl,…
bors Jul 8, 2022
c419aa9
Auto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-…
bors Jul 8, 2022
603b6fc
fix: Extract Function misses locals used in closures
DorianListens Jul 6, 2022
2836dd1
Auto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianL…
bors Jul 8, 2022
21062f9
fix: Improve suggested names for extracted variables
DorianListens Jul 8, 2022
638abba
Fix test
Rustin170506 Jul 9, 2022
666343b
Auto merge of #12727 - DorianListens:dscheidt/extract-var-field-name,…
bors Jul 9, 2022
03a62c1
Bump vscode-languageclient
lnicola Jul 9, 2022
b43708c
Bump d3 and d3-graphviz
lnicola Jul 9, 2022
1b138b1
Bump esbuild
lnicola Jul 9, 2022
7b1b711
Bump eslint
lnicola Jul 9, 2022
0e38961
Bump vsce
lnicola Jul 9, 2022
d03ed83
Bump @typescript-eslint
lnicola Jul 9, 2022
8e889ac
Bump prettier
lnicola Jul 9, 2022
2c9e395
Bump typescript and tslib
lnicola Jul 9, 2022
358d6c6
Bump @types/node to 16
lnicola Jul 9, 2022
a059e79
Bump @vscode/test-electron
lnicola Jul 9, 2022
cb38145
Bump transitive npm deps
lnicola Jul 9, 2022
5342f47
Auto merge of #12732 - lnicola:bump-npm, r=lnicola
bors Jul 9, 2022
4b3164f
fix: ignore renames for crate root
harpsword Jul 7, 2022
eaebead
Fix config keys regarding imports in docs
TonalidadeHidrica Jul 11, 2022
6e55716
Fix obsolete `loadOutDirsFromCheck` configs
TonalidadeHidrica Jul 11, 2022
195ceea
Fix obsolete `diagnostics.experimental.enable`
TonalidadeHidrica Jul 11, 2022
f0649f2
Fix `rustcSource` -> `rustc_source`
TonalidadeHidrica Jul 11, 2022
dfcbed0
Fix obsolete `enableRangeFormatting` config
TonalidadeHidrica Jul 11, 2022
e3bde57
Fix obsolete `completion.snippets` config
TonalidadeHidrica Jul 11, 2022
d9ab7f2
Fix typos
Rustin170506 Jul 11, 2022
f7bb932
Auto merge of #12744 - hi-rustin:rustin-patch-typos, r=lnicola
bors Jul 11, 2022
df66eb7
Implement `ignore` and `index` metavar expression
Jul 11, 2022
caf23f2
Auto merge of #12745 - jonas-schievink:metavar-exprs, r=jonas-schievink
bors Jul 11, 2022
ebfbb31
Update 1.63 proc macro ABI to match rustc
Jul 12, 2022
4cbf23c
Auto merge of #12747 - jonas-schievink:proc-macro-abi-1.63, r=jonas-s…
bors Jul 12, 2022
84a6bc9
Auto merge of #12742 - TonalidadeHidrica:fix-obsolete-config-keys, r=…
bors Jul 13, 2022
fc47ce5
Auto merge of #12696 - hi-rustin:rustin-patch-fix, r=Veykril
bors Jul 13, 2022
def89af
fix: Fix VSCode status bar tooltip not showing the error messages
Veykril Jul 13, 2022
90b5097
Auto merge of #12754 - Veykril:vscode-status, r=Veykril
bors Jul 13, 2022
ec51dcb
fix: Set server binary version when distributing
Veykril Jul 13, 2022
794ecd5
Auto merge of #12755 - Veykril:server-version, r=lnicola
bors Jul 13, 2022
a5ad4de
add tests
soruh Jul 13, 2022
075ab03
fix: Support generics in extract_function assist
DorianListens Apr 30, 2022
796641b
Make search for applicable generics more precise
DorianListens Jul 13, 2022
4cbde4e
fix(completion): `super::` completion at crate root and module depth
feniljain Jul 10, 2022
5af3ef5
Auto merge of #12735 - feniljain:fix-completions, r=feniljain
bors Jul 14, 2022
fbba1d7
Auto merge of #12691 - Veykril:proc-macro-diag, r=Veykril
bors Jul 14, 2022
073b325
Auto merge of #12556 - DorianListens:dscheidt/generic-extract, r=Veykril
bors Jul 14, 2022
6b823b0
fix: Fix imports being inserted before doc comments in inline modules
Veykril Jul 14, 2022
029184d
Auto merge of #12765 - Veykril:import-insert-fix, r=Veykril
bors Jul 14, 2022
7ff6c36
fix: Don't show qualified path completions for private items
Veykril Jul 14, 2022
f4fe2ea
Remove deprecate action
matklad Jul 14, 2022
248fa55
Update .github/workflows/release.yaml
matklad Jul 14, 2022
b49f2a2
Remove deprecate action
matklad Jul 14, 2022
4ad9185
Auto merge of #12764 - matklad:rustupaction, r=lnicola
bors Jul 16, 2022
25090f0
internal: Remove allocation in DefCollector::reseed_with_unresolved_a…
Veykril Jul 16, 2022
2e9d5b5
Auto merge of #12766 - Veykril:completion-vis, r=Veykril
bors Jul 16, 2022
d3796ad
Auto merge of #12772 - Veykril:nameres, r=Veykril
bors Jul 16, 2022
b96f8f1
fix: Improve self param completion applicability
Veykril Jul 16, 2022
96481b7
Auto merge of #12773 - Veykril:self-compl, r=Veykril
bors Jul 16, 2022
c205c62
try fixing spurious CI failures on windows
matklad Jul 16, 2022
f2c2c36
Auto merge of #12776 - matklad:nosu, r=matklad
bors Jul 16, 2022
0a4065d
Improve syntax fixup a bit, handle incomplete `if`
flodiebold Jul 16, 2022
3d7da51
Auto merge of #12775 - flodiebold:syntax-fixup-if, r=flodiebold
bors Jul 16, 2022
ac526e0
Auto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril
bors Jul 16, 2022
01d2517
Auto merge of #12539 - soruh:instanciate_empty_structs, r=Veykril
bors Jul 16, 2022
766c5f0
Auto merge of #12689 - Veykril:macro-rec, r=Veykril
bors Jul 16, 2022
b9b42e8
tests: add hover tests for const generics
Logarithmus Jul 13, 2022
a96f0aa
feat: support negative const generic parameters
Logarithmus Jul 17, 2022
a0fd58b
Check for local IDs belong to same definition
iDawer Jul 17, 2022
667fd25
Auto merge of #12781 - iDawer:hir_display.stack_overflow, r=lnicola
bors Jul 17, 2022
15f7300
refactor: inline some variables
Logarithmus Jul 17, 2022
83177a7
fix: address suggestions
Logarithmus Jul 17, 2022
db6a85d
Auto merge of #12778 - Logarithmus:feature/fix-negative-const-generic…
bors Jul 17, 2022
d9336a4
fix: un-inline `ConstScalarOrPath::from_expr_opt`
Logarithmus Jul 17, 2022
897a7ec
Auto merge of #12785 - Logarithmus:feature/fix-negative-const-generic…
bors Jul 17, 2022
ea19e70
Fix extract variable assist for subexpression in mutable borrow
hasali19 Jul 17, 2022
b5aa3b3
fix: “Generate constant” ignores the path prefix of the identifier
harpsword May 1, 2022
8e379ce
Auto merge of #12286 - harpsword:fix_generate_constant, r=Veykril
bors Jul 18, 2022
6cb0746
Support the 1.64 nightly proc macro ABI
Jul 18, 2022
ee2d5fe
Auto merge of #12795 - jonas-schievink:proc-macro-abi-1.64, r=jonas-s…
bors Jul 18, 2022
be30c4d
chore: change str_ref_to_string to str_ref_to_owned
mmirate Jul 18, 2022
e2eaa99
Auto merge of #12788 - hasali19:extract-var-mut, r=jonas-schievink
bors Jul 18, 2022
5ad981b
Remove outdated proc macro ABIs
Jul 18, 2022
e01de19
Auto merge of #12798 - jonas-schievink:trim-proc-macro-abis, r=jonas-…
bors Jul 18, 2022
15016bc
Find original as node before compute ref match
Rustin170506 Jul 18, 2022
188c0e4
Remove macro ABI version from doc comment
Jul 18, 2022
ea41617
Auto merge of #12802 - rust-lang:jonas-schievink-patch-1, r=jonas-sch…
bors Jul 18, 2022
ec1142c
Improve file watcher config
Jul 18, 2022
38c11be
Move `convert_to_def_in_trait` into `ide-db`
Veykril Jul 18, 2022
22e53f1
Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril
bors Jul 18, 2022
fac6a64
Auto merge of #12804 - jonas-schievink:config-watcher, r=Veykril
bors Jul 18, 2022
530eb27
Auto merge of #11819 - rust-lang:dependabot/npm_and_yarn/editors/code…
bors Jul 18, 2022
d17a5ef
Add simple support for completion item details
Veykril Jul 18, 2022
dc05192
Auto merge of #12807 - Veykril:completion-item-details, r=Veykril
bors Jul 18, 2022
ffb6b23
fix: Prevent panic in Remove Unused Parameter assist
DorianListens Jul 17, 2022
567a5e9
Auto merge of #12796 - mmirate:patch-1, r=Veykril
bors Jul 18, 2022
27b65ec
Add test case and token finder to address 12790
TopGunSnake Jul 19, 2022
3203cb1
Added coverage for trait, mod, impl, and enum cases.
TopGunSnake Jul 19, 2022
3cb78ff
Cleaned up trailing whitespace for tidy::files_are_tidy
TopGunSnake Jul 19, 2022
09da74a
Added case for const
TopGunSnake Jul 19, 2022
474f5ea
Work around Code bug with empty diagnostics
lnicola Jul 18, 2022
88515b9
Auto merge of #12809 - lnicola:empty-diagnostics, r=lnicola
bors Jul 19, 2022
1b41647
Upgrade to [email protected]
fasterthanlime Jul 19, 2022
307be7c
Add CARGO_WORKSPACE_DIR env var in `.cargo/config.toml`
fasterthanlime Jul 19, 2022
7d20ff3
Auto merge of #12817 - fasterthanlime:expect-test-1-4-0, r=lnicola
bors Jul 19, 2022
30c4db1
Auto merge of #12789 - DorianListens:dscheidt/unused-param-overlappin…
bors Jul 19, 2022
6df414f
Inverted the match logic to skip comments, attribute macros, and whit…
TopGunSnake Jul 19, 2022
0e71356
Auto merge of #12800 - hi-rustin:rustin-patch-issue-12717, r=hi-rustin
bors Jul 20, 2022
1c32fcf
Fix generated `PartialEq::ne`
SpecialMike Jul 20, 2022
c001b9c
Auto merge of #12821 - SpecialMike:fix-partial-eq-default, r=Veykril
bors Jul 20, 2022
8454413
Auto merge of #12811 - TopGunSnake:12790, r=Veykril
bors Jul 20, 2022
cfc52ad
Add comments
lowr Jul 20, 2022
f3e9b38
Auto merge of #12646 - lowr:fix/11897, r=lowr
bors Jul 20, 2022
bb4bfae
fix: Fix search for associated trait items being inconsistent
Veykril Jul 20, 2022
0ded8e7
Auto merge of #12825 - Veykril:trait-assoc-search, r=Veykril
bors Jul 20, 2022
23d25a3
Enable extra warnings required by rust-lang/rust
fasterthanlime Jul 20, 2022
816f7fe
Run cargo fix --edition-idioms
fasterthanlime Jul 20, 2022
8318035
Fix last few warnings manually
fasterthanlime Jul 20, 2022
7e285e1
Run cargo fmt
fasterthanlime Jul 20, 2022
e507807
internal: Don't eagerly construct `AstIdMap`s
Veykril Jul 20, 2022
28bab68
Auto merge of #12826 - fasterthanlime:in-tree-warnings, r=Veykril
bors Jul 20, 2022
ade31ad
Rename proc macro server from 'Rustc' to 'RustAnalyzer'
fasterthanlime Jul 20, 2022
c520408
Allow merge commits when 'in-rust-tree' feature is enabled
fasterthanlime Jul 20, 2022
100ea1d
Auto merge of #12828 - fasterthanlime:proc-macro-srv-naming, r=Veykril
bors Jul 20, 2022
d5b1ae6
Remove check_merge_commits test altogether
fasterthanlime Jul 20, 2022
244f29b
Remove in-rust-tree feature
fasterthanlime Jul 20, 2022
bd4439f
Auto merge of #12829 - fasterthanlime:in-rust-tree-feature, r=Veykril
bors Jul 20, 2022
a88e088
Build proc-macro-test-impl out-of-tree
fasterthanlime Jul 20, 2022
4375cf3
proc-macro-test build script: wipe before, be more verbose
fasterthanlime Jul 20, 2022
898898d
Don't copy the Cargo.lock
fasterthanlime Jul 20, 2022
f504294
Add proc-macro-srv integration test that clones literals
fasterthanlime Jul 20, 2022
9a8efe2
Update crates/proc-macro-test/build.rs
fasterthanlime Jul 20, 2022
844aa8b
Update crates/proc-macro-test/build.rs
fasterthanlime Jul 20, 2022
7dc36ee
Auto merge of #12831 - fasterthanlime:proc-macro-test-in-tmp-dir, r=f…
bors Jul 20, 2022
cd2c240
Auto merge of #12833 - fasterthanlime:literal-tests, r=Veykril
bors Jul 20, 2022
dcd52ec
Add PROC_MACRO_TEST_TOOLCHAIN environment variable
fasterthanlime Jul 20, 2022
fa883cb
Auto merge of #12834 - fasterthanlime:proc-macro-test-toolchain, r=Ve…
bors Jul 20, 2022
315b0a7
Add sysroot-abi feature, copy 1.64 ABI fo rnow
fasterthanlime Jul 20, 2022
e009cdc
Move token_stream to separate module
fasterthanlime Jul 20, 2022
00bc060
Fix imports, delete removed interfaces
fasterthanlime Jul 20, 2022
191db9f
stub missing APIs
fasterthanlime Jul 20, 2022
d25b610
Add literal/ident conversion, tests pass
fasterthanlime Jul 20, 2022
480f555
implement literal_from_str (poorly)
fasterthanlime Jul 20, 2022
c83f14a
Remove AstIdMap from Expander as it is seldom needed
Veykril Jul 21, 2022
7bd2e30
Simplify
Veykril Jul 21, 2022
2f6c390
Auto merge of #12827 - Veykril:be-lazy, r=Veykril
bors Jul 21, 2022
10c7ee7
Simplify
Veykril Jul 21, 2022
1aadd9d
internal: Use itemtree for variant and field attribute collection
Veykril Jul 21, 2022
5f9a582
Use ItemTree for crate root attr_query collection
Veykril Jul 21, 2022
cfad882
fix: Fix `trait_impls_in_deps_query` being called directly instead of…
Veykril Jul 21, 2022
84a6fac
Auto merge of #12841 - Veykril:query-fix, r=Veykril
bors Jul 21, 2022
fdddd83
Assert that sysroot ABI version matches exactly
fasterthanlime Jul 21, 2022
bbaf4da
Pass tidy checks
fasterthanlime Jul 21, 2022
3076959
Move version string to RustcInfo, read '.rustc' section only once
fasterthanlime Jul 21, 2022
05d8f5f
Use a thread-local for the symbol interner (1/2)
fasterthanlime Jul 21, 2022
32ee097
Run proc macro expansion in a separate thread (for the thread-local i…
fasterthanlime Jul 21, 2022
36d825f
Add test for literals created client-side
fasterthanlime Jul 21, 2022
9cf99a9
Stringify literals create client-side properly
fasterthanlime Jul 21, 2022
941416a
Add test for idents incl. raw idents
fasterthanlime Jul 21, 2022
246947b
Fix raw ident handling (a little)
fasterthanlime Jul 21, 2022
48bcc22
Move interner methods to Symbol, return SmolStr directly since it's r…
fasterthanlime Jul 21, 2022
39db9cd
Use std::panic::resume_unwind
fasterthanlime Jul 21, 2022
e591ff3
Add comment about replacing crossbeam with std scoped threads when th…
fasterthanlime Jul 22, 2022
cb8a3be
Auto merge of #12835 - fasterthanlime:sysroot-abi, r=fasterthanlime
bors Jul 22, 2022
1ab862a
fix: Improve syntax highlighting in attributes
Veykril Jul 22, 2022
7e30ca1
Auto merge of #12844 - Veykril:highlight-attr, r=Veykril
bors Jul 22, 2022
0081ef3
Use ItemTree for modules in attrs_query
Veykril Jul 21, 2022
d469e0d
Auto merge of #12840 - Veykril:be-lazy, r=Veykril
bors Jul 22, 2022
f1b5e38
Revert 03a62c180e6a7300d0d7b8c4d680b749c101bcbb
Veykril Jul 22, 2022
8272d2a
Auto merge of #12847 - Veykril:vscode-downgrade, r=Veykril
bors Jul 22, 2022
cb6703f
internal: Don't parse files unnecessarily in scope_for_offset
Veykril Jul 22, 2022
e223d20
fix: Fix error tooltip message for VSCode status bar item
Veykril Jul 22, 2022
fbb1337
Auto merge of #12850 - Veykril:display-fix, r=Veykril
bors Jul 22, 2022
0b131bc
Auto merge of #12849 - Veykril:no-parse, r=Veykril
bors Jul 22, 2022
ff041bf
fix generate_new doc
RalfJung Jul 23, 2022
f3a46f6
Auto merge of #12854 - RalfJung:generate_new, r=Veykril
bors Jul 23, 2022
13c83f9
fix: Don't add braces to 'if' completion in match guard position
DorianListens Jul 23, 2022
2be0062
Auto merge of #12851 - DorianListens:dscheidt/if-completion-match-gua…
bors Jul 23, 2022
a436be4
feat: don't highlight the whole fn on return-type mismatch
matklad Jul 23, 2022
5bd8443
internal: extract common code for adjusting diagnostic range
matklad Jul 23, 2022
977e12a
Auto merge of #12859 - matklad:dont-color-the-whole-block-red-all-the…
bors Jul 23, 2022
3c98486
Remove rust-analyzer submodule
fasterthanlime Jul 24, 2022
43acb50
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a…
fasterthanlime Jul 24, 2022
0f2266d
Convert rust-analyzer to 'in-tree' tool, pass 'in-rust-tree' feature …
fasterthanlime Jul 22, 2022
9cf485c
Add check step, stuck on 'no output generated for libgoto_def-hash rm…
fasterthanlime Jul 22, 2022
d59abcf
Check only tests and benches, not examples
fasterthanlime Jul 22, 2022
4ea2f8e
Add test step for rust-analyzer, run it by default
fasterthanlime Jul 22, 2022
4dedb58
Use compiler.stage
fasterthanlime Jul 22, 2022
d42b28a
Allow cross-compiling, build all crates
fasterthanlime Jul 22, 2022
37ed531
Use top-level path in tool Step
fasterthanlime Jul 22, 2022
44f50c5
Add comment about CARGO_WORKSPACE_DIR
fasterthanlime Jul 22, 2022
107e265
Don't run slow tests in Rust CI, only RA CI
fasterthanlime Jul 22, 2022
7534562
Disable all source-gen tests at compile time
fasterthanlime Jul 23, 2022
e0add21
Move cfg attrs up to the mod definitions to disable sourcegen
fasterthanlime Jul 23, 2022
ee09dc5
Small fixups
jyn514 Jul 23, 2022
1bb63df
Fix .gitattributes for test_data
fasterthanlime Jul 24, 2022
e436260
hir-def tests: sort results before comparing, since FxHashSet iterati…
fasterthanlime Jul 24, 2022
4e1a302
Sort in DefMap::dump, since HashMap iteration order isn't defined
fasterthanlime Jul 24, 2022
6c07c71
Sort when iterating through CrateGraph
fasterthanlime Jul 24, 2022
ee584c1
Make macros test order-resistant
fasterthanlime Jul 24, 2022
fa0037a
Only run proc-macro-srv tests for now (after discussion with @Veykril…
fasterthanlime Jul 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
[submodule "src/tools/rust-analyzer"]
path = src/tools/rust-analyzer
url = https://github.com/rust-analyzer/rust-analyzer.git
[submodule "library/backtrace"]
path = library/backtrace
url = https://github.com/rust-lang/backtrace-rs.git
4 changes: 3 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ impl<'a> Builder<'a> {
check::Clippy,
check::Miri,
check::Rls,
check::RustAnalyzer,
check::Rustfmt,
check::Bootstrap
),
Expand Down Expand Up @@ -648,6 +649,7 @@ impl<'a> Builder<'a> {
test::Cargotest,
test::Cargo,
test::Rls,
test::RustAnalyzer,
test::ErrorIndex,
test::Distcheck,
test::RunMakeFullDeps,
Expand Down Expand Up @@ -1551,7 +1553,7 @@ impl<'a> Builder<'a> {
Mode::ToolStd => {
// Right now this is just compiletest and a few other tools that build on stable.
// Allow them to use `feature(test)`, but nothing else.
rustflags.arg("-Zallow-features=binary-dep-depinfo,test,backtrace");
rustflags.arg("-Zallow-features=binary-dep-depinfo,test,backtrace,proc_macro_internals,proc_macro_diagnostic,proc_macro_span");
Comment on lines 1554 to +1556
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty suspicious to me -- the comment is here for a reason, we shouldn't be expanding this list to arbitrary features, since that means that tools will eventually need cfg(bootstrap) internally, which is painful to support (for us and for the tools). Is there a reason we're not just using Std for rust-analyzer? That seems much more appropriate; it clearly doesn't actually build on stable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm
Isn't there lots of stuff in bootstrap that already switches on Mode::Std? I worry changing it will break something else.

I do agree the proc macro server is inherently unstable; I guess the best thing to do is to switch and see what breaks. Don't have time for that today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, having thought about this more I think ToolStd is correct. If you look at when it was originally added, the motivation was to allow distros to build compiletest with the previous beta compiler. Before ToolStd, it would break on change to libtest.

So this does exactly what we want: it allows using nightly features from the standard library, but not language features in the nightly compiler. The fact that it happens to use the beta standard library for build scripts is just because the rustc shim is not very smart and does that unconditionally for all build scripts in stage 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proc_macro_span and proc_macro_diagnostic are definitely language-y features, not just library features (even if their surface area is defined there). So I'm not sure I buy that argument fully.

In any case, it seems maybe OK to leave this until it causes us trouble down the line -- as long as rust-analyzer is a subtree it's not too hard to fix breakage caused by these features changing, hopefully.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. If it makes you feel better, this allows strictly fewer nightly features than before (it used to be ToolRustc) and the RA devs care a lot about being able to build on stable, so I think this is unlikely to break :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, clearly these features are being used by something that's not going to build on stable, and I'm much more likely to see breakage to them coming from modifications in rustc/std than from work on rust-analyzer, so this is not particularly reassuring :)

ToolRustc is in some ways better; it allows all nightly features, but we learn of breakage immediately. With ToolStd, we learn of breakage when we do a beta-bump, which is a terrible time. In rust-analyzer's case maybe we're lucky and they're already doing this same thing on their CI and will do a bump to rust-lang/rust in time, but there's a time and someone-is-running-CI-often component there that makes me concerned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolRustc is in some ways better; it allows all nightly features, but we learn of breakage immediately

Huh, that might explain why x.py test --stage 0 rust-analyzer used to work in my first subtree PR. And it might be the better choice here eventually. 🤔

Again though, until you think this is a blocker for the merge, for now I'm worried about merge conflicts that would cause me to redo the whole PR (I don't mind doing it if we have a compelling reason, but it is time I'd rather spend elsewhere).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that might explain why x.py test --stage 0 rust-analyzer used to work in my first subtree PR.

That sounds unlikely. The shim uses beta libstd for all stage 0 build scripts regardless of the mode.

I am slightly unsure why @Mark-Simulacrum thinks we'd only catch breakage in beta, since this is only using features from std.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those features are thin shims over significantly larger surface area in the compiler (AFAIK), like the rest of proc-macro; the compiler used during the use of these features is presumably the stage0 beta, so you're not exercising any new code in the compiler until we bump that beta.

I continue to not believe this is a blocker for merging (otherwise I'd have r-'d), just flagging a concern, partially so that we can get on the same page and make sure @jyn514 is aware of this for future bootstrap changes, potentially unrelated to rust-analyzer. (Or that I'm aware that this is the wrong conclusion to draw, alternatively :)

}
Mode::Std | Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {}
}
Expand Down
62 changes: 62 additions & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,68 @@ impl Step for CodegenBackend {
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct RustAnalyzer {
pub target: TargetSelection,
}

impl Step for RustAnalyzer {
type Output = ();
const ONLY_HOSTS: bool = true;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/rust-analyzer")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustAnalyzer { target: run.target });
}

fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(builder.top_stage, builder.config.build);
let target = self.target;

builder.ensure(Std { target });

let mut cargo = prepare_tool_cargo(
builder,
compiler,
Mode::ToolStd,
target,
cargo_subcommand(builder.kind),
"src/tools/rust-analyzer",
SourceType::InTree,
&["rust-analyzer/in-rust-tree".to_owned()],
);

cargo.rustflag(
"-Zallow-features=proc_macro_internals,proc_macro_diagnostic,proc_macro_span",
);

// For ./x.py clippy, don't check those targets because
// linting tests and benchmarks can produce very noisy results
if builder.kind != Kind::Clippy {
// can't use `--all-targets` because `--examples` doesn't work well
cargo.arg("--bins");
cargo.arg("--tests");
cargo.arg("--benches");
}
fasterthanlime marked this conversation as resolved.
Show resolved Hide resolved

builder.info(&format!(
"Checking stage{} {} artifacts ({} -> {})",
compiler.stage, "rust-analyzer", &compiler.host.triple, target.triple
));
run_cargo(builder, cargo, args(builder), &stamp(builder, compiler, target), vec![], true);

/// Cargo's output path in a given stage, compiled by a particular
/// compiler for the specified target.
fn stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf {
builder.cargo_out(compiler, Mode::ToolStd, target).join(".rust-analyzer-check.stamp")
}
}
}

macro_rules! tool_check_step {
($name:ident, $path:literal, $($alias:literal, )* $source_type:path $(, $default:literal )?) => {
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ impl Step for RustAnalyzer {
}

let rust_analyzer = builder
.ensure(tool::RustAnalyzer { compiler, target, extra_features: Vec::new() })
.ensure(tool::RustAnalyzer { compiler, target })
.expect("rust-analyzer always builds");

let mut tarball = Tarball::new(builder, "rust-analyzer", &target.triple);
Expand Down
58 changes: 58 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,64 @@ impl Step for Rls {
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct RustAnalyzer {
stage: u32,
host: TargetSelection,
}

impl Step for RustAnalyzer {
type Output = ();
const ONLY_HOSTS: bool = true;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/rust-analyzer")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Self { stage: run.builder.top_stage, host: run.target });
}

/// Runs `cargo test` for rust-analyzer
fn run(self, builder: &Builder<'_>) {
let stage = self.stage;
let host = self.host;
let compiler = builder.compiler(stage, host);

builder.ensure(tool::RustAnalyzer { compiler, target: self.host }).expect("in-tree tool");

let workspace_path = "src/tools/rust-analyzer";
// until the whole RA test suite runs on `i686`, we only run
// `proc-macro-srv` tests
let crate_path = "src/tools/rust-analyzer/crates/proc-macro-srv";
let mut cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolStd,
host,
"test",
crate_path,
SourceType::InTree,
&["sysroot-abi".to_owned()],
);

let dir = builder.src.join(workspace_path);
// needed by rust-analyzer to find its own text fixtures, cf.
// https://github.com/rust-analyzer/expect-test/issues/33
cargo.env("CARGO_WORKSPACE_DIR", &dir);
jyn514 marked this conversation as resolved.
Show resolved Hide resolved

// RA's test suite tries to write to the source directory, that can't
// work in Rust CI
cargo.env("SKIP_SLOW_TESTS", "1");

cargo.add_rustc_lib_path(builder, compiler);
cargo.arg("--").args(builder.config.cmd.test_args());

builder.run(&mut cargo.into());
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Rustfmt {
stage: u32,
Expand Down
47 changes: 45 additions & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashSet;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::path::PathBuf;
use std::process::Command;

use crate::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step};
Expand Down Expand Up @@ -683,6 +683,50 @@ impl Step for LldWrapper {
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RustAnalyzer {
pub compiler: Compiler,
pub target: TargetSelection,
}

impl Step for RustAnalyzer {
type Output = Option<PathBuf>;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = false;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.path("src/tools/rust-analyzer").default_condition(
builder.config.extended
&& builder
.config
.tools
.as_ref()
.map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
)
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RustAnalyzer {
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
target: run.target,
});
}

fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
builder.ensure(ToolBuild {
compiler: self.compiler,
target: self.target,
tool: "rust-analyzer",
mode: Mode::ToolStd,
path: "src/tools/rust-analyzer",
extra_features: vec!["rust-analyzer/in-rust-tree".to_owned()],
is_optional_tool: false,
source_type: SourceType::InTree,
})
}
}

macro_rules! tool_extended {
(($sel:ident, $builder:ident),
$($name:ident,
Expand Down Expand Up @@ -780,7 +824,6 @@ tool_extended!((self, builder),
// and this is close enough for now.
RustDemangler, rust_demangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, tool_std=true, {};
Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {};
RustAnalyzer, rust_analyzer, "src/tools/rust-analyzer/crates/rust-analyzer", "rust-analyzer", stable=true, submodule="rust-analyzer", {};
);

impl<'a> Builder<'a> {
Expand Down
1 change: 0 additions & 1 deletion src/tools/rust-analyzer
Submodule rust-analyzer deleted from 897a7e
11 changes: 11 additions & 0 deletions src/tools/rust-analyzer/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[alias]
xtask = "run --package xtask --bin xtask --"
tq = "test -- -q"
qt = "tq"
lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass_by_value -Aclippy::nonminimal_bool -Aclippy::redundant_pattern_matching --cap-lints warn"

[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
19 changes: 19 additions & 0 deletions src/tools/rust-analyzer/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://EditorConfig.org
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = space

[*.{rs,toml}]
indent_size = 4

[*.ts]
indent_size = 4
[*.js]
indent_size = 4
[*.json]
indent_size = 4
8 changes: 8 additions & 0 deletions src/tools/rust-analyzer/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# for this file to take effect make sure you use git ^2.23 and
# add ignoreFile to your git configuration:
# ```
# git config --global blame.ignoreRevsFile .git-blame-ignore-revs
# ```

# prettier format
f247090558c9ba3c551566eae5882b7ca865225f
9 changes: 9 additions & 0 deletions src/tools/rust-analyzer/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* text=auto eol=lf

# git grep shouldn't match entries in this benchmark data
bench_data/** binary

# Older git versions try to fix line endings on images, this prevents it.
*.png binary
*.jpg binary
*.ico binary
10 changes: 10 additions & 0 deletions src/tools/rust-analyzer/.github/ISSUE_TEMPLATE/blank_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Blank Issue
about: Create a blank issue.
title: ''
labels: ''
assignees: ''

---


26 changes: 26 additions & 0 deletions src/tools/rust-analyzer/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a bug report for rust-analyzer.
title: ''
labels: ''
assignees: ''

---

<!--
Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting
Forum for questions: https://users.rust-lang.org/c/ide/14

Before submitting, please make sure that you're not running into one of these known issues:

1. extension doesn't load in VSCodium: #11080
2. on-the-fly diagnostics are mostly unimplemented (`cargo check` diagnostics will be shown when saving a file): #3107

Otherwise please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3.
-->

**rust-analyzer version**: (eg. output of "Rust Analyzer: Show RA Version" command)

**rustc version**: (eg. output of `rustc -V`)

**relevant settings**: (eg. client settings, or environment variables like `CARGO`, `RUSTUP_HOME` or `CARGO_HOME`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Critical Nightly Regression
about: You are using nightly rust-analyzer and the latest version is unusable.
title: ''
labels: ''
assignees: 'matklad'

---

<!--
Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting

Please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3.
-->

This is a serious regression in nightly and it's important to fix it before the next release.
@matklad, please take a look.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:slim

COPY . /action
WORKDIR /action

RUN npm install --production

ENTRYPOINT ["node", "/action/main.js"]
21 changes: 21 additions & 0 deletions src/tools/rust-analyzer/.github/actions/github-release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# github-release

Copy-pasted from
https://github.com/bytecodealliance/wasmtime/tree/8acfdbdd8aa550d1b84e0ce1e6222a6605d14e38/.github/actions/github-release

An action used to publish GitHub releases for `wasmtime`.

As of the time of this writing there's a few actions floating around which
perform github releases but they all tend to have their set of drawbacks.
Additionally nothing handles deleting releases which we need for our rolling
`dev` release.

To handle all this this action rolls-its-own implementation using the
actions/toolkit repository and packages published there. These run in a Docker
container and take various inputs to orchestrate the release from the build.

More comments can be found in `main.js`.

Testing this is really hard. If you want to try though run `npm install` and
then `node main.js`. You'll have to configure a bunch of env vars though to get
anything reasonably working.
Loading