Skip to content

Commit a5a46a7

Browse files
authored
Unrolled build for rust-lang#138305
Rollup merge of rust-lang#138305 - lnicola:sync-from-ra, r=lnicola Subtree update of `rust-analyzer` r? `@ghost`
2 parents 2b285cd + 52f39ff commit a5a46a7

File tree

184 files changed

+4676
-1880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4676
-1880
lines changed

src/tools/rust-analyzer/.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ indent_size = 2
1515

1616
[*.{yml,yaml}]
1717
indent_size = 2
18+
19+
[COMMIT_EDITMSG]
20+
max_line_length = unset

src/tools/rust-analyzer/.github/workflows/ci.yaml

+46-27
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,48 @@ jobs:
3535
typescript:
3636
- 'editors/code/**'
3737
proc_macros:
38+
- 'crates/tt/**'
3839
- 'crates/proc-macro-api/**'
3940
- 'crates/proc-macro-srv/**'
4041
- 'crates/proc-macro-srv-cli/**'
4142
42-
rust:
43+
proc-macro-srv:
4344
needs: changes
45+
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.proc_macros == 'true'
46+
name: proc-macro-srv
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.event.pull_request.head.sha }}
53+
54+
- name: Install Rust toolchain
55+
run: |
56+
rustup update --no-self-update nightly
57+
rustup default nightly
58+
rustup component add --toolchain nightly rust-src rustfmt
59+
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
60+
- name: Install Rust Problem Matcher
61+
if: matrix.os == 'ubuntu-latest'
62+
run: echo "::add-matcher::.github/rust.json"
63+
64+
- name: Cache Dependencies
65+
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
66+
67+
- name: Bump opt-level
68+
if: matrix.os == 'ubuntu-latest'
69+
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
70+
71+
- name: Test
72+
run: cargo test --features sysroot-abi -p rust-analyzer -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet
73+
74+
rust:
4475
if: github.repository == 'rust-lang/rust-analyzer'
4576
name: Rust
4677
runs-on: ${{ matrix.os }}
4778
env:
4879
CC: deny_c
49-
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable' }}"
50-
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || '' }}"
5180

5281
strategy:
5382
fail-fast: false
@@ -62,22 +91,19 @@ jobs:
6291

6392
- name: Install Rust toolchain
6493
run: |
65-
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
66-
rustup default ${{ env.RUST_CHANNEL }}
67-
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rust-src
94+
rustup update --no-self-update stable
95+
rustup default stable
96+
rustup component add --toolchain stable rust-src
6897
# We always use a nightly rustfmt, regardless of channel, because we need
6998
# --file-lines.
70-
rustup toolchain add nightly --profile minimal
71-
rustup component add --toolchain nightly rustfmt
99+
rustup toolchain install nightly --profile minimal --component rustfmt
72100
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
73101
- name: Install Rust Problem Matcher
74102
if: matrix.os == 'ubuntu-latest'
75103
run: echo "::add-matcher::.github/rust.json"
76104

77105
- name: Cache Dependencies
78106
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
79-
with:
80-
key: ${{ env.RUST_CHANNEL }}
81107

82108
- name: Bump opt-level
83109
if: matrix.os == 'ubuntu-latest'
@@ -87,16 +113,16 @@ jobs:
87113
run: cargo codegen --check
88114

89115
- name: Compile (tests)
90-
run: cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
116+
run: cargo test --no-run --locked
91117

92118
# It's faster to `test` before `build` ¯\_(ツ)_/¯
93119
- name: Compile (rust-analyzer)
94120
if: matrix.os == 'ubuntu-latest'
95-
run: cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
121+
run: cargo build --quiet
96122

97123
- name: Test
98124
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
99-
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
125+
run: cargo test -- --quiet
100126

101127
- name: Switch to stable toolchain
102128
run: |
@@ -157,7 +183,7 @@ jobs:
157183
158184
typescript:
159185
needs: changes
160-
if: github.repository == 'rust-lang/rust-analyzer'
186+
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
161187
name: TypeScript
162188
strategy:
163189
fail-fast: false
@@ -169,21 +195,18 @@ jobs:
169195
steps:
170196
- name: Checkout repository
171197
uses: actions/checkout@v4
172-
if: needs.changes.outputs.typescript == 'true'
173198

