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

96 files changed

Lines changed: 1828 additions & 704 deletions

File tree

Some content is hidden

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

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

Lines changed: 5 additions & 0 deletions
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‎

Lines changed: 2 additions & 7 deletions
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 git@github.com: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 user.email=dummy@example.com commit --message 📈

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

Lines changed: 3 additions & 3 deletions
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‎

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use itertools::Itertools;
66

77
usecrate::{
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‎

Lines changed: 1 addition & 1 deletion
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
pubstructStructFlags:u8{
4545
constNO_FLAGS = 0;
4646
/// Indicates whether the struct is `PhantomData`.

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

Lines changed: 1 addition & 1 deletion
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-
usecrate::{db::DefDatabase,test_db::TestDB,ItemContainerId,Lookup};
480+
usecrate::{test_db::TestDB,ItemContainerId,Lookup};
481481

482482
usesuper::*;
483483

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

Lines changed: 3 additions & 3 deletions
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‎

Lines changed: 22 additions & 6 deletions
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
usecrate::{
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-
usesuper::*;
15-
1632
fnid<N:ItemTreeNode>(index:Idx<N>) -> FileItemTreeId<N>{
1733
FileItemTreeId(index)
1834
}

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

Lines changed: 10 additions & 4 deletions
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
usecrate::{
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-
usesuper::*;
13-
1420
pub(super)fnprint_item_tree(db:&dynDefDatabase,tree:&ItemTree) -> String{
1521
letmut p = Printer{ db, tree,buf:String::new(),indent_level:0,needs_indent:true};
1622

0 commit comments

Comments
 (0)