Skip to content

Commit 43fdd49

Browse files
committed
Auto merge of #121581 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
2 parents 710048f + 5ee6a5d commit 43fdd49

File tree

96 files changed

+1828
-704
lines changed

Some content is hidden

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

96 files changed

+1828
-704
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ jobs:
226226
- name: download typos
227227
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/$TYPOS_VERSION/typos-$TYPOS_VERSION-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
228228

229+
- name: Checkout repository
230+
uses: actions/checkout@v4
231+
with:
232+
ref: ${{ github.event.pull_request.head.sha }}
233+
229234
- name: check for typos
230235
run: typos
231236

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

+2-7
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
other_metrics:
6868
strategy:
6969
matrix:
70-
names: [self, rustc_tests, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
70+
names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
7171
runs-on: ubuntu-latest
7272
needs: [setup_cargo, build_metrics]
7373

@@ -118,11 +118,6 @@ jobs:
118118
with:
119119
name: self-${{ github.sha }}
120120

121-
- name: Download rustc_tests metrics
122-
uses: actions/download-artifact@v3
123-
with:
124-
name: rustc_tests-${{ github.sha }}
125-
126121
- name: Download ripgrep-13.0.0 metrics
127122
uses: actions/download-artifact@v3
128123
with:
@@ -151,7 +146,7 @@ jobs:
151146
chmod 700 ~/.ssh
152147
153148
git clone --depth 1 [email protected]:rust-analyzer/metrics.git
154-
jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5] * .[6]" build.json self.json rustc_tests.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
149+
jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
155150
cd metrics
156151
git add .
157152
git -c user.name=Bot -c [email protected] commit --message 📈

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959

6060
steps:
6161
- name: Checkout repository
62-
uses: actions/checkout@v4
62+
uses: actions/checkout@v3
6363
with:
6464
fetch-depth: ${{ env.FETCH_DEPTH }}
6565

@@ -78,9 +78,9 @@ jobs:
7878
rustup component add rust-src
7979
8080
- name: Install Node.js
81-
uses: actions/setup-node@v4
81+
uses: actions/setup-node@v3
8282
with:
83-
node-version: 18
83+
node-version: 16
8484

8585
- name: Update apt repositories
8686
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'