174199
- name: Install Nodejs
175200
uses: actions/setup-node@v4
176201
with:
177202
node-version: 22
178-
if: needs.changes.outputs.typescript == 'true'
179203

180204
- name: Install xvfb
181-
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
205+
if: matrix.os == 'ubuntu-latest'
182206
run: sudo apt-get install -y xvfb
183207

184208
- run: npm ci
185209
working-directory: ./editors/code
186-
if: needs.changes.outputs.typescript == 'true'
187210

188211
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
189212
# if: runner.os == 'Linux'
@@ -192,35 +215,31 @@ jobs:
192215
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
193216
- run: npm run typecheck
194217
working-directory: ./editors/code
195-
if: needs.changes.outputs.typescript == 'true'
196218

197219
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
198220
- run: npm run lint
199221
working-directory: ./editors/code
200-
if: needs.changes.outputs.typescript == 'true'
201222

202223
# To fix this steps, please run `npm run format`.
203224
- run: npm run format:check
204225
working-directory: ./editors/code
205-
if: needs.changes.outputs.typescript == 'true'
206226

207227
- name: Run VS Code tests (Linux)
208-
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
228+
if: matrix.os == 'ubuntu-latest'
209229
env:
210230
VSCODE_CLI: 1
211231
run: xvfb-run npm test
212232
working-directory: ./editors/code
213233

214234
- name: Run VS Code tests (Windows)
215-
if: matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
235+
if: matrix.os == 'windows-latest'
216236
env:
217237
VSCODE_CLI: 1
218238
run: npm test
219239
working-directory: ./editors/code
220240

221241
- run: npm run package --scripts-prepend-node-path
222242
working-directory: ./editors/code
223-
if: needs.changes.outputs.typescript == 'true'
224243

225244
typo-check:
226245
name: Typo Check
@@ -242,7 +261,7 @@ jobs:
242261
run: typos
243262

244263
conclusion:
245-
needs: [rust, rust-cross, typescript, typo-check]
264+
needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv]
246265
# We need to ensure this job does *not* get skipped if its dependencies fail,
247266
# because a skipped job is considered a success by GitHub. So we have to
248267
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -257,5 +276,5 @@ jobs:
257276
run: |
258277
# Print the dependent jobs to see them in the CI log
259278
jq -C <<< '${{ toJson(needs) }}'
260-
# Check if all jobs that we depend on (in the needs array) were successful.
261-
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
279+
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
280+
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

src/tools/rust-analyzer/Cargo.lock

+22-23
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
191191

