Skip to content

Commit 6cce01b

Browse files
committed
Auto merge of #136803 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents 52d4d1d + 37355b3 commit 6cce01b

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

.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

.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:

.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:

.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

.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

Cargo.lock

+17-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

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.

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

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
}

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]> {

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)