Skip to content

Commit 0009d9b

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref 'eda4fc7733ee' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@eda4fc7 Filtered ref: rust-lang/stdarch@3f3adc6 Upstream diff: rust-lang/rust@1396514...eda4fc7 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 02063b3 + 18005ba commit 0009d9b

146 files changed

Lines changed: 4779 additions & 1640 deletions

File tree

Some content is hidden

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

.codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
range: 40...60
3+
status:
4+
patch: off
5+
project:
6+
default:
7+
informational: true
8+
9+
# Don't leave comments on PRs
10+
comment: false

.github/workflows/ci.yaml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
ref: ${{ github.event.pull_request.head.sha }}
5151

5252
- name: Install rustup-toolchain-install-master
53-
run: cargo install rustup-toolchain-install-master@1.6.0
53+
run: cargo install rustup-toolchain-install-master@1.11.0
5454

5555
# Install a pinned rustc commit to avoid surprises
5656
- name: Install Rust toolchain
@@ -96,7 +96,7 @@ jobs:
9696
run: |
9797
rustup update --no-self-update stable
9898
rustup default stable
99-
rustup component add --toolchain stable rust-src clippy rustfmt
99+
rustup component add --toolchain stable rust-src rustfmt
100100
# We also install a nightly rustfmt, because we use `--file-lines` in
101101
# a test.
102102
rustup toolchain install nightly --profile minimal --component rustfmt
@@ -128,10 +128,6 @@ jobs:
128128
- name: Run cargo-machete
129129
run: cargo machete
130130

131-
- name: Run Clippy
132-
if: matrix.os == 'macos-latest'
133-
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
134-
135131
analysis-stats:
136132
if: github.repository == 'rust-lang/rust-analyzer'
137133
runs-on: ubuntu-latest
@@ -178,6 +174,28 @@ jobs:
178174
179175
- run: cargo fmt -- --check
180176

177+
clippy:
178+
if: github.repository == 'rust-lang/rust-analyzer'
179+
runs-on: ubuntu-latest
180+
181+
steps:
182+
- name: Checkout repository
183+
uses: actions/checkout@v4
184+
185+
# Note that clippy output is currently dependent on whether rust-src is installed,
186+
# https://github.com/rust-lang/rust-clippy/issues/14625
187+
- name: Install Rust toolchain
188+
run: |
189+
rustup update --no-self-update stable
190+
rustup default stable
191+
rustup component add --toolchain stable rust-src clippy
192+
193+
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
194+
- name: Install Rust Problem Matcher
195+
run: echo "::add-matcher::.github/rust.json"
196+
197+
- run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
198+
181199
miri:
182200
if: github.repository == 'rust-lang/rust-analyzer'
183201
runs-on: ubuntu-latest
@@ -188,8 +206,11 @@ jobs:
188206

189207
- name: Install Rust toolchain
190208
run: |
191-
rustup update --no-self-update nightly
192-
rustup default nightly
209+
# FIXME: Pin nightly due to a regression in miri on nightly-2026-02-12.
210+
# See https://github.com/rust-lang/miri/issues/4855.
211+
# Revert to plain `nightly` once this is fixed upstream.
212+
rustup toolchain install nightly-2026-02-10
213+
rustup default nightly-2026-02-10
193214
rustup component add miri
194215
195216
# - name: Cache Dependencies
@@ -205,7 +226,12 @@ jobs:
205226

206227
strategy:
207228
matrix:
208-
target: [powerpc-unknown-linux-gnu, x86_64-unknown-linux-musl, wasm32-unknown-unknown]
229+
target:
230+
[
231+
powerpc-unknown-linux-gnu,
232+
x86_64-unknown-linux-musl,
233+
wasm32-unknown-unknown,
234+
]
209235
include:
210236
# The rust-analyzer binary is not expected to compile on WASM, but the IDE
211237
# crate should
@@ -309,7 +335,18 @@ jobs:
309335
run: typos
310336

311337
conclusion:
312-
needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv, miri, rustfmt, analysis-stats]
338+
needs:
339+
[
340+
rust,
341+
rust-cross,
342+
typescript,
343+
typo-check,
344+
proc-macro-srv,
345+
miri,
346+
rustfmt,
347+
clippy,
348+
analysis-stats,
349+
]
313350
# We need to ensure this job does *not* get skipped if its dependencies fail,
314351
# because a skipped job is considered a success by GitHub. So we have to
315352
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run

