Skip to content

Commit 80c0919

Browse files
committed
Auto merge of rust-lang#136803 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents c03c38d + 8fd713b commit 80c0919

File tree

206 files changed

+5673
-3895
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

+5673
-3895
lines changed

src/tools/rust-analyzer/.git-blame-ignore-revs

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ f247090558c9ba3c551566eae5882b7ca865225f
1414
b2f6fd4f961fc7e4fbfdb80cae2e6065f8436f15
1515
c48062fe2ab9a2d913d1985a6b0aec4bf936bfc1
1616
f532576ac53ddcc666bc8d59e0b6437065e2f599
17+
4704881b641884de50645637108b6b6f5b68aaf9

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

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

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

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

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

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

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ env:
2222

2323
jobs:
2424
dist:
25+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
2526
strategy:
2627
matrix:
2728
include:
@@ -138,6 +139,7 @@ jobs:
138139
path: ./dist
139140

140141
dist-x86_64-unknown-linux-musl:
142+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
141143
name: dist (x86_64-unknown-linux-musl)
142144
runs-on: ubuntu-latest
143145
env:
@@ -183,6 +185,7 @@ jobs:
183185
path: ./dist
184186

185187
publish:
188+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
186189
name: publish
187190
runs-on: ubuntu-latest
188191
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
@@ -257,24 +260,24 @@ jobs:
257260
working-directory: ./editors/code
258261

259262
- name: Publish Extension (Code Marketplace, release)
260-
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
263+
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
261264
working-directory: ./editors/code
262265
# token from https://dev.azure.com/rust-analyzer/
263266
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
264267

265268
- name: Publish Extension (OpenVSX, release)
266-
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
269+
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
267270
working-directory: ./editors/code
268271
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
269272
timeout-minutes: 2
270273

271274
- name: Publish Extension (Code Marketplace, nightly)
272-
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
275+
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
273276
working-directory: ./editors/code
274277
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
275278

276279
- name: Publish Extension (OpenVSX, nightly)
277-
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
280+
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
278281
working-directory: ./editors/code
279282
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
280283
timeout-minutes: 2

src/tools/rust-analyzer/.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ target/
66
*.log
77
*.iml
88
.vscode/settings.json
9-
generated_assists.adoc
10-
generated_features.adoc
11-
generated_diagnostic.adoc
129
.DS_Store
1310
/out/
1411
/dump.lsif
1512
.envrc
13+
docs/book/book
14+
docs/book/src/assists_generated.md
15+
docs/book/src/diagnostics_generated.md
16+
docs/book/src/features_generated.md

src/tools/rust-analyzer/Cargo.lock

