Skip to content

Commit c8a8c82

Browse files
committed
Auto merge of rust-lang#132314 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents 2df8dbb + eae9d7a commit c8a8c82

File tree

218 files changed

+7243
-3366
lines changed

Some content is hidden

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

218 files changed

+7243
-3366
lines changed

Diff for: src/tools/rust-analyzer/.github/workflows/ci.yaml

+17-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# Please make sure that the `needs` fields for both `end-success` and `end-failure`
1+
# Please make sure that the `needs` field for the `conclusion` job
22
# are updated when adding new jobs!
33

44
name: CI
55
on:
66
pull_request:
7-
push:
8-
branches:
9-
- auto
10-
- try
11-
- automation/bors/try
7+
merge_group:
128

139
env:
1410
CARGO_INCREMENTAL: 0
@@ -237,20 +233,21 @@ jobs:
237233
- name: check for typos
238234
run: typos
239235

240-
end-success:
241-
name: bors build finished
242-
if: github.event.pusher.name == 'bors' && success()
243-
runs-on: ubuntu-latest
236+
conclusion:
244237
needs: [rust, rust-cross, typescript, typo-check]
245-
steps:
246-
- name: Mark the job as successful
247-
run: exit 0
248-
249-
end-failure:
250-
name: bors build finished
251-
if: github.event.pusher.name == 'bors' && !success()
238+
# We need to ensure this job does *not* get skipped if its dependencies fail,
239+
# because a skipped job is considered a success by GitHub. So we have to
240+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
241+
# when the workflow is canceled manually.
242+
#
243+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
244+
if: ${{ !cancelled() }}
252245
runs-on: ubuntu-latest
253-
needs: [rust, rust-cross, typescript, typo-check]
254246
steps:
255-
- name: Mark the job as a failure
256-
run: exit 1
247+
# Manually check the status of all dependencies. `if: failure()` does not work.
248+
- name: Conclusion
249+
run: |
250+
# Print the dependent jobs to see them in the CI log
251+
jq -C <<< '${{ toJson(needs) }}'
252+
# Check if all jobs that we depend on (in the needs array) were successful.
253+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Diff for: src/tools/rust-analyzer/.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/target/
1+
target/
22
/dist/
3-
crates/*/target
43
**/*.rs.bk
54
**/*.rs.pending-snap
65
.idea/*

Diff for: src/tools/rust-analyzer/Cargo.lock

+16-29
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ dependencies = [
164164
"rustc-hash 2.0.0",
165165
"syntax",
166166
"syntax-bridge",
167+
"tracing",
167168
"tt",
168169
]
169170

@@ -556,6 +557,7 @@ dependencies = [
556557
"syntax-bridge",
557558
"test-fixture",
558559
"test-utils",
560+
"text-size",
559561
"tracing",
560562
"triomphe",
561563
"tt",
@@ -670,7 +672,6 @@ dependencies = [
670672
"syntax",
671673
"test-fixture",
672674
"test-utils",
673-
"text-edit",
674675
"toolchain",
675676
"tracing",
676677
"triomphe",
@@ -692,7 +693,6 @@ dependencies = [
692693
"syntax",
693694
"test-fixture",
694695
"test-utils",
695-
"text-edit",
696696
"tracing",
697697
]
698698

@@ -711,7 +711,6 @@ dependencies = [
711711
"syntax",
712712
"test-fixture",
713713
"test-utils",
714-
"text-edit",
715714
"tracing",
716715
]
717716

@@ -743,7 +742,6 @@ dependencies = [
743742
"syntax",
744743
"test-fixture",
745744
"test-utils",
746-
"text-edit",
747745
"tracing",
748746
"triomphe",
749747
]
@@ -765,7 +763,6 @@ dependencies = [
765763
"syntax",
766764
"test-fixture",
767765
"test-utils",
768-
"text-edit",
769766
"tracing",
770767
]
771768

@@ -784,7 +781,6 @@ dependencies = [
784781
"syntax",
785782
"test-fixture",
786783
"test-utils",
787-
"text-edit",
788784
"triomphe",
789785
]
790786

@@ -1497,9 +1493,9 @@ dependencies = [
14971493

14981494
[[package]]
14991495
name = "ra-ap-rustc_abi"
1500-
version = "0.73.0"
1496+
version = "0.75.0"
15011497
source = "registry+https://github.com/rust-lang/crates.io-index"
1502-
checksum = "879ece0781e3c1cb670b9f29775c81a43a16db789d1296fad6bc5c74065b2fac"
1498+
checksum = "d5bc2cfc7264d84215a08875ef90a1d35f76b5c9ad1993515d2da7e4e40b2b4b"
15031499
dependencies = [
15041500
"bitflags 2.6.0",
15051501
"ra-ap-rustc_index",
@@ -1508,9 +1504,9 @@ dependencies = [
15081504

15091505
[[package]]
15101506
name = "ra-ap-rustc_index"
1511-
version = "0.73.0"
1507+
version = "0.75.0"
15121508
source = "registry+https://github.com/rust-lang/crates.io-index"
1513-
checksum = "6910087ff89bb9f3db114bfcd86b5139042731fe7278d3ff4ceaa69a140154a7"
1509+
checksum = "e8929140697812e5dd09e19cf446d85146332363f0dbc125d4214834c34ead96"
15141510
dependencies = [
15151511
"arrayvec",
15161512
"ra-ap-rustc_index_macros",
@@ -1519,9 +1515,9 @@ dependencies = [
15191515

15201516
[[package]]
15211517
name = "ra-ap-rustc_index_macros"
1522-
version = "0.73.0"
1518+
version = "0.75.0"
15231519
source = "registry+https://github.com/rust-lang/crates.io-index"
1524-
checksum = "3b6f7bd12b678fbb37444ba77f3b0cfc13b7394a6dc7b0c799491fc9df0a9997"
1520+
checksum = "514a3f5d04c8b4a2750f29746cc9abb1f78deb7e72e4ad1dc95bbc608f3db157"
15251521
dependencies = [
15261522
"proc-macro2",
15271523
"quote",
@@ -1530,29 +1526,29 @@ dependencies = [
15301526

15311527
[[package]]
15321528
name = "ra-ap-rustc_lexer"
1533-
version = "0.73.0"
1529+
version = "0.75.0"
15341530
source = "registry+https://github.com/rust-lang/crates.io-index"
1535-
checksum = "119bc05b5b6bc3e7f5b67ce8b8080e185da94bd83c447f91b6b3f3ecf60cbab1"
1531+
checksum = "276fcb1205da071a0cd64416f3f0e198043c11f176c5b501a45dbf0cb33979f2"
15361532
dependencies = [
15371533
"unicode-properties",
15381534
"unicode-xid",
15391535
]
15401536

15411537
[[package]]
15421538
name = "ra-ap-rustc_parse_format"
1543-
version = "0.73.0"
1539+
version = "0.75.0"
15441540
source = "registry+https://github.com/rust-lang/crates.io-index"
1545-
checksum = "70ed6150ae71d905c064dc88d7824ebb0fa81083f45d7477cba7b57176f2f635"
1541+
checksum = "961b30b22cfac296b14b72e9f95e79c16cebc8c926872755fb1568a6c4243a62"
15461542
dependencies = [
15471543
"ra-ap-rustc_index",
15481544
"ra-ap-rustc_lexer",
15491545
]
15501546

15511547
[[package]]
15521548
name = "ra-ap-rustc_pattern_analysis"
1553-
version = "0.73.0"
1549+
version = "0.75.0"
15541550
source = "registry+https://github.com/rust-lang/crates.io-index"
1555-
checksum = "6e830862a0ec85fce211d34735315686bb8d6a12d418d6d735fb534aa1cd3293"
1551+
checksum = "614232513814a4b714fea7f11345d31c0c277bca3089bb6ca1ec20870bfc022a"
15561552
dependencies = [
15571553
"ra-ap-rustc_index",
15581554
"rustc-hash 2.0.0",
@@ -1884,9 +1880,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
18841880

18851881
[[package]]
18861882
name = "smol_str"
1887-
version = "0.3.1"
1883+
version = "0.3.2"
18881884
source = "registry+https://github.com/rust-lang/crates.io-index"
1889-
checksum = "66eaf762c5af19db3108300515c8aa7a50efc90ff745f4c62288052ebf9fdd25"
1885+
checksum = "9676b89cd56310a87b93dec47b11af744f34d5fc9f367b829474eec0a891350d"
18901886
dependencies = [
18911887
"borsh",
18921888
"serde",
@@ -1978,7 +1974,6 @@ dependencies = [
19781974
"smol_str",
19791975
"stdx",
19801976
"test-utils",
1981-
"text-edit",
19821977
"tracing",
19831978
"triomphe",
19841979
]
@@ -2026,14 +2021,6 @@ dependencies = [
20262021
"tracing",
20272022
]
20282023

2029-
[[package]]
2030-
name = "text-edit"
2031-
version = "0.0.0"
2032-
dependencies = [
2033-
"itertools",
2034-
"text-size",
2035-
]
2036-
20372024
[[package]]
20382025
name = "text-size"
20392026
version = "1.1.1"

Diff for: src/tools/rust-analyzer/Cargo.toml

+7-8
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.81"
7+
rust-version = "1.82"
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
authors = ["rust-analyzer team"]
@@ -79,17 +79,16 @@ span = { path = "./crates/span", version = "0.0.0" }
7979
stdx = { path = "./crates/stdx", version = "0.0.0" }
8080
syntax = { path = "./crates/syntax", version = "0.0.0" }
8181
syntax-bridge = { path = "./crates/syntax-bridge", version = "0.0.0" }
82-
text-edit = { path = "./crates/text-edit", version = "0.0.0" }
8382
toolchain = { path = "./crates/toolchain", version = "0.0.0" }
8483
tt = { path = "./crates/tt", version = "0.0.0" }
8584
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8685
vfs = { path = "./crates/vfs", version = "0.0.0" }
8786

88-
ra-ap-rustc_lexer = { version = "0.73", default-features = false }
89-
ra-ap-rustc_parse_format = { version = "0.73", default-features = false }
90-
ra-ap-rustc_index = { version = "0.73", default-features = false }
91-
ra-ap-rustc_abi = { version = "0.73", default-features = false }
92-
ra-ap-rustc_pattern_analysis = { version = "0.73", default-features = false }
87+
ra-ap-rustc_lexer = { version = "0.75", default-features = false }
88+
ra-ap-rustc_parse_format = { version = "0.75", default-features = false }
89+
ra-ap-rustc_index = { version = "0.75", default-features = false }
90+
ra-ap-rustc_abi = { version = "0.75", default-features = false }
91+
ra-ap-rustc_pattern_analysis = { version = "0.75", default-features = false }
9392

9493
# local crates that aren't published to crates.io. These should not have versions.
9594
test-fixture = { path = "./crates/test-fixture" }
@@ -145,7 +144,7 @@ smallvec = { version = "1.10.0", features = [
145144
"union",
146145
"const_generics",
147146
] }
148-
smol_str = "0.3.1"
147+
smol_str = "0.3.2"
149148
snap = "1.1.0"
150149
text-size = "1.1.1"
151150
tracing = "0.1.40"

Diff for: src/tools/rust-analyzer/crates/cfg/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ doctest = false
1414

1515
[dependencies]
1616
rustc-hash.workspace = true
17+
tracing.workspace = true
1718

1819
# locals deps
1920
tt = { workspace = true, optional = true }

Diff for: src/tools/rust-analyzer/crates/cfg/src/lib.rs

+26-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::fmt;
99

1010
use rustc_hash::FxHashSet;
1111

12-
use intern::Symbol;
12+
use intern::{sym, Symbol};
1313

1414
pub use cfg_expr::{CfgAtom, CfgExpr};
1515
pub use dnf::DnfExpr;
@@ -24,11 +24,17 @@ pub use dnf::DnfExpr;
2424
/// of key and value in `key_values`.
2525
///
2626
/// See: <https://doc.rust-lang.org/reference/conditional-compilation.html#set-configuration-options>
27-
#[derive(Clone, PartialEq, Eq, Default)]
27+
#[derive(Clone, PartialEq, Eq)]
2828
pub struct CfgOptions {
2929
enabled: FxHashSet<CfgAtom>,
3030
}
3131

32+
impl Default for CfgOptions {
33+
fn default() -> Self {
34+
Self { enabled: FxHashSet::from_iter([CfgAtom::Flag(sym::true_.clone())]) }
35+
}
36+
}
37+
3238
impl fmt::Debug for CfgOptions {
3339
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3440
let mut items = self
@@ -54,23 +60,37 @@ impl CfgOptions {
5460
}
5561

5662
pub fn insert_atom(&mut self, key: Symbol) {
57-
self.enabled.insert(CfgAtom::Flag(key));
63+
self.insert_any_atom(CfgAtom::Flag(key));
5864
}
5965

6066
pub fn insert_key_value(&mut self, key: Symbol, value: Symbol) {
61-
self.enabled.insert(CfgAtom::KeyValue { key, value });
67+
self.insert_any_atom(CfgAtom::KeyValue { key, value });
6268
}
6369

6470
pub fn apply_diff(&mut self, diff: CfgDiff) {
6571
for atom in diff.enable {
66-
self.enabled.insert(atom);
72+
self.insert_any_atom(atom);
6773
}
6874

6975
for atom in diff.disable {
76+
let (CfgAtom::Flag(sym) | CfgAtom::KeyValue { key: sym, .. }) = &atom;
77+
if *sym == sym::true_ || *sym == sym::false_ {
78+
tracing::error!("cannot remove `true` or `false` from cfg");
79+
continue;
80+
}
7081
self.enabled.remove(&atom);
7182
}
7283
}
7384

85+
fn insert_any_atom(&mut self, atom: CfgAtom) {
86+
let (CfgAtom::Flag(sym) | CfgAtom::KeyValue { key: sym, .. }) = &atom;
87+
if *sym == sym::true_ || *sym == sym::false_ {
88+
tracing::error!("cannot insert `true` or `false` to cfg");
89+
return;
90+
}
91+
self.enabled.insert(atom);
92+
}
93+
7494
pub fn get_cfg_keys(&self) -> impl Iterator<Item = &Symbol> {
7595
self.enabled.iter().map(|it| match it {
7696
CfgAtom::Flag(key) => key,
@@ -88,7 +108,7 @@ impl CfgOptions {
88108

89109
impl Extend<CfgAtom> for CfgOptions {
90110
fn extend<T: IntoIterator<Item = CfgAtom>>(&mut self, iter: T) {
91-
iter.into_iter().for_each(|cfg_flag| _ = self.enabled.insert(cfg_flag));
111+
iter.into_iter().for_each(|cfg_flag| self.insert_any_atom(cfg_flag));
92112
}
93113
}
94114

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

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ smallvec.workspace = true
2929
hashbrown.workspace = true
3030
triomphe.workspace = true
3131
rustc_apfloat = "0.2.0"
32+
text-size.workspace = true
3233

3334
ra-ap-rustc_parse_format.workspace = true
3435
ra-ap-rustc_abi.workspace = true

0 commit comments

Comments
 (0)