Skip to content

Commit 617aad8

Browse files
committed
Auto merge of #137523 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents bb029a1 + 6d9b9c1 commit 617aad8

Some content is hidden

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

69 files changed

+718
-498
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
- os: windows-latest
3535
target: aarch64-pc-windows-msvc
3636
code-target: win32-arm64
37-
- os: ubuntu-20.04
37+
- os: ubuntu-latest
3838
target: x86_64-unknown-linux-gnu
3939
code-target: linux-x64
4040
container: rockylinux:8
41-
- os: ubuntu-20.04
41+
- os: ubuntu-latest
4242
target: aarch64-unknown-linux-gnu
4343
code-target: linux-arm64
44-
- os: ubuntu-20.04
44+
- os: ubuntu-latest
4545
target: arm-unknown-linux-gnueabihf
4646
code-target: linux-armhf
4747
- os: macos-13

src/tools/rust-analyzer/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for your interest in contributing to rust-analyzer! There are many way
44
and we appreciate all of them.
55

66
To get a quick overview of the crates and structure of the project take a look at the
7-
[./docs/dev](./docs/dev) folder.
7+
[Contributing](https://rust-analyzer.github.io/book/contributing) section of the manual.
88

99
If you have any questions please ask them in the [rust-analyzer zulip stream](
1010
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer) or if unsure where

src/tools/rust-analyzer/Cargo.lock

+30-21
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ dependencies = [
559559
"intern",
560560
"itertools",
561561
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
562-
"limit",
563562
"mbe",
564563
"ra-ap-rustc_abi",
564+
"ra-ap-rustc_hashes",
565565
"ra-ap-rustc_parse_format",
566566
"rustc-hash 2.0.0",
567567
"rustc_apfloat",
@@ -591,7 +591,6 @@ dependencies = [
591591
"intern",
592592
"itertools",
593593
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
594-
"limit",
595594
"mbe",
596595
"parser",
597596
"rustc-hash 2.0.0",
@@ -626,11 +625,11 @@ dependencies = [
626625
"intern",
627626
"itertools",
628627
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
629-
"limit",
630628
"nohash-hasher",
631629
"oorandom",
632630
"project-model",
633631
"ra-ap-rustc_abi",
632+
"ra-ap-rustc_hashes",
634633
"ra-ap-rustc_index",
635634
"ra-ap-rustc_pattern_analysis",
636635
"rustc-hash 2.0.0",
@@ -744,7 +743,6 @@ dependencies = [
744743
"hir",
745744
"indexmap",
746745
"itertools",
747-
"limit",
748746
"line-index 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
749747
"memchr",
750748
"nohash-hasher",
@@ -943,10 +941,6 @@ dependencies = [
943941
"redox_syscall",
944942
]
945943

946-
[[package]]
947-
name = "limit"
948-
version = "0.0.0"
949-
950944
[[package]]
951945
name = "line-index"
952946
version = "0.1.2"
@@ -1279,7 +1273,6 @@ dependencies = [
12791273
"drop_bomb",
12801274
"edition",
12811275
"expect-test",
1282-
"limit",
12831276
"ra-ap-rustc_lexer",
12841277
"stdx",
12851278
"tracing",
@@ -1514,30 +1507,40 @@ dependencies = [
15141507

15151508
[[package]]
15161509
name = "ra-ap-rustc_abi"
1517-
version = "0.95.0"
1510+
version = "0.97.0"
15181511
source = "registry+https://github.com/rust-lang/crates.io-index"
1519-
checksum = "b40c4e339b71a8f075a829b1acaf32f870a11b466d9b8623d50b0ce33e65af95"
1512+
checksum = "3829c3355d1681ffeaf1450ec71edcdace6820fe2e86469d8fc1ad45e2c96460"
15201513
dependencies = [
15211514
"bitflags 2.7.0",
1515+
"ra-ap-rustc_hashes",
15221516
"ra-ap-rustc_index",
15231517
"tracing",
15241518
]
15251519

1520+
[[package]]
1521+
name = "ra-ap-rustc_hashes"
1522+
version = "0.97.0"
1523+
source = "registry+https://github.com/rust-lang/crates.io-index"
1524+
checksum = "1bd4d6d4c434bec08e02370a4f64a4985312097215a62e82d0f757f3a98e502e"
1525+
dependencies = [
1526+
"rustc-stable-hash",
1527+
]
1528+
15261529
[[package]]
15271530
name = "ra-ap-rustc_index"
1528-
version = "0.95.0"
1531+
version = "0.97.0"
15291532
source = "registry+https://github.com/rust-lang/crates.io-index"
1530-
checksum = "872072e2ba11d11147ebe9fde1608fe7f7d9b5c51dac524af28ee07c6dade468"
1533+
checksum = "bad6fc4bd7522e31096e2de5b0351144fe0684b608791ee26c842bf2da1b19ae"
15311534
dependencies = [
15321535
"ra-ap-rustc_index_macros",
15331536
"smallvec",
15341537
]
15351538

15361539
[[package]]
15371540
name = "ra-ap-rustc_index_macros"
1538-
version = "0.95.0"
1541+
version = "0.97.0"
15391542
source = "registry+https://github.com/rust-lang/crates.io-index"
1540-
checksum = "ffcd77debcaf2ad690a57c2d041c11eb33fe66869754b2c5f35c52954b46af0c"
1543+
checksum = "cfb234e1f84b92be45276c3025bee18789e9bc95bec8789bec961e78edb01c52"
15411544
dependencies = [
15421545
"proc-macro2",
15431546
"quote",
@@ -1546,9 +1549,9 @@ dependencies = [
15461549

15471550
[[package]]
15481551
name = "ra-ap-rustc_lexer"
1549-
version = "0.95.0"
1552+
version = "0.97.0"
15501553
source = "registry+https://github.com/rust-lang/crates.io-index"
1551-
checksum = "49265cdf8823f8d246e476c79c60bd6e5b551c81ae76e1c8d6a5e0dc73df0bca"
1554+
checksum = "7a3a40bd11dc43d1cb110e730b80620cf8102f4cca8920a02b65954da0ed931f"
15521555
dependencies = [
15531556
"memchr",
15541557
"unicode-properties",
@@ -1557,19 +1560,19 @@ dependencies = [
15571560

15581561
[[package]]
15591562
name = "ra-ap-rustc_parse_format"
1560-
version = "0.95.0"
1563+
version = "0.97.0"
15611564
source = "registry+https://github.com/rust-lang/crates.io-index"
1562-
checksum = "b3da239fdc971176de0db45cb631d71475b52033a3d0027d91964da7be89eee6"
1565+
checksum = "5feb877478994cb4c0c0c7a5116a352eefc0634aefc8636feb00a893fa5b7135"
15631566
dependencies = [
15641567
"ra-ap-rustc_index",
15651568
"ra-ap-rustc_lexer",
15661569
]
15671570

15681571
[[package]]
15691572
name = "ra-ap-rustc_pattern_analysis"
1570-
version = "0.95.0"
1573+
version = "0.97.0"
15711574
source = "registry+https://github.com/rust-lang/crates.io-index"
1572-
checksum = "56057d08fdfa0d95494e461bbdd5d4b3fdb349cca6be05ad7759bc964be1b8d4"
1575+
checksum = "a76774d35934d464c4115908cde16f76a4f7e540fe1eea6b79336c556e37bdd3"
15731576
dependencies = [
15741577
"ra-ap-rustc_index",
15751578
"rustc-hash 2.0.0",
@@ -1744,6 +1747,12 @@ version = "2.0.0"
17441747
source = "registry+https://github.com/rust-lang/crates.io-index"
17451748
checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
17461749

1750+
[[package]]
1751+
name = "rustc-stable-hash"
1752+
version = "0.1.1"
1753+
source = "registry+https://github.com/rust-lang/crates.io-index"
1754+
checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1"
1755+
17471756
[[package]]
17481757
name = "rustc_apfloat"
17491758
version = "0.2.1+llvm-462a31f5a5ab"

src/tools/rust-analyzer/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ ide-db = { path = "./crates/ide-db", version = "0.0.0" }
6464
ide-diagnostics = { path = "./crates/ide-diagnostics", version = "0.0.0" }
6565
ide-ssr = { path = "./crates/ide-ssr", version = "0.0.0" }
6666
intern = { path = "./crates/intern", version = "0.0.0" }
67-
limit = { path = "./crates/limit", version = "0.0.0" }
6867
load-cargo = { path = "./crates/load-cargo", version = "0.0.0" }
6968
mbe = { path = "./crates/mbe", version = "0.0.0" }
7069
parser = { path = "./crates/parser", version = "0.0.0" }
@@ -87,11 +86,12 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8786
vfs = { path = "./crates/vfs", version = "0.0.0" }
8887
edition = { path = "./crates/edition", version = "0.0.0" }
8988

90-
ra-ap-rustc_lexer = { version = "0.95", default-features = false }
91-
ra-ap-rustc_parse_format = { version = "0.95", default-features = false }
92-
ra-ap-rustc_index = { version = "0.95", default-features = false }
93-
ra-ap-rustc_abi = { version = "0.95", default-features = false }
94-
ra-ap-rustc_pattern_analysis = { version = "0.95", default-features = false }
89+
ra-ap-rustc_hashes = { version = "0.97", default-features = false }
90+
ra-ap-rustc_lexer = { version = "0.97", default-features = false }
91+
ra-ap-rustc_parse_format = { version = "0.97", default-features = false }
92+
ra-ap-rustc_index = { version = "0.97", default-features = false }
93+
ra-ap-rustc_abi = { version = "0.97", default-features = false }
94+
ra-ap-rustc_pattern_analysis = { version = "0.97", default-features = false }
9595

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

src/tools/rust-analyzer/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ https://rust-analyzer.github.io/book/installation.html
1414
## Documentation
1515

1616
If you want to **contribute** to rust-analyzer check out the [CONTRIBUTING.md](./CONTRIBUTING.md) or
17-
if you are just curious about how things work under the hood, check the [./docs/dev](./docs/dev)
18-
folder.
17+
if you are just curious about how things work under the hood, see the
18+
[Contributing](https://rust-analyzer.github.io/book/contributing) section of the manual.
1919

2020
If you want to **use** rust-analyzer's language server with your editor of
2121
choice, check [the manual](https://rust-analyzer.github.io/book/).

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

+26-11
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ pub struct CrateData {
296296
pub dependencies: Vec<Dependency>,
297297
pub origin: CrateOrigin,
298298
pub is_proc_macro: bool,
299+
/// The working directory to run proc-macros in. This is the workspace root of the cargo workspace
300+
/// for workspace members, the crate manifest dir otherwise.
301+
pub proc_macro_cwd: Option<AbsPathBuf>,
299302
}
300303

301304
#[derive(Default, Clone, PartialEq, Eq)]
@@ -360,8 +363,9 @@ impl CrateGraph {
360363
cfg_options: Arc<CfgOptions>,
361364
potential_cfg_options: Option<Arc<CfgOptions>>,
362365
mut env: Env,
363-
is_proc_macro: bool,
364366
origin: CrateOrigin,
367+
is_proc_macro: bool,
368+
proc_macro_cwd: Option<AbsPathBuf>,
365369
) -> CrateId {
366370
env.entries.shrink_to_fit();
367371
let data = CrateData {
@@ -375,6 +379,7 @@ impl CrateGraph {
375379
dependencies: Vec::new(),
376380
origin,
377381
is_proc_macro,
382+
proc_macro_cwd,
378383
};
379384
self.arena.alloc(data)
380385
}
@@ -698,8 +703,9 @@ mod tests {
698703
Default::default(),
699704
Default::default(),
700705
Env::default(),
701-
false,
702706
CrateOrigin::Local { repo: None, name: None },
707+
false,
708+
None,
703709
);
704710
let crate2 = graph.add_crate_root(
705711
FileId::from_raw(2u32),
@@ -709,8 +715,9 @@ mod tests {
709715
Default::default(),
710716
Default::default(),
711717
Env::default(),
712-
false,
713718
CrateOrigin::Local { repo: None, name: None },
719+
false,
720+
None,
714721
);
715722
let crate3 = graph.add_crate_root(
716723
FileId::from_raw(3u32),
@@ -720,8 +727,9 @@ mod tests {
720727
Default::default(),
721728
Default::default(),
722729
Env::default(),
723-
false,
724730
CrateOrigin::Local { repo: None, name: None },
731+
false,
732+
None,
725733
);
726734
assert!(graph
727735
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2,))
@@ -745,8 +753,9 @@ mod tests {
745753
Default::default(),
746754
Default::default(),
747755
Env::default(),
748-
false,
749756
CrateOrigin::Local { repo: None, name: None },
757+
false,
758+
None,
750759
);
751760
let crate2 = graph.add_crate_root(
752761
FileId::from_raw(2u32),
@@ -756,8 +765,9 @@ mod tests {
756765
Default::default(),
757766
Default::default(),
758767
Env::default(),
759-
false,
760768
CrateOrigin::Local { repo: None, name: None },
769+
false,
770+
None,
761771
);
762772
assert!(graph
763773
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2,))
@@ -778,8 +788,9 @@ mod tests {
778788
Default::default(),
779789
Default::default(),
780790
Env::default(),
781-
false,
782791
CrateOrigin::Local { repo: None, name: None },
792+
false,
793+
None,
783794
);
784795
let crate2 = graph.add_crate_root(
785796
FileId::from_raw(2u32),
@@ -789,8 +800,9 @@ mod tests {
789800
Default::default(),
790801
Default::default(),
791802
Env::default(),
792-
false,
793803
CrateOrigin::Local { repo: None, name: None },
804+
false,
805+
None,
794806
);
795807
let crate3 = graph.add_crate_root(
796808
FileId::from_raw(3u32),
@@ -800,8 +812,9 @@ mod tests {
800812
Default::default(),
801813
Default::default(),
802814
Env::default(),
803-
false,
804815
CrateOrigin::Local { repo: None, name: None },
816+
false,
817+
None,
805818
);
806819
assert!(graph
807820
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2,))
@@ -822,8 +835,9 @@ mod tests {
822835
Default::default(),
823836
Default::default(),
824837
Env::default(),
825-
false,
826838
CrateOrigin::Local { repo: None, name: None },
839+
false,
840+
None,
827841
);
828842
let crate2 = graph.add_crate_root(
829843
FileId::from_raw(2u32),
@@ -833,8 +847,9 @@ mod tests {
833847
Default::default(),
834848
Default::default(),
835849
Env::default(),
836-
false,
837850
CrateOrigin::Local { repo: None, name: None },
851+
false,
852+
None,
838853
);
839854
assert!(graph
840855
.add_dep(

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hash::FxHashMap;
1010
use span::EditionedFileId;
1111
use syntax::{ast, Parse, SourceFile, SyntaxError};
1212
use triomphe::Arc;
13-
use vfs::{AbsPathBuf, FileId};
13+
use vfs::FileId;
1414

1515
pub use crate::{
1616
change::FileChange,
@@ -85,8 +85,6 @@ pub trait SourceDatabase: FileLoader + std::fmt::Debug {
8585
/// Crate related data shared by the whole workspace.
8686
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
8787
pub struct CrateWorkspaceData {
88-
/// The working directory to run proc-macros in. This is usually the workspace root of cargo workspaces.
89-
pub proc_macro_cwd: Option<AbsPathBuf>,
9088
// FIXME: Consider removing this, making HirDatabase::target_data_layout an input query
9189
pub data_layout: TargetLayoutLoadResult,
9290
/// Toolchain version used to compile the crate.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ triomphe.workspace = true
3131
rustc_apfloat = "0.2.0"
3232
text-size.workspace = true
3333

34+
ra-ap-rustc_hashes.workspace = true
3435
ra-ap-rustc_parse_format.workspace = true
3536
ra-ap-rustc_abi.workspace = true
3637

@@ -43,7 +44,6 @@ hir-expand.workspace = true
4344
mbe.workspace = true
4445
cfg.workspace = true
4546
tt.workspace = true
46-
limit.workspace = true
4747
span.workspace = true
4848

4949

0 commit comments

Comments
 (0)