Skip to content

Commit e8398b1

Browse files
committed
Auto merge of #132314 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents 0dc8c6c + 2eaf49b commit e8398b1

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

.github/workflows/ci.yaml

Lines changed: 17 additions & 20 deletions
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) }}'

.gitignore

Lines changed: 1 addition & 2 deletions
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/*

Cargo.lock

Lines changed: 16 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 8 deletions
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"

crates/cfg/Cargo.toml

Lines changed: 1 addition & 0 deletions
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 }

crates/cfg/src/lib.rs

Lines changed: 26 additions & 6 deletions
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

crates/hir-def/Cargo.toml

Lines changed: 1 addition & 0 deletions
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)