192192
[[package]]
193193
name = "chalk-derive"
194-
version = "0.99.0"
194+
version = "0.100.0"
195195
source = "registry+https://github.com/rust-lang/crates.io-index"
196-
checksum = "572583d9b97f9d277e5c7607f8239a30e2e04d3ed3b47c87d1cb2152ae724073"
196+
checksum = "ab2d131019373f0d0d1f2af0abd4f719739f6583c1b33965112455f643a910af"
197197
dependencies = [
198198
"proc-macro2",
199199
"quote",
@@ -203,19 +203,19 @@ dependencies = [
203203

204204
[[package]]
205205
name = "chalk-ir"
206-
version = "0.99.0"
206+
version = "0.100.0"
207207
source = "registry+https://github.com/rust-lang/crates.io-index"
208-
checksum = "e60e0ef9c81dce1336a9ed3c76f08775f5b623151d96d85ba45f7b10de76d1c7"
208+
checksum = "4f114996bda14c0213f014a4ef31a7867dcf5f539a3900477fc6b20138e7a17b"
209209
dependencies = [
210210
"bitflags 2.7.0",
211211
"chalk-derive",
212212
]
213213

214214
[[package]]
215215
name = "chalk-recursive"
216-
version = "0.99.0"
216+
version = "0.100.0"
217217
source = "registry+https://github.com/rust-lang/crates.io-index"
218-
checksum = "5a06350d614e22b03a69b8105e3541614450a7ea48bc58ecc6c6bd92731a3995"
218+
checksum = "551e956e031c09057c7b21f17d48d91de99c9b6b6e34bceaf5e7202d71021268"
219219
dependencies = [
220220
"chalk-derive",
221221
"chalk-ir",
@@ -226,9 +226,9 @@ dependencies = [
226226

227227
[[package]]
228228
name = "chalk-solve"
229-
version = "0.99.0"
229+
version = "0.100.0"
230230
source = "registry+https://github.com/rust-lang/crates.io-index"
231-
checksum = "0e428761e9b55bee516bfe2457caed8b6d1b86353f92ae825bbe438a36ce91e8"
231+
checksum = "cd7ca50181156ce649efe8e5dd00580f573651554e4dcd11afa4e2ac93f53324"
232232
dependencies = [
233233
"chalk-derive",
234234
"chalk-ir",
@@ -626,7 +626,6 @@ dependencies = [
626626
"oorandom",
627627
"project-model",
628628
"ra-ap-rustc_abi",
629-
"ra-ap-rustc_hashes",
630629
"ra-ap-rustc_index",
631630
"ra-ap-rustc_pattern_analysis",
632631
"rustc-hash 2.0.0",
@@ -1504,9 +1503,9 @@ dependencies = [
15041503

15051504
[[package]]
15061505
name = "ra-ap-rustc_abi"
1507-
version = "0.98.0"
1506+
version = "0.100.0"
15081507
source = "registry+https://github.com/rust-lang/crates.io-index"
1509-
checksum = "4b42cccfff8091a4c3397736518774dbad619e82f8def6f70d8e46dbbe396007"
1508+
checksum = "f1651b0f7e8c3eb7c27a88f39d277e69c32bfe58e3be174d286c1a24d6a7a4d8"
15101509
dependencies = [
15111510
"bitflags 2.7.0",
15121511
"ra-ap-rustc_hashes",
@@ -1516,28 +1515,28 @@ dependencies = [
15161515

15171516
[[package]]
15181517
name = "ra-ap-rustc_hashes"
1519-
version = "0.98.0"
1518+
version = "0.100.0"
15201519
source = "registry+https://github.com/rust-lang/crates.io-index"
1521-
checksum = "46d8bd34ed6552c8cac1764106ef5adbeef3e5c7700e0ceb4c83a47a631894fe"
1520+
checksum = "2bcd85e93dc0ea850bcfe7957a115957df799ccbc9eea488bdee5ec6780d212b"
15221521
dependencies = [
15231522
"rustc-stable-hash",
15241523
]
15251524

15261525
[[package]]
15271526
name = "ra-ap-rustc_index"
1528-
version = "0.98.0"
1527+
version = "0.100.0"
15291528
source = "registry+https://github.com/rust-lang/crates.io-index"
1530-
checksum = "93799e4dccbbd47f8b66bc0aa42effc1b7077aaee09d8a40b86b8d659b80c7b7"
1529+
checksum = "62b295fc0640cd9fe0ecab872ee4a17a96f90a3998ec9f0c4765e9b8415c12cc"
15311530
dependencies = [
15321531
"ra-ap-rustc_index_macros",
15331532
"smallvec",
15341533
]
15351534

15361535
[[package]]
15371536
name = "ra-ap-rustc_index_macros"
1538-
version = "0.98.0"
1537+
version = "0.100.0"
15391538
source = "registry+https://github.com/rust-lang/crates.io-index"
1540-
checksum = "30baa5d00f94ba437a9dcaf7ae074ebe4f367bb05a4c2835e0aa2e7af3463aac"
1539+
checksum = "c675f4257023aa933882906f13802cae287e88cc39ab13cbb96809083db0c801"
15411540
dependencies = [
15421541
"proc-macro2",
15431542
"quote",
@@ -1546,9 +1545,9 @@ dependencies = [
15461545

15471546
[[package]]
15481547
name = "ra-ap-rustc_lexer"
1549-
version = "0.98.0"
1548+
version = "0.100.0"
15501549
source = "registry+https://github.com/rust-lang/crates.io-index"
1551-
checksum = "3004d1d1b50afe3e1f9cdd428a282da7ffbf5f26dd8bf04af0d651d44e4873d8"
1550+
checksum = "c8358702c2a510ea84ba5801ddc047d9ad9520902cfb0e6173277610cdce2c9c"
15521551
dependencies = [
15531552
"memchr",
15541553
"unicode-properties",
@@ -1557,19 +1556,19 @@ dependencies = [
15571556

15581557
[[package]]
15591558
name = "ra-ap-rustc_parse_format"
1560-
version = "0.98.0"
1559+
version = "0.100.0"
15611560
source = "registry+https://github.com/rust-lang/crates.io-index"
1562-
checksum = "cb57e5124a64aaaf92c06130fbc1b8e1d547b5a2a96081f1f848e31c211df5d2"
1561+
checksum = "b98f402011d46732c35c47bfd111dec0495747fef2ec900ddee7fe15d78449a7"
15631562
dependencies = [
15641563
"ra-ap-rustc_index",
15651564
"ra-ap-rustc_lexer",
15661565
]
15671566

15681567
[[package]]
15691568
name = "ra-ap-rustc_pattern_analysis"
1570-
version = "0.98.0"
1569+
version = "0.100.0"
15711570
source = "registry+https://github.com/rust-lang/crates.io-index"
1572-
checksum = "e427c3d30e4bdff28abd6b0ef3e6f4dfab44acd9468a4954eeff8717d8df8819"
1571+
checksum = "bef3ff73fa4653252ffe1d1e9177a446f49ef46d97140e4816b7ff2dad59ed53"
15731572
dependencies = [
15741573
"ra-ap-rustc_index",
15751574
"rustc-hash 2.0.0",

src/tools/rust-analyzer/Cargo.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8585
vfs = { path = "./crates/vfs", version = "0.0.0" }
8686
edition = { path = "./crates/edition", version = "0.0.0" }
8787

88-
ra-ap-rustc_hashes = { version = "0.98", default-features = false }
89-
ra-ap-rustc_lexer = { version = "0.98", default-features = false }
90-
ra-ap-rustc_parse_format = { version = "0.98", default-features = false }
91-
ra-ap-rustc_index = { version = "0.98", default-features = false }
92-
ra-ap-rustc_abi = { version = "0.98", default-features = false }
93-
ra-ap-rustc_pattern_analysis = { version = "0.98", default-features = false }
88+
ra-ap-rustc_hashes = { version = "0.100", default-features = false }
89+
ra-ap-rustc_lexer = { version = "0.100", default-features = false }
90+
ra-ap-rustc_parse_format = { version = "0.100", default-features = false }
91+
ra-ap-rustc_index = { version = "0.100", default-features = false }
92+
ra-ap-rustc_abi = { version = "0.100", default-features = false }
93+
ra-ap-rustc_pattern_analysis = { version = "0.100", default-features = false }
9494

9595
# local crates that aren't published to crates.io. These should not have versions.
9696

@@ -105,10 +105,10 @@ arrayvec = "0.7.4"
105105
bitflags = "2.4.1"
106106
cargo_metadata = "0.18.1"
107107
camino = "1.1.6"
108-
chalk-solve = { version = "0.99.0", default-features = false }
109-
chalk-ir = "0.99.0"
110-
chalk-recursive = { version = "0.99.0", default-features = false }
111-
chalk-derive = "0.99.0"
108+
chalk-solve = { version = "0.100.0", default-features = false }
109+
chalk-ir = "0.100.0"
110+
chalk-recursive = { version = "0.100.0", default-features = false }
111+
chalk-derive = "0.100.0"
112112
crossbeam-channel = "0.5.8"
113113
dissimilar = "1.0.7"
114114
dot = "0.1.4"

src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs

+19
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ pub enum CfgAtom {
1818
KeyValue { key: Symbol, value: Symbol },
1919
}
2020

21+
impl PartialOrd for CfgAtom {
22+
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
23+
Some(self.cmp(other))
24+
}
25+
}
26+
27+
impl Ord for CfgAtom {
28+
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
29+
match (self, other) {
30+
(CfgAtom::Flag(a), CfgAtom::Flag(b)) => a.as_str().cmp(b.as_str()),
31+
(CfgAtom::Flag(_), CfgAtom::KeyValue { .. }) => std::cmp::Ordering::Less,
32+
(CfgAtom::KeyValue { .. }, CfgAtom::Flag(_)) => std::cmp::Ordering::Greater,
33+
(CfgAtom::KeyValue { key, value }, CfgAtom::KeyValue { key: key2, value: value2 }) => {
34+
key.as_str().cmp(key2.as_str()).then(value.as_str().cmp(value2.as_str()))
35+
}
36+
}
37+
}
38+
}
39+
2140
impl fmt::Display for CfgAtom {
2241
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2342
match self {

0 commit comments

Comments
 (0)