Skip to content

Commit 566f34c

Browse files
authored
Rollup merge of #137921 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents decb0c9 + 015e81d commit 566f34c

File tree

206 files changed

+5974
-4171
lines changed

Some content is hidden

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

206 files changed

+5974
-4171
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
publish:
14-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
14+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
1515
name: publish
1616
runs-on: ubuntu-latest
1717
steps:

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
- name: Install Nodejs
175175
uses: actions/setup-node@v4
176176
with:
177-
node-version: 18
177+
node-version: 22
178178
if: needs.changes.outputs.typescript == 'true'
179179

180180
- name: Install xvfb

src/tools/rust-analyzer/.github/workflows/fuzz.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
rust:
22-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
22+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
2323
name: Rust
2424
runs-on: ubuntu-latest
2525
env:

src/tools/rust-analyzer/.github/workflows/publish-libs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
publish-libs:
12-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
12+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
1313
name: publish
1414
runs-on: ubuntu-latest
1515
steps:

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

+27-32
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ env:
1717
RUSTUP_MAX_RETRIES: 10
1818
FETCH_DEPTH: 0 # pull in the tags for the version string
1919
MACOSX_DEPLOYMENT_TARGET: 13.0
20-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
21-
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
20+
ZIG_VERSION: 0.13.0
21+
ZIGBUILD_VERSION: 0.19.8
2222

2323
jobs:
2424
dist:
25-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
25+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
2626
strategy:
2727
matrix:
2828
include:
@@ -36,13 +36,15 @@ jobs:
3636
code-target: win32-arm64
3737
- os: ubuntu-latest
3838
target: x86_64-unknown-linux-gnu
39+
zig_target: x86_64-unknown-linux-gnu.2.28
3940
code-target: linux-x64
40-
container: rockylinux:8
4141
- os: ubuntu-latest
4242
target: aarch64-unknown-linux-gnu
43+
zig_target: aarch64-unknown-linux-gnu.2.28
4344
code-target: linux-arm64
4445
- os: ubuntu-latest
4546
target: arm-unknown-linux-gnueabihf
47+
zig_target: arm-unknown-linux-gnueabihf.2.28
4648
code-target: linux-armhf
4749
- os: macos-13
4850
target: x86_64-apple-darwin
@@ -64,40 +66,33 @@ jobs:
6466
with:
6567
fetch-depth: ${{ env.FETCH_DEPTH }}
6668

67-
- name: Install toolchain dependencies
68-
if: matrix.container == 'rockylinux:8'
69-
shell: bash
70-
run: |
71-
dnf install -y gcc
72-
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
73-
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
69+
- name: Install Node.js toolchain
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 22
7473

7574
- name: Install Rust toolchain
7675
run: |
7776
rustup update --no-self-update stable
78-
rustup target add ${{ matrix.target }}
7977
rustup component add rust-src
78+
rustup target add ${{ matrix.target }}
8079
81-
- name: Install Node.js
82-
uses: actions/setup-node@v4
83-
with:
84-
node-version: 18
85-
86-
- name: Update apt repositories
87-
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
88-
run: sudo apt-get update
89-
90-
- name: Install AArch64 target toolchain
91-
if: matrix.target == 'aarch64-unknown-linux-gnu'
92-
run: sudo apt-get install gcc-aarch64-linux-gnu
93-
94-
- name: Install ARM target toolchain
95-
if: matrix.target == 'arm-unknown-linux-gnueabihf'
96-
run: sudo apt-get install gcc-arm-linux-gnueabihf
80+
- name: Install Zig toolchain
81+
if: ${{ matrix.zig_target }}
82+
run: |
83+
which cargo
84+
curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | sudo tar JxC /usr/local
85+
sudo ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
86+
curl -L "https://github.com./rust-cross/cargo-zigbuild/releases/download/v${ZIGBUILD_VERSION}/cargo-zigbuild-v${ZIGBUILD_VERSION}.x86_64-unknown-linux-musl.tar.gz" | tar zxC ~/.cargo/bin
9787
98-
- name: Dist
88+
- name: Dist (plain)
89+
if: ${{ !matrix.zig_target }}
9990
run: cargo xtask dist --client-patch-version ${{ github.run_number }}
10091

