Skip to content

Commit 520aad1

Browse files
committed
Merge commit 'd6afb4fa239fe7b5b34e5cefa9e58148fdff65b8' into sync-from-ra
2 parents 616e379 + d6afb4f commit 520aad1

File tree

158 files changed

+8424
-2199
lines changed

Some content is hidden

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

158 files changed

+8424
-2199
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches:
99
- auto
1010
- try
11+
- automation/bors/try
1112

1213
env:
1314
CARGO_INCREMENTAL: 0
@@ -84,6 +85,7 @@ jobs:
8485
run: cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
8586

8687
- name: Test
88+
if: matrix.os == 'ubuntu-latest' || github.event_name == 'push'
8789
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
8890

8991
- name: Switch to stable toolchain

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,14 @@ jobs:
140140

141141
- name: Combine json
142142
run: |
143-
git clone --depth 1 https://$METRICS_TOKEN@github.com/rust-analyzer/metrics.git
143+
mkdir ~/.ssh
144+
echo "${{ secrets.METRICS_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
145+
chmod 600 ~/.ssh/id_ed25519
146+
chmod 700 ~/.ssh
147+
148+
git clone --depth 1 git@github.com:rust-analyzer/metrics.git
144149
jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
145150
cd metrics
146151
git add .
147152
git -c user.name=Bot -c user.email=dummy@example.com commit --message 📈
148153
git push origin master
149-
env:
150-
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}

src/tools/rust-analyzer/Cargo.lock

+43-50
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ version = "1.0.71"
3232
source = "registry+https://github.com/rust-lang/crates.io-index"
3333
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
3434

35-
[[package]]
36-
name = "anymap"
37-
version = "1.0.0-beta.2"
38-
source = "registry+https://github.com/rust-lang/crates.io-index"
39-
checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72"
40-
4135
[[package]]
4236
name = "arbitrary"
4337
version = "1.3.0"
@@ -177,9 +171,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
177171

