Skip to content

Commit adcd9cf

Browse files
authored
Merge branch 'rust-lang:master' into 18955---fix-running-tests-for-packages-with-multiple-targets
2 parents 4d6f58e + 039ac84 commit adcd9cf

File tree

259 files changed

+7302
-4831
lines changed

Some content is hidden

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

259 files changed

+7302
-4831
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

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude = ["crates/proc-macro-srv/proc-macro-test/imp"]
44
resolver = "2"
55

66
[workspace.package]
7-
rust-version = "1.83"
7+
rust-version = "1.84"
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
authors = ["rust-analyzer team"]

README.md

+1-1
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

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)