92+
- name: Dist (using zigbuild)
93+
if: ${{ matrix.zig_target }}
94+
run: RA_TARGET=${{ matrix.zig_target}} cargo xtask dist --client-patch-version ${{ github.run_number }} --zig
95+
10196
- run: npm ci
10297
working-directory: editors/code
10398

@@ -139,7 +134,7 @@ jobs:
139134
path: ./dist
140135

141136
dist-x86_64-unknown-linux-musl:
142-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
137+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
143138
name: dist (x86_64-unknown-linux-musl)
144139
runs-on: ubuntu-latest
145140
env:
@@ -185,15 +180,15 @@ jobs:
185180
path: ./dist
186181

187182
publish:
188-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
183+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
189184
name: publish
190185
runs-on: ubuntu-latest
191186
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
192187
steps:
193188
- name: Install Nodejs
194189
uses: actions/setup-node@v4
195190
with:
196-
node-version: 20
191+
node-version: 22
197192

198193
- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
199194
if: github.ref == 'refs/heads/release'

src/tools/rust-analyzer/.typos.toml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ extend-ignore-re = [
1818
"INOUT",
1919
"optin",
2020
"=Pn",
21+
# ignore `// spellchecker:off` until `// spellchecker:on`
22+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
2123
]
2224

2325
[default.extend-words]

src/tools/rust-analyzer/Cargo.lock

+15-18
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ name = "always-assert"
2222
version = "0.2.0"
2323
source = "registry+https://github.com./rust-lang/crates.io-index"
2424
checksum = "a1078fa1ce1e34b1872d8611ad921196d76bdd7027e949fbe31231abde201892"
25-
dependencies = [
26-
"tracing",
27-
]
2825

