Skip to content

Commit 6e66342

Browse files
authored
Merge pull request #1853 from Kobzol/pull-fixed
Perform the first rustc pull.. for the second time
2 parents 7cb1248 + ecb76fa commit 6e66342

File tree

212 files changed

+3548
-1530
lines changed

Some content is hidden

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

212 files changed

+3548
-1530
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ env:
1717
RUST_BACKTRACE: short
1818
RUSTUP_MAX_RETRIES: 10
1919

20+
defaults:
21+
run:
22+
shell: bash
23+
2024
jobs:
2125
changes:
2226
runs-on: ubuntu-latest
@@ -80,6 +84,7 @@ jobs:
8084
CC: deny_c
8185

8286
strategy:
87+
fail-fast: false
8388
matrix:
8489
os: [ubuntu-latest, windows-latest, macos-latest]
8590

@@ -99,7 +104,7 @@ jobs:
99104
rustup toolchain install nightly --profile minimal --component rustfmt
100105
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
101106
- name: Install Rust Problem Matcher
102-
if: matrix.os == 'ubuntu-latest'
107+
if: matrix.os == 'macos-latest'
103108
run: echo "::add-matcher::.github/rust.json"
104109

105110
# - name: Cache Dependencies
@@ -116,23 +121,9 @@ jobs:
116121
if: matrix.os == 'ubuntu-latest'
117122
run: cargo codegen --check
118123

119-
- name: Compile tests
120-
run: cargo test --no-run
121-
122124
- name: Run tests
123125
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail
124126

125-
- name: Cancel parallel jobs
126-
if: failure()
127-
run: |
128-
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
129-
curl -L \
130-
-X POST \
131-
-H "Accept: application/vnd.github.v3+json" \
132-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
133-
-H "X-GitHub-Api-Version: 2022-11-28" \
134-
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
135-
136127
- name: Run Clippy
137128
if: matrix.os == 'macos-latest'
138129
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
@@ -333,3 +324,21 @@ jobs:
333324
jq -C <<< '${{ toJson(needs) }}'
334325
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
335326
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
327+
328+
cancel-if-matrix-failed:
329+
needs: rust
330+
if: ${{ always() }}
331+
runs-on: ubuntu-latest
332+
steps:
333+
- name: Cancel parallel jobs
334+
run: |
335+
if jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'; then
336+
exit 0
337+
fi
338+
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
339+
curl -L \
340+
-X POST \
341+
-H "Accept: application/vnd.github.v3+json" \
342+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
343+
-H "X-GitHub-Api-Version: 2022-11-28" \
344+
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ jobs:
134134

135135
- name: Run analysis-stats on rust-analyzer
136136
if: matrix.target == 'x86_64-unknown-linux-gnu'
137-
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats .
137+
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats . -q
138138

139139
- name: Run analysis-stats on rust std library
140140
if: matrix.target == 'x86_64-unknown-linux-gnu'
141141
env:
142142
RUSTC_BOOTSTRAP: 1
143-
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
143+
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std -q
144144

145145
- name: Upload artifacts
146146
uses: actions/upload-artifact@v4

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ debug = 2
4949
# ungrammar = { path = "../ungrammar" }
5050

5151
# salsa = { path = "../salsa" }
52+
# salsa-macros = { path = "../salsa/components/salsa-macros" }
53+
# salsa-macro-rules = { path = "../salsa/components/salsa-macro-rules" }
5254