src/tools/rust-analyzer/Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,7 @@ dependencies = [
17091709
"dissimilar",
17101710
"expect-test",
17111711
"indexmap",
1712+
"itertools",
17121713
"linked-hash-map",
17131714
"lock_api",
17141715
"oorandom",

src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use itertools::Itertools;
66

77
use crate::{
88
hir::{
9-
Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst,
10-
Movability, Statement,
9+
Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst, Movability,
10+
Statement,
1111
},
1212
pretty::{print_generic_args, print_path, print_type_ref},
1313
type_ref::TypeRef,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct StructData {
4040
}
4141

4242
bitflags! {
43-
#[derive(Debug, Clone, PartialEq, Eq)]
43+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
4444
pub struct StructFlags: u8 {
4545
const NO_FLAGS = 0;
4646
/// Indicates whether the struct is `PhantomData`.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ mod tests {
477477
use expect_test::{expect, Expect};
478478
use test_fixture::WithFixture;
479479

480-
use crate::{db::DefDatabase, test_db::TestDB, ItemContainerId, Lookup};
480+
use crate::{test_db::TestDB, ItemContainerId, Lookup};
481481

482482
use super::*;
483483

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ use std::{
4444
ops::{Index, Range},
4545
};
4646

47-
use ast::{AstNode, HasName, StructKind};
47+
use ast::{AstNode, StructKind};
4848
use base_db::CrateId;
4949
use either::Either;
5050
use hir_expand::{
5151
ast_id_map::{AstIdNode, FileAstId},
5252
attrs::RawAttrs,
53-
name::{name, AsName, Name},
53+
name::Name,
5454
ExpandTo, HirFileId, InFile,
5555
};
5656
use intern::Interned;
@@ -67,7 +67,7 @@ use crate::{
6767
attr::Attrs,
6868
db::DefDatabase,
6969
generics::{GenericParams, LifetimeParamData, TypeOrConstParamData},
70-
path::{path, AssociatedTypeBinding, GenericArgs, ImportAlias, ModPath, Path, PathKind},
70+
path::{GenericArgs, ImportAlias, ModPath, Path, PathKind},
7171
type_ref::{Mutability, TraitRef, TypeBound, TypeRef},
7272
visibility::{RawVisibility, VisibilityExplicitness},
7373
BlockId, Lookup,

src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs

+22-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,33 @@
22
33
use std::collections::hash_map::Entry;
44

5-
use hir_expand::{ast_id_map::AstIdMap, span_map::SpanMapRef};
6-
use syntax::ast::{HasModuleItem, HasTypeBounds, IsString};
5+
use hir_expand::{
6+
ast_id_map::AstIdMap, mod_path::path, name, name::AsName, span_map::SpanMapRef, HirFileId,
7+
};
8+
use la_arena::Arena;
9+
use syntax::{
10+
ast::{self, HasModuleItem, HasName, HasTypeBounds, IsString},
11+
AstNode,
12+
};
13+
use triomphe::Arc;
714

815
use crate::{
9-
generics::{GenericParamsCollector, TypeParamData, TypeParamProvenance},
10-
type_ref::{LifetimeRef, TraitBoundModifier},
16+
db::DefDatabase,
17+
generics::{GenericParams, GenericParamsCollector, TypeParamData, TypeParamProvenance},
18+
item_tree::{
19+
AssocItem, AttrOwner, Const, Either, Enum, ExternBlock, ExternCrate, Field, FieldAstId,
20+
Fields, FileItemTreeId, FnFlags, Function, GenericArgs, Idx, IdxRange, Impl, ImportAlias,
21+
Interned, ItemTree, ItemTreeData, ItemTreeNode, Macro2, MacroCall, MacroRules, Mod,
22+
ModItem, ModKind, ModPath, Mutability, Name, Param, ParamAstId, Path, Range, RawAttrs,
23+
RawIdx, RawVisibilityId, Static, Struct, StructKind, Trait, TraitAlias, TypeAlias, Union,
24+
Use, UseTree, UseTreeKind, Variant,
25+
},
26+
path::AssociatedTypeBinding,
27+
type_ref::{LifetimeRef, TraitBoundModifier, TraitRef, TypeBound, TypeRef},
28+
visibility::RawVisibility,
1129
LocalLifetimeParamId, LocalTypeOrConstParamId,
1230
};
1331

14-
use super::*;
15-
1632
fn id<N: ItemTreeNode>(index: Idx<N>) -> FileItemTreeId<N> {
1733
FileItemTreeId(index)
1834
}

src/tools/rust-analyzer/crates/hir-def/src/item_tree/pretty.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
//! `ItemTree` debug printer.
22
3-
use std::fmt::Write;
3+
use std::fmt::{self, Write};
44

55
use span::ErasedFileAstId;
66

77
use crate::{
8-
generics::{WherePredicate, WherePredicateTypeTarget},
8+
generics::{TypeOrConstParamData, WherePredicate, WherePredicateTypeTarget},
9+
item_tree::{
10+
AttrOwner, Const, DefDatabase, Enum, ExternBlock, ExternCrate, Field, FieldAstId, Fields,
11+
FileItemTreeId, FnFlags, Function, GenericParams, Impl, Interned, ItemTree, Macro2,
12+
MacroCall, MacroRules, Mod, ModItem, ModKind, Param, ParamAstId, Path, RawAttrs,
13+
RawVisibilityId, Static, Struct, Trait, TraitAlias, TypeAlias, TypeBound, TypeRef, Union,
14+
Use, UseTree, UseTreeKind, Variant,
15+
},
916
pretty::{print_path, print_type_bounds, print_type_ref},
17+
visibility::RawVisibility,
1018
};
1119

12-
use super::*;
13-
1420
pub(super) fn print_item_tree(db: &dyn DefDatabase, tree: &ItemTree) -> String {
1521
let mut p = Printer { db, tree, buf: String::new(), indent_level: 0, needs_indent: true };
1622

src/tools/rust-analyzer/crates/hir-def/src/nameres/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ mod tests {
24462446
use base_db::SourceDatabase;
24472447
use test_fixture::WithFixture;
24482448

2449-
use crate::{db::DefDatabase, test_db::TestDB};
2449+
use crate::test_db::TestDB;
24502450

24512451
use super::*;
24522452

src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/macros.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
use expect_test::expect;
2-
use test_fixture::WithFixture;
32

43
use itertools::Itertools;
54

6-
use crate::nameres::tests::check;
7-
85
use super::*;
96

107
#[test]

0 commit comments

Comments
 (0)