2926
[[package]]
3027
name = "anyhow"
@@ -1507,9 +1504,9 @@ dependencies = [
15071504

15081505
[[package]]
15091506
name = "ra-ap-rustc_abi"
1510-
version = "0.97.0"
1507+
version = "0.98.0"
15111508
source = "registry+https://github.com./rust-lang/crates.io-index"
1512-
checksum = "3829c3355d1681ffeaf1450ec71edcdace6820fe2e86469d8fc1ad45e2c96460"
1509+
checksum = "4b42cccfff8091a4c3397736518774dbad619e82f8def6f70d8e46dbbe396007"
15131510
dependencies = [
15141511
"bitflags 2.7.0",
15151512
"ra-ap-rustc_hashes",
@@ -1519,28 +1516,28 @@ dependencies = [
15191516

15201517
[[package]]
15211518
name = "ra-ap-rustc_hashes"
1522-
version = "0.97.0"
1519+
version = "0.98.0"
15231520
source = "registry+https://github.com./rust-lang/crates.io-index"
1524-
checksum = "1bd4d6d4c434bec08e02370a4f64a4985312097215a62e82d0f757f3a98e502e"
1521+
checksum = "46d8bd34ed6552c8cac1764106ef5adbeef3e5c7700e0ceb4c83a47a631894fe"
15251522
dependencies = [
15261523
"rustc-stable-hash",
15271524
]
15281525

15291526
[[package]]
15301527
name = "ra-ap-rustc_index"
1531-
version = "0.97.0"
1528+
version = "0.98.0"
15321529
source = "registry+https://github.com./rust-lang/crates.io-index"
1533-
checksum = "bad6fc4bd7522e31096e2de5b0351144fe0684b608791ee26c842bf2da1b19ae"
1530+
checksum = "93799e4dccbbd47f8b66bc0aa42effc1b7077aaee09d8a40b86b8d659b80c7b7"
15341531
dependencies = [
15351532
"ra-ap-rustc_index_macros",
15361533
"smallvec",
15371534
]
15381535

15391536
[[package]]
15401537
name = "ra-ap-rustc_index_macros"
1541-
version = "0.97.0"
1538+
version = "0.98.0"
15421539
source = "registry+https://github.com./rust-lang/crates.io-index"
1543-
checksum = "cfb234e1f84b92be45276c3025bee18789e9bc95bec8789bec961e78edb01c52"
1540+
checksum = "30baa5d00f94ba437a9dcaf7ae074ebe4f367bb05a4c2835e0aa2e7af3463aac"
15441541
dependencies = [
15451542
"proc-macro2",
15461543
"quote",
@@ -1549,9 +1546,9 @@ dependencies = [
15491546

15501547
[[package]]
15511548
name = "ra-ap-rustc_lexer"
1552-
version = "0.97.0"
1549+
version = "0.98.0"
15531550
source = "registry+https://github.com./rust-lang/crates.io-index"
1554-
checksum = "7a3a40bd11dc43d1cb110e730b80620cf8102f4cca8920a02b65954da0ed931f"
1551+
checksum = "3004d1d1b50afe3e1f9cdd428a282da7ffbf5f26dd8bf04af0d651d44e4873d8"
15551552
dependencies = [
15561553
"memchr",
15571554
"unicode-properties",
@@ -1560,19 +1557,19 @@ dependencies = [
15601557

15611558
[[package]]
15621559
name = "ra-ap-rustc_parse_format"
1563-
version = "0.97.0"
1560+
version = "0.98.0"
15641561
source = "registry+https://github.com./rust-lang/crates.io-index"
1565-
checksum = "5feb877478994cb4c0c0c7a5116a352eefc0634aefc8636feb00a893fa5b7135"
1562+
checksum = "cb57e5124a64aaaf92c06130fbc1b8e1d547b5a2a96081f1f848e31c211df5d2"
15661563
dependencies = [
15671564
"ra-ap-rustc_index",
15681565
"ra-ap-rustc_lexer",
15691566
]
15701567

15711568
[[package]]
15721569
name = "ra-ap-rustc_pattern_analysis"
1573-
version = "0.97.0"
1570+
version = "0.98.0"
15741571
source = "registry+https://github.com./rust-lang/crates.io-index"
1575-
checksum = "a76774d35934d464c4115908cde16f76a4f7e540fe1eea6b79336c556e37bdd3"
1572+
checksum = "e427c3d30e4bdff28abd6b0ef3e6f4dfab44acd9468a4954eeff8717d8df8819"
15761573
dependencies = [
15771574
"ra-ap-rustc_index",
15781575
"rustc-hash 2.0.0",
@@ -1940,13 +1937,13 @@ dependencies = [
19401937
name = "stdx"
19411938
version = "0.0.0"
19421939
dependencies = [
1943-
"always-assert",
19441940
"backtrace",
19451941
"crossbeam-channel",
19461942
"itertools",
19471943
"jod-thread",
19481944
"libc",
19491945
"miow",
1946+
"tracing",
19501947
"windows-sys 0.59.0",
19511948
]
19521949

src/tools/rust-analyzer/Cargo.toml

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ salsa.opt-level = 3
2525
miniz_oxide.opt-level = 3
2626

2727
[profile.release]
28-
incremental = true
2928
# Set this to 1 or 2 to get more useful backtraces in debugger.
3029
debug = 0
3130

@@ -86,12 +85,12 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8685
vfs = { path = "./crates/vfs", version = "0.0.0" }
8786
edition = { path = "./crates/edition", version = "0.0.0" }
8887

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 }
88+
ra-ap-rustc_hashes = { version = "0.98", default-features = false }
89+
ra-ap-rustc_lexer = { version = "0.98", default-features = false }
90+
ra-ap-rustc_parse_format = { version = "0.98", default-features = false }
91+
ra-ap-rustc_index = { version = "0.98", default-features = false }
92+
ra-ap-rustc_abi = { version = "0.98", default-features = false }
93+
ra-ap-rustc_pattern_analysis = { version = "0.98", default-features = false }
9594

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

src/tools/rust-analyzer/crates/base-db/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
lz4_flex = { version = "0.11", default-features = false }

src/tools/rust-analyzer/crates/cfg/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
rustc-hash.workspace = true

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

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ license.workspace = true
1010
rust-version.workspace = true
1111

1212
[lib]
13-
doctest = false
1413

1514
[dependencies]
1615
arrayvec.workspace = true

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
//!
66
//! It is used like this:
77
//!
8-
//! ```
8+
//! ```ignore
9+
//! # use hir_def::dyn_map::DynMap;
10+
//! # use hir_def::dyn_map::Key;
911
//! // keys define submaps of a `DynMap`
1012
//! const STRING_TO_U32: Key<String, u32> = Key::new();
1113
//! const U32_TO_VEC: Key<u32, Vec<bool>> = Key::new();

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -883,20 +883,20 @@ pub struct UseTree {
883883

884884
#[derive(Debug, Clone, Eq, PartialEq)]
885885
pub enum UseTreeKind {
886-
/// ```
886+
/// ```ignore
887887
/// use path::to::Item;
888888
/// use path::to::Item as Renamed;
889889
/// use path::to::Trait as _;
890890
/// ```
891891
Single { path: Interned<ModPath>, alias: Option<ImportAlias> },
892892

893-
/// ```
893+
/// ```ignore
894894
/// use *; // (invalid, but can occur in nested tree)
895895
/// use path::*;
896896
/// ```
897897
Glob { path: Option<Interned<ModPath>> },
898898

899-
/// ```
899+
/// ```ignore
900900
/// use prefix::{self, Item, ...};
901901
/// ```
902902
Prefixed { prefix: Option<Interned<ModPath>>, list: Box<[UseTree]> },

src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use hir_expand::{
2222
db::ExpandDatabase,
2323
proc_macro::{ProcMacro, ProcMacroExpander, ProcMacroExpansionError, ProcMacroKind},
2424
span_map::SpanMapRef,
25-
InFile, MacroCallKind, MacroFileId, MacroFileIdExt,
25+
InFile, MacroCallKind, MacroFileId, MacroFileIdExt, MacroKind,
2626
};
2727
use intern::Symbol;
2828
use itertools::Itertools;
@@ -211,7 +211,11 @@ pub fn identity_when_valid(_attr: TokenStream, item: TokenStream) -> TokenStream
211211

212212
if let Some(src) = src {
213213
if let Some(file_id) = src.file_id.macro_file() {
214-
if file_id.is_attr_macro(&db) || file_id.is_custom_derive(&db) {
214+
if let MacroKind::Derive
215+
| MacroKind::DeriveBuiltIn
216+
| MacroKind::Attr
217+
| MacroKind::AttrBuiltIn = file_id.kind(&db)
218+
{
215219
let call = file_id.call_node(&db);
216220
let mut show_spans = false;
217221
let mut show_ctxt = false;
@@ -236,7 +240,7 @@ pub fn identity_when_valid(_attr: TokenStream, item: TokenStream) -> TokenStream
236240
for impl_id in def_map[local_id].scope.impls() {
237241
let src = impl_id.lookup(&db).source(&db);
238242
if let Some(macro_file) = src.file_id.macro_file() {
239-
if macro_file.is_builtin_derive(&db) {
243+
if let MacroKind::DeriveBuiltIn | MacroKind::Derive = macro_file.kind(&db) {
240244
let pp = pretty_print_macro_expansion(
241245
src.value.syntax().clone(),
242246
db.span_map(macro_file.into()).as_ref(),

src/tools/rust-analyzer/crates/hir-def/src/nameres/mod_resolution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl DirPath {
134134
/// So this is the case which doesn't really work I think if we try to be
135135
/// 100% platform agnostic:
136136
///
137-
/// ```
137+
/// ```ignore
138138
/// mod a {
139139
/// #[path="C://sad/face"]
140140
/// mod b { mod c; }

0 commit comments

Comments
 (0)