5355
[workspace.dependencies]
5456
# local crates
@@ -136,14 +138,14 @@ rayon = "1.10.0"
136138
rowan = "=0.15.15"
137139
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
138140
# on impls without it
139-
salsa = { version = "0.22.0", default-features = true, features = ["rayon","salsa_unstable", "macros"] }
140-
salsa-macros = "0.22.0"
141+
salsa = { version = "0.23.0", default-features = true, features = ["rayon","salsa_unstable", "macros"] }
142+
salsa-macros = "0.23.0"
141143
semver = "1.0.26"
142144
serde = { version = "1.0.219" }
143145
serde_derive = { version = "1.0.219" }
144146
serde_json = "1.0.140"
145147
rustc-hash = "2.1.1"
146-
rustc-literal-escaper = "0.0.3"
148+
rustc-literal-escaper = "0.0.4"
147149
smallvec = { version = "1.15.1", features = [
148150
"const_new",
149151
"union",

crates/base-db/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13+
doctest = false
1314

1415
[dependencies]
1516
la-arena.workspace = true

crates/base-db/src/input.rs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how
77
//! actual IO is done and lowered to input.
88
9+
use std::error::Error;
910
use std::hash::BuildHasherDefault;
1011
use std::{fmt, mem, ops};
1112

@@ -22,7 +23,49 @@ use vfs::{AbsPathBuf, AnchoredPath, FileId, VfsPath, file_set::FileSet};
2223

2324
use crate::{CrateWorkspaceData, EditionedFileId, FxIndexSet, RootQueryDb};
2425

25-
pub type ProcMacroPaths = FxHashMap<CrateBuilderId, Result<(String, AbsPathBuf), String>>;
26+
pub type ProcMacroPaths =
27+
FxHashMap<CrateBuilderId, Result<(String, AbsPathBuf), ProcMacroLoadingError>>;
28+
29+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
30+
pub enum ProcMacroLoadingError {
31+
Disabled,
32+
FailedToBuild,
33+
MissingDylibPath,
34+
NotYetBuilt,
35+
NoProcMacros,
36+
ProcMacroSrvError(Box<str>),
37+
}
38+
impl ProcMacroLoadingError {
39+
pub fn is_hard_error(&self) -> bool {
40+
match self {
41+
ProcMacroLoadingError::Disabled | ProcMacroLoadingError::NotYetBuilt => false,
42+
ProcMacroLoadingError::FailedToBuild
43+
| ProcMacroLoadingError::MissingDylibPath
44+
| ProcMacroLoadingError::NoProcMacros
45+
| ProcMacroLoadingError::ProcMacroSrvError(_) => true,
46+
}
47+
}
48+
}
49+
50+
impl Error for ProcMacroLoadingError {}
51+
impl fmt::Display for ProcMacroLoadingError {
52+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
53+
match self {
54+
ProcMacroLoadingError::Disabled => write!(f, "proc-macro expansion is disabled"),
55+
ProcMacroLoadingError::FailedToBuild => write!(f, "proc-macro failed to build"),
56+
ProcMacroLoadingError::MissingDylibPath => {
57+
write!(f, "proc-macro crate build data is missing a dylib path")
58+
}
59+
ProcMacroLoadingError::NotYetBuilt => write!(f, "proc-macro not yet built"),
60+
ProcMacroLoadingError::NoProcMacros => {
61+
write!(f, "proc macro library has no proc macros")
62+
}
63+
ProcMacroLoadingError::ProcMacroSrvError(msg) => {
64+
write!(f, "proc macro server error: {msg}")
65+
}
66+
}
67+
}
68+
}
2669

2770
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
2871
pub struct SourceRootId(pub u32);

crates/base-db/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ pub use crate::{
1414
input::{
1515
BuiltCrateData, BuiltDependency, Crate, CrateBuilder, CrateBuilderId, CrateDataBuilder,
1616
CrateDisplayName, CrateGraphBuilder, CrateName, CrateOrigin, CratesIdMap, CratesMap,
17-
DependencyBuilder, Env, ExtraCrateData, LangCrateOrigin, ProcMacroPaths, ReleaseChannel,
18-
SourceRoot, SourceRootId, TargetLayoutLoadResult, UniqueCrateData,
17+
DependencyBuilder, Env, ExtraCrateData, LangCrateOrigin, ProcMacroLoadingError,
18+
ProcMacroPaths, ReleaseChannel, SourceRoot, SourceRootId, TargetLayoutLoadResult,
19+
UniqueCrateData,
1920
},
2021
};
2122
use dashmap::{DashMap, mapref::entry::Entry};
@@ -33,7 +34,7 @@ pub type FxIndexSet<T> = indexmap::IndexSet<T, rustc_hash::FxBuildHasher>;
3334
#[macro_export]
3435
macro_rules! impl_intern_key {
3536
($id:ident, $loc:ident) => {
36-
#[salsa_macros::interned(no_lifetime)]
37+
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
3738
#[derive(PartialOrd, Ord)]
3839
pub struct $id {
3940
pub loc: $loc,
@@ -43,7 +44,7 @@ macro_rules! impl_intern_key {
4344
impl ::std::fmt::Debug for $id {
4445
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4546
f.debug_tuple(stringify!($id))
46-
.field(&format_args!("{:04x}", self.0.as_u32()))
47+
.field(&format_args!("{:04x}", self.0.index()))
4748
.finish()
4849
}
4950
}
@@ -167,7 +168,7 @@ impl Files {
167168
}
168169
}
169170

170-
#[salsa_macros::interned(no_lifetime, debug, constructor=from_span)]
171+
#[salsa_macros::interned(no_lifetime, debug, constructor=from_span, revisions = usize::MAX)]
171172
#[derive(PartialOrd, Ord)]
172173
pub struct EditionedFileId {
173174
pub editioned_file_id: span::EditionedFileId,

crates/cfg/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13+
doctest = false
1314

1415
[dependencies]
1516
rustc-hash.workspace = true

crates/hir-def/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13+
doctest = false
1314

1415
[dependencies]
1516
arrayvec.workspace = true

0 commit comments

Comments
 (0)