+17-16
Original file line numberDiff line numberDiff line change
@@ -1408,9 +1408,9 @@ dependencies = [
14081408

14091409
[[package]]
14101410
name = "proc-macro2"
1411-
version = "1.0.86"
1411+
version = "1.0.93"
14121412
source = "registry+https://github.com/rust-lang/crates.io-index"
1413-
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
1413+
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
14141414
dependencies = [
14151415
"unicode-ident",
14161416
]
@@ -1514,9 +1514,9 @@ dependencies = [
15141514

15151515
[[package]]
15161516
name = "ra-ap-rustc_abi"
1517-
version = "0.91.0"
1517+
version = "0.94.0"
15181518
source = "registry+https://github.com/rust-lang/crates.io-index"
1519-
checksum = "d5246e9e1f450333a990877eabbc36fe0567e7cedd56d5365db319e14079cf2a"
1519+
checksum = "2fa4333df7b71217edb44a36702cafd2bcfc9850677bdf78b32c9f2c98e5df40"
15201520
dependencies = [
15211521
"bitflags 2.7.0",
15221522
"ra-ap-rustc_index",
@@ -1525,19 +1525,19 @@ dependencies = [
15251525

15261526
[[package]]
15271527
name = "ra-ap-rustc_index"
1528-
version = "0.91.0"
1528+
version = "0.94.0"
15291529
source = "registry+https://github.com/rust-lang/crates.io-index"
1530-
checksum = "59fd8e4f5b34c434ec111efb0e0614954db048b9307d3b2e4cc3c915da9d2160"
1530+
checksum = "d200275ff3d952cc11108f4dc6a692473659758623d63f2bdcea6104a7f1cec8"
15311531
dependencies = [
15321532
"ra-ap-rustc_index_macros",
15331533
"smallvec",
15341534
]
15351535

15361536
[[package]]
15371537
name = "ra-ap-rustc_index_macros"
1538-
version = "0.91.0"
1538+
version = "0.94.0"
15391539
source = "registry+https://github.com/rust-lang/crates.io-index"
1540-
checksum = "2d34973fe081392bd1edb022e865e9952fcaa093f9cdae183edce64472e5e889"
1540+
checksum = "06eb63df8c1ce2dcb07647305bed811c9c5ebd157def01a81c1b9479b8592b3b"
15411541
dependencies = [
15421542
"proc-macro2",
15431543
"quote",
@@ -1546,29 +1546,30 @@ dependencies = [
15461546

15471547
[[package]]
15481548
name = "ra-ap-rustc_lexer"
1549-
version = "0.91.0"
1549+
version = "0.94.0"
15501550
source = "registry+https://github.com/rust-lang/crates.io-index"
1551-
checksum = "52fa42c582e21b35e8f61a5afe3c63a9c722d995826762eb19b18beeccf5157f"
1551+
checksum = "b7a4d402b2f85650e8c1f78e2e2defc241b03948d6e30d9f5254c9b82755cc4d"
15521552
dependencies = [
1553+
"memchr",
15531554
"unicode-properties",
15541555
"unicode-xid",
15551556
]
15561557

15571558
[[package]]
15581559
name = "ra-ap-rustc_parse_format"
1559-
version = "0.91.0"
1560+
version = "0.94.0"
15601561
source = "registry+https://github.com/rust-lang/crates.io-index"
1561-
checksum = "740383328d7033393e5385f4a6073b880d5811b0fc0fd2559e481f905940f2f8"
1562+
checksum = "a23a382dbe392beb26360c1a8ce9193155ef74eeac59bcda0fa0a233e047323a"
15621563
dependencies = [
15631564
"ra-ap-rustc_index",
15641565
"ra-ap-rustc_lexer",
15651566
]
15661567

15671568
[[package]]
15681569
name = "ra-ap-rustc_pattern_analysis"
1569-
version = "0.91.0"
1570+
version = "0.94.0"
15701571
source = "registry+https://github.com/rust-lang/crates.io-index"
1571-
checksum = "c39f544728f32cebffb1a8b92ba3c1f3dcb4144081438d192137ed197d479a9d"
1572+
checksum = "d746955d67f315ab79767f1d0bbc17fee4f0970d4a00b9ad76bf09cc7d3cd17e"
15721573
dependencies = [
15731574
"ra-ap-rustc_index",
15741575
"rustc-hash 2.0.0",
@@ -2001,9 +2002,9 @@ dependencies = [
20012002

20022003
[[package]]
20032004
name = "tenthash"
2004-
version = "0.4.0"
2005+
version = "1.0.0"
20052006
source = "registry+https://github.com/rust-lang/crates.io-index"
2006-
checksum = "d67f9f3cf70e0852941d7bc3cb884b49b24b8ee956baf91ad0abae31f5ef11fb"
2007+
checksum = "2d092d622df8bb64e5de8dc86a3667702d5f1e0fe2f0604c6035540703c8cd1e"
20072008

20082009
[[package]]
20092010
name = "test-fixture"

src/tools/rust-analyzer/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8787
vfs = { path = "./crates/vfs", version = "0.0.0" }
8888
edition = { path = "./crates/edition", version = "0.0.0" }
8989

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

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

src/tools/rust-analyzer/PRIVACY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See the [Privacy](https://rust-analyzer.github.io/manual.html#privacy) section of the user manual.
1+
See the [Privacy](https://rust-analyzer.github.io/book/privacy.html) section of the user manual.

src/tools/rust-analyzer/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<img
3-
src="https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/master/assets/logo-wide.svg"
3+
src="https://raw.githubusercontent.com/rust-lang/rust-analyzer/master/assets/logo-wide.svg"
44
alt="rust-analyzer logo">
55
</p>
66

@@ -9,7 +9,7 @@ It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust
99

1010
## Quick Start
1111

12-
https://rust-analyzer.github.io/manual.html#installation
12+
https://rust-analyzer.github.io/book/installation.html
1313

1414
## Documentation
1515

@@ -18,12 +18,13 @@ if you are just curious about how things work under the hood, check the [./docs/
1818
folder.
1919

2020
If you want to **use** rust-analyzer's language server with your editor of
21-
choice, check [the manual](https://rust-analyzer.github.io/manual.html) folder.
21+
choice, check [the manual](https://rust-analyzer.github.io/book/).
2222
It also contains some tips & tricks to help you be more productive when using rust-analyzer.
2323

2424
## Security and Privacy
2525

26-
See the corresponding sections of [the manual](https://rust-analyzer.github.io/manual.html#security).
26+
See the [security](https://rust-analyzer.github.io/book/security.html) and
27+
[privacy](https://rust-analyzer.github.io/book/privacy.html) sections of the manual.
2728

2829
## Communication
2930

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ impl fmt::Display for CrateName {
129129
}
130130

131131
impl ops::Deref for CrateName {
132-
type Target = str;
133-
fn deref(&self) -> &str {
134-
self.0.as_str()
132+
type Target = Symbol;
133+
fn deref(&self) -> &Symbol {
134+
&self.0
135135
}
136136
}
137137

@@ -230,8 +230,8 @@ impl fmt::Display for CrateDisplayName {
230230
}
231231

232232
impl ops::Deref for CrateDisplayName {
233-
type Target = str;
234-
fn deref(&self) -> &str {
233+
type Target = Symbol;
234+
fn deref(&self) -> &Symbol {
235235
&self.crate_name
236236
}
237237
}

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

+13-1
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,14 @@ impl FunctionData {
9595
.map(Box::new);
9696
let rustc_allow_incoherent_impl = attrs.by_key(&sym::rustc_allow_incoherent_impl).exists();
9797
if flags.contains(FnFlags::HAS_UNSAFE_KW)
98-
&& !crate_graph[krate].edition.at_least_2024()
9998
&& attrs.by_key(&sym::rustc_deprecated_safe_2024).exists()
10099
{
101100
flags.remove(FnFlags::HAS_UNSAFE_KW);
101+
flags.insert(FnFlags::DEPRECATED_SAFE_2024);
102+
}
103+
104+
if attrs.by_key(&sym::target_feature).exists() {
105+
flags.insert(FnFlags::HAS_TARGET_FEATURE);
102106
}
103107

104108
Arc::new(FunctionData {
@@ -148,13 +152,21 @@ impl FunctionData {
148152
self.flags.contains(FnFlags::HAS_UNSAFE_KW)
149153
}
150154

155+
pub fn is_deprecated_safe_2024(&self) -> bool {
156+
self.flags.contains(FnFlags::DEPRECATED_SAFE_2024)
157+
}
158+
151159
pub fn is_safe(&self) -> bool {
152160
self.flags.contains(FnFlags::HAS_SAFE_KW)
153161
}
154162

155163
pub fn is_varargs(&self) -> bool {
156164
self.flags.contains(FnFlags::IS_VARARGS)
157165
}
166+
167+
pub fn has_target_feature(&self) -> bool {
168+
self.flags.contains(FnFlags::HAS_TARGET_FEATURE)
169+
}
158170
}
159171

160172
fn parse_rustc_legacy_const_generics(tt: &crate::tt::TopSubtree) -> Box<[u32]> {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use triomphe::Arc;
1010

1111
use crate::{
1212
attr::{Attrs, AttrsWithOwner},
13-
body::{scope::ExprScopes, Body, BodySourceMap},
1413
data::{
1514
adt::{EnumData, EnumVariantData, StructData, VariantData},
1615
ConstData, ExternCrateDeclData, FunctionData, ImplData, Macro2Data, MacroRulesData,
1716
ProcMacroData, StaticData, TraitAliasData, TraitData, TypeAliasData,
1817
},
18+
expr_store::{scope::ExprScopes, Body, BodySourceMap},
1919
generics::GenericParams,
2020
import_map::ImportMap,
2121
item_tree::{AttrOwner, ItemTree, ItemTreeSourceMaps},

0 commit comments

Comments
 (0)