Skip to content

Commit d6d6d19

Browse files
committed
Auto merge of #137523 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents 849a2bb + b766506 commit d6d6d19

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

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
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

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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

Cargo.lock

Lines changed: 30 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
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

README.md

Lines changed: 2 additions & 2 deletions
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/).

crates/base-db/src/input.rs

Lines changed: 26 additions & 11 deletions
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(

crates/base-db/src/lib.rs

Lines changed: 1 addition & 3 deletions
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.

crates/hir-def/Cargo.toml

Lines changed: 1 addition & 1 deletion
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)