.github/workflows/coverage.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Coverage
2+
3+
on: [pull_request, push]
4+
5+
env:
6+
CARGO_INCREMENTAL: 0
7+
CARGO_NET_RETRY: 10
8+
CI: 1
9+
RUST_BACKTRACE: short
10+
RUSTUP_MAX_RETRIES: 10
11+
12+
jobs:
13+
coverage:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Rust toolchain
19+
run: |
20+
rustup update --no-self-update nightly
21+
rustup default nightly
22+
rustup component add --toolchain nightly rust-src rustc-dev rustfmt
23+
# We also install a nightly rustfmt, because we use `--file-lines` in
24+
# a test.
25+
rustup toolchain install nightly --profile minimal --component rustfmt
26+
27+
rustup toolchain install nightly --component llvm-tools-preview
28+
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
32+
- name: Install nextest
33+
uses: taiki-e/install-action@nextest
34+
35+
- name: Generate code coverage
36+
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
files: lcov.info
42+
fail_ci_if_error: false
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
verbose: true

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

CLAUDE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
**Reminder: All AI usage must be disclosed in commit messages, see
2+
CONTRIBUTING.md for more details.**
3+
4+
## Build Commands
5+
6+
```bash
7+
cargo build # Build all crates
8+
cargo test # Run all tests
9+
cargo test -p <crate> # Run tests for a specific crate (e.g., cargo test -p hir-ty)
10+
cargo lint # Run clippy on all targets
11+
cargo xtask codegen # Run code generation
12+
cargo xtask tidy # Run tidy checks
13+
UPDATE_EXPECT=1 cargo test # Update test expectations (snapshot tests)
14+
RUN_SLOW_TESTS=1 cargo test # Run heavy/slow tests
15+
```
16+
17+
## Key Architectural Invariants
18+
19+
- Typing in a function body never invalidates global derived data
20+
- Parser/syntax tree is built per-file to enable parallel parsing
21+
- The server is stateless (HTTP-like); context must be re-created from request parameters
22+
- Cancellation uses salsa's cancellation mechanism; computations panic with a `Cancelled` payload
23+
24+
### Code Generation
25+
26+
Generated code is committed to the repo. Grammar and AST are generated from `ungrammar`. Run `cargo test -p xtask` after adding inline parser tests (`// test test_name` comments).
27+
28+
## Testing
29+
30+
Tests are snapshot-based using `expect-test`. Test fixtures use a mini-language:
31+
- `$0` marks cursor position
32+
- `// ^^^^` labels attach to the line above
33+
- `//- minicore: sized, fn` includes parts of minicore (minimal core library)
34+
- `//- /path/to/file.rs crate:name deps:dep1,dep2` declares files/crates
35+
36+
## Style Notes
37+
38+
- Use `stdx::never!` and `stdx::always!` instead of `assert!` for recoverable invariants
39+
- Use `T![fn]` macro instead of `SyntaxKind::FN_KW`
40+
- Use keyword name mangling over underscore prefixing for identifiers: `crate``krate`, `fn``func`, `struct``strukt`, `type``ty`

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ rayon = "1.10.0"
135135
rowan = "=0.15.17"
136136
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
137137
# on impls without it
138-
salsa = { version = "0.26", default-features = false, features = [
138+
salsa = { version = "0.25.2", default-features = false, features = [
139139
"rayon",
140140
"salsa_unstable",
141141
"macros",
142142
"inventory",
143143
] }
144-
salsa-macros = "0.26"
144+
salsa-macros = "0.25.2"
145145
semver = "1.0.26"
146146
serde = { version = "1.0.219" }
147147
serde_derive = { version = "1.0.219" }

crates/base-db/src/editioned_file_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const _: () = {
6060
}
6161
}
6262

63-
impl zalsa_::HashEqLike<WithoutCrate> for EditionedFileIdData {
63+
impl zalsa_struct_::HashEqLike<WithoutCrate> for EditionedFileIdData {
6464
#[inline]
6565
fn hash<H: Hasher>(&self, state: &mut H) {
6666
Hash::hash(self, state);

crates/base-db/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ impl CrateGraphBuilder {
742742
deps.into_iter()
743743
}
744744

745-
/// Returns all crates in the graph, sorted in topological order (ie. dependencies of a crate
745+
/// Returns all crates in the graph, sorted in topological order (i.e. dependencies of a crate
746746
/// come before the crate itself).
747747
fn crates_in_topological_order(&self) -> Vec<CrateBuilderId> {
748748
let mut res = Vec::new();

crates/base-db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub use crate::{
3232
},
3333
};
3434
use dashmap::{DashMap, mapref::entry::Entry};
35-
pub use query_group::{self};
35+
pub use query_group;
3636
use rustc_hash::{FxHashSet, FxHasher};
3737
use salsa::{Durability, Setter};
3838
pub use semver::{BuildMetadata, Prerelease, Version, VersionReq};

0 commit comments

Comments
 (0)