178172
[[package]]
179173
name = "chalk-derive"
180-
version = "0.92.0"
174+
version = "0.93.0"
181175
source = "registry+https://github.com/rust-lang/crates.io-index"
182-
checksum = "ff5053a8a42dbff5279a82423946fc56dc1253b76cf211b2b3c14b3aad4e1281"
176+
checksum = "264726159011fc7f22c23eb51f49021ece6e71bc358b96e7f2e842db0b14162b"
183177
dependencies = [
184178
"proc-macro2",
185179
"quote",
@@ -189,9 +183,9 @@ dependencies = [
189183

190184
[[package]]
191185
name = "chalk-ir"
192-
version = "0.92.0"
186+
version = "0.93.0"
193187
source = "registry+https://github.com/rust-lang/crates.io-index"
194-
checksum = "8a56de2146a8ed0fcd54f4bd50db852f1de4eac9e1efe568494f106c21b77d2a"
188+
checksum = "d65c17407d4c756b8f7f84344acb0fb96364d0298822743219bb25769b6d00df"
195189
dependencies = [
196190
"bitflags 1.3.2",
197191
"chalk-derive",
@@ -200,9 +194,9 @@ dependencies = [
200194

201195
[[package]]
202196
name = "chalk-recursive"
203-
version = "0.92.0"
197+
version = "0.93.0"
204198
source = "registry+https://github.com/rust-lang/crates.io-index"
205-
checksum = "5cc09e6e9531f3544989ef89b189e80fbc7ad9e2f73f1c5e03ddc9ffb0527463"
199+
checksum = "80e2cf7b70bedaaf3a8cf3c93b6120c2bb65be89389124028e724d19e209686e"
206200
dependencies = [
207201
"chalk-derive",
208202
"chalk-ir",
@@ -213,9 +207,9 @@ dependencies = [
213207

214208
[[package]]
215209
name = "chalk-solve"
216-
version = "0.92.0"
210+
version = "0.93.0"
217211
source = "registry+https://github.com/rust-lang/crates.io-index"
218-
checksum = "b392e02b4c81ec76d3748da839fc70a5539b83d27c9030668463d34d5110b860"
212+
checksum = "afc67c548d3854f64e97e67dc5b7c88513425c5bfa347cff96b7992ae6379288"
219213
dependencies = [
220214
"chalk-derive",
221215
"chalk-ir",
@@ -518,7 +512,6 @@ dependencies = [
518512
name = "hir-def"
519513
version = "0.0.0"
520514
dependencies = [
521-
"anymap",
522515
"arrayvec",
523516
"base-db",
524517
"bitflags 2.3.2",
@@ -531,8 +524,6 @@ dependencies = [
531524
"fst",
532525
"hashbrown 0.12.3",
533526
"hir-expand",
534-
"hkalbasi-rustc-ap-rustc_abi",
535-
"hkalbasi-rustc-ap-rustc_index",
536527
"indexmap 2.0.0",
537528
"intern",
538529
"itertools",
@@ -541,7 +532,7 @@ dependencies = [
541532
"mbe",
542533
"once_cell",
543534
"profile",
544-
"ra-ap-rustc_parse_format",
535+
"rustc-dependencies",
545536
"rustc-hash",
546537
"smallvec",
547538
"stdx",
@@ -594,7 +585,6 @@ dependencies = [
594585
"expect-test",
595586
"hir-def",
596587
"hir-expand",
597-
"hkalbasi-rustc-ap-rustc_index",
598588
"intern",
599589
"itertools",
600590
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -604,6 +594,7 @@ dependencies = [
604594
"oorandom",
605595
"profile",
606596
"project-model",
597+
"rustc-dependencies",
607598
"rustc-hash",
608599
"scoped-tls",
609600
"smallvec",
@@ -617,27 +608,6 @@ dependencies = [
617608
"typed-arena",
618609
]
619610

620-
[[package]]
621-
name = "hkalbasi-rustc-ap-rustc_abi"
622-
version = "0.0.20221221"
623-
source = "registry+https://github.com/rust-lang/crates.io-index"
624-
checksum = "adabaadad9aa7576f97af02241cdf5554d62fb3d51a84cb05d77ba28edd3013f"
625-
dependencies = [
626-
"bitflags 1.3.2",
627-
"hkalbasi-rustc-ap-rustc_index",
628-
"tracing",
629-
]
630-
631-
[[package]]
632-
name = "hkalbasi-rustc-ap-rustc_index"
633-
version = "0.0.20221221"
634-
source = "registry+https://github.com/rust-lang/crates.io-index"
635-
checksum = "f4d3c48474e09afb0f5efbd6f758e05411699301a113c47d454d28ec7059d00e"
636-
dependencies = [
637-
"arrayvec",
638-
"smallvec",
639-
]
640-
641611
[[package]]
642612
name = "home"
643613
version = "0.5.5"
@@ -918,9 +888,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
918888

919889
[[package]]
920890
name = "libc"
921-
version = "0.2.146"
891+
version = "0.2.148"
922892
source = "registry+https://github.com/rust-lang/crates.io-index"
923-
checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
893+
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
924894

925895
[[package]]
926896
name = "libloading"
@@ -1277,7 +1247,7 @@ dependencies = [
12771247
"drop_bomb",
12781248
"expect-test",
12791249
"limit",
1280-
"ra-ap-rustc_lexer",
1250+
"rustc-dependencies",
12811251
"sourcegen",
12821252
"stdx",
12831253
]
@@ -1482,31 +1452,42 @@ dependencies = [
14821452
"proc-macro2",
14831453
]
14841454

1455+
[[package]]
1456+
name = "ra-ap-rustc_abi"
1457+
version = "0.14.0"
1458+
source = "registry+https://github.com/rust-lang/crates.io-index"
1459+
checksum = "a51b7a02377b3246ec5c095b852b5cf1678bd9ed6b572b2a79efbf7ad711c292"
1460+
dependencies = [
1461+
"bitflags 1.3.2",
1462+
"ra-ap-rustc_index",
1463+
"tracing",
1464+
]
1465+
14851466
[[package]]
14861467
name = "ra-ap-rustc_index"
1487-
version = "0.10.0"
1468+
version = "0.14.0"
14881469
source = "registry+https://github.com/rust-lang/crates.io-index"
1489-
checksum = "07b5fa61d34da18e148dc3a81f654488ea07f40938d8aefb17f8b64bb78c6120"
1470+
checksum = "643ca3609870b1778d9cd1f2a8e4ccb4af0f48f3637cc257a09494d087bd93dc"
14901471
dependencies = [
14911472
"arrayvec",
14921473
"smallvec",
14931474
]
14941475

14951476
[[package]]
14961477
name = "ra-ap-rustc_lexer"
1497-
version = "0.10.0"
1478+
version = "0.14.0"
14981479
source = "registry+https://github.com/rust-lang/crates.io-index"
1499-
checksum = "f2e2f6b48422e4eed5218277ab7cc9733e60dd8f3167f4f36a49a0cafe4dc195"
1480+
checksum = "30ffd24f9ba4f1d25ff27ca1469b8d22a3bdfb12cf644fc8bfcb63121fa5da6b"
15001481
dependencies = [
15011482
"unicode-properties",
15021483
"unicode-xid",
15031484
]
15041485

15051486
[[package]]
15061487
name = "ra-ap-rustc_parse_format"
1507-
version = "0.10.0"
1488+
version = "0.14.0"
15081489
source = "registry+https://github.com/rust-lang/crates.io-index"
1509-
checksum = "c3c7369ad01cc79f9e3513c9f6a6326f6b980100e4862a7ac71b9991c88108bb"
1490+
checksum = "207b5ac1a21d4926695e03b605ffb9f63d4968e0488e9197c04c512c37303aa7"
15101491
dependencies = [
15111492
"ra-ap-rustc_index",
15121493
"ra-ap-rustc_lexer",
@@ -1594,10 +1575,12 @@ dependencies = [
15941575
"oorandom",
15951576
"parking_lot 0.12.1",
15961577
"parking_lot_core 0.9.6",
1578+
"parser",
15971579
"proc-macro-api",
15981580
"profile",
15991581
"project-model",
16001582
"rayon",
1583+
"rustc-dependencies",
16011584
"rustc-hash",
16021585
"scip",
16031586
"serde",
@@ -1626,6 +1609,16 @@ version = "0.1.23"
16261609
source = "registry+https://github.com/rust-lang/crates.io-index"
16271610
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
16281611

1612+
[[package]]
1613+
name = "rustc-dependencies"
1614+
version = "0.0.0"
1615+
dependencies = [
1616+
"ra-ap-rustc_abi",
1617+
"ra-ap-rustc_index",
1618+
"ra-ap-rustc_lexer",
1619+
"ra-ap-rustc_parse_format",
1620+
]
1621+
16291622
[[package]]
16301623
name = "rustc-hash"
16311624
version = "1.1.0"
@@ -1853,9 +1846,9 @@ dependencies = [
18531846
"proc-macro2",
18541847
"profile",
18551848
"quote",
1856-
"ra-ap-rustc_lexer",
18571849
"rayon",
18581850
"rowan",
1851+
"rustc-dependencies",
18591852
"rustc-hash",
18601853
"smol_str",
18611854
"sourcegen",

src/tools/rust-analyzer/Cargo.toml

+4-8
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ toolchain = { path = "./crates/toolchain", version = "0.0.0" }
7979
tt = { path = "./crates/tt", version = "0.0.0" }
8080
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8181
vfs = { path = "./crates/vfs", version = "0.0.0" }
82+
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
8283

8384
# local crates that aren't published to crates.io. These should not have versions.
8485
proc-macro-test = { path = "./crates/proc-macro-test" }
@@ -101,11 +102,6 @@ serde = { version = "1.0.156", features = ["derive"] }
101102
serde_json = "1.0.96"
102103
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
103104
# can't upgrade due to dashmap depending on 0.12.3 currently
104-
hashbrown = { version = "0.12.3", features = ["inline-more"], default-features = false }
105-
106-
rustc_lexer = { version = "0.10.0", package = "ra-ap-rustc_lexer" }
107-
rustc_parse_format = { version = "0.10.0", package = "ra-ap-rustc_parse_format", default-features = false }
108-
109-
# Upstream broke this for us so we can't update it
110-
rustc_abi = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_abi", default-features = false }
111-
rustc_index = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_index", default-features = false }
105+
hashbrown = { version = "0.12.3", features = [
106+
"inline-more",
107+
], default-features = false }

src/tools/rust-analyzer/crates/base-db/src/input.rs

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ pub trait ProcMacroExpander: fmt::Debug + Send + Sync + RefUnwindSafe {
257257
) -> Result<Subtree, ProcMacroExpansionError>;
258258
}
259259

260+
#[derive(Debug)]
260261
pub enum ProcMacroExpansionError {
261262
Panic(String),
262263
/// Things like "proc macro server was killed by OOM".

src/tools/rust-analyzer/crates/flycheck/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub enum FlycheckConfig {
5050
extra_args: Vec<String>,
5151
extra_env: FxHashMap<String, String>,
5252
ansi_color_output: bool,
53+
target_dir: Option<PathBuf>,
5354
},
5455
CustomCommand {
5556
command: String,
@@ -308,6 +309,7 @@ impl FlycheckActor {
308309
features,
309310
extra_env,
310311
ansi_color_output,
312+
target_dir,
311313
} => {
312314
let mut cmd = Command::new(toolchain::cargo());
313315
cmd.arg(command);
@@ -340,6 +342,9 @@ impl FlycheckActor {
340342
cmd.arg(features.join(" "));
341343
}
342344
}
345+
if let Some(target_dir) = target_dir {
346+
cmd.arg("--target-dir").arg(target_dir);
347+
}
343348
cmd.envs(extra_env);
344349
(cmd, extra_args)
345350
}

src/tools/rust-analyzer/crates/hir-def/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ rust-version.workspace = true
1212
doctest = false
1313

1414
[dependencies]
15-
anymap = "1.0.0-beta.2"
1615
arrayvec = "0.7.2"
1716
bitflags = "2.1.0"
1817
cov-mark = "2.0.0-pre.1"
@@ -31,10 +30,7 @@ smallvec.workspace = true
3130
hashbrown.workspace = true
3231
triomphe.workspace = true
3332

34-
rustc_abi.workspace = true
35-
rustc_index.workspace = true
36-
rustc_parse_format.workspace = true
37-
33+
rustc-dependencies.workspace = true
3834

3935
# local deps
4036
stdx.workspace = true
@@ -48,8 +44,12 @@ cfg.workspace = true
4844
tt.workspace = true
4945
limit.workspace = true
5046

47+
5148
[dev-dependencies]
5249
expect-test = "1.4.0"
5350

5451
# local deps
5552
test-utils.workspace = true
53+
54+
[features]
55+
in-rust-tree = ["rustc-dependencies/in-rust-tree"]

src/tools/rust-analyzer/crates/hir-def/src/attr.rs

+4
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ impl Attrs {
215215
self.doc_exprs().flat_map(|doc_expr| doc_expr.aliases().to_vec())
216216
}
217217

218+
pub fn export_name(&self) -> Option<&SmolStr> {
219+
self.by_key("export_name").string_value()
220+
}
221+
218222
pub fn is_proc_macro(&self) -> bool {
219223
self.by_key("proc_macro").exists()
220224
}

0 commit comments

Comments
 (0)