Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtree update of rust-analyzer #121581

Merged
merged 84 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4a13722
Tweak delayed bug mentions.
nnethercote Feb 12, 2024
a52accc
Implement `RustIrDatabase::impl_provided_for()` for `ChalkContext`
lowr Aug 23, 2022
4940017
Rename `StructDatum` -> `AdtDatum`
lowr Aug 23, 2022
0334074
Return ADT fields and `phantom_data` flag from `adt_datum_query()`
lowr Aug 23, 2022
4829f59
Add test for auto trait bounds
lowr Aug 23, 2022
0eca3ef
Fix coerce_unsize_generic test
Veykril Feb 14, 2024
9d18e19
Filter out `{unknown}` types in `adt_datum_quqery`
Veykril Feb 14, 2024
d33d867
Add `ErrorGuaranteed` to `ast::LitKind::Err`, `token::LitKind::Err`.
nnethercote Feb 14, 2024
d846586
fix: Support multiple tab stops in completions in VSCode
DropDemBits Feb 2, 2024
bcf14e2
Work around snippet edits doubling up extra indentation
DropDemBits Feb 15, 2024
6b17dba
Merge commit 'ac998a74b3c8ff4b81c3eeb9a18811d4cc76226d' into sync-fro…
lnicola Feb 18, 2024
3aaaa14
Merge branch 'master' into sync-from-rust
lnicola Feb 18, 2024
14924b0
Auto merge of #16597 - lnicola:sync-from-rust, r=lnicola
bors Feb 18, 2024
5913567
Downgrade actions/checkout in release workflow
lnicola Feb 19, 2024
f71049b
Auto merge of #16598 - lnicola:fix-release, r=lnicola
bors Feb 19, 2024
8ca834c
Also downgrade actions/setup-node
lnicola Feb 19, 2024
5390dba
Auto merge of #16599 - lnicola:fix-release-2, r=lnicola
bors Feb 19, 2024
8544e72
Also downgrade node to 16
lnicola Feb 19, 2024
68c506f
Auto merge of #16600 - lnicola:fix-release-3, r=lnicola
bors Feb 19, 2024
af174b9
internal: checkout repo before run typos
Young-Flash Feb 19, 2024
f3d84e8
minor: fix typo
Young-Flash Feb 19, 2024
e7c9a76
Auto merge of #16601 - Young-Flash:fix_typo_ci, r=Veykril
bors Feb 19, 2024
60982dc
Auto merge of #16475 - DropDemBits:native-vscode-snippet-text-edit, r…
bors Feb 19, 2024
30b992e
Deduplicate references to macro argument
krobelus Jan 14, 2024
91a8f34
Deduplicate lsp locations
Veykril Feb 19, 2024
6e16edb
feat: append `as <name>` when renaming inside an "UseTree".
UserIsntAvailable Feb 4, 2024
69c2532
internal: reduce body lookups in expr diagnostics
rosefromthedead Jan 14, 2024
5390e4c
feat: add non-exhaustive-let diagnostic
rosefromthedead Jan 5, 2024
6dd5dc1
test: fix `disallow_renaming_for_non_local_definition` to follow PR c…
UserIsntAvailable Feb 5, 2024
d8c8ccc
Auto merge of #16358 - krobelus:fix-redundant-references-with-macros,…
bors Feb 19, 2024
ff8fe52
Auto merge of #16303 - rosefromthedead:non-exhaustive-let, r=Veykril
bors Feb 19, 2024
ac1029f
Auto merge of #16489 - UserIsntAvailable:feat/use-import-alias, r=Vey…
bors Feb 19, 2024
e9c80a9
fix: False positive diagnostic for necessary `else`
ShoyuVanilla Feb 14, 2024
d14b228
Handle cases for `else if`
ShoyuVanilla Feb 14, 2024
21f4ff0
Check for let expr ancestors instead of tail expr
ShoyuVanilla Feb 16, 2024
8f6e212
Fix the remove unnecessary else action to preserve block tail expr
ShoyuVanilla Feb 16, 2024
1205853
Apply indent fix in #16575
ShoyuVanilla Feb 16, 2024
ff70310
fix: only emit "unnecessary else" diagnostic for expr stmts
davidsemakula Feb 16, 2024
7dfeb2c
refactor "unnecessary else" diagnostic test
davidsemakula Feb 19, 2024
f2218e7
refactor: remove body parameter for "unnecessary else" diagnostic
davidsemakula Feb 19, 2024
e6b96db
Auto merge of #16590 - davidsemakula:unnecessary-else-diagnostic-fix,…
bors Feb 19, 2024
d818b53
internal: make check_diagnostics_with_disabled more ergonomic
rosefromthedead Feb 16, 2024
a492d9d
feat: add unresolved-ident diagnostic
rosefromthedead Feb 11, 2024
1e448f8
Clippy
Veykril Feb 19, 2024
bbb781e
Auto merge of #16589 - rosefromthedead:unresolved-ident, r=Veykril
bors Feb 19, 2024
d2b27d0
Don't populate rust_ir::AdtVariantDatum::fields for now due to perf
Veykril Feb 19, 2024
2223b4f
Auto merge of #13112 - lowr:patch/auto-trait-bounds, r=Veykril
bors Feb 19, 2024
a822291
Infallible definition hovers
Veykril Feb 19, 2024
d93096e
internal: Fetch toolchain and datalayout for DetachedFiles
Veykril Feb 20, 2024
26a16c4
Auto merge of #16612 - Veykril:detached-files, r=Veykril
bors Feb 20, 2024
85203d9
Render assoc item owner in hover for items other than functions
Veykril Feb 19, 2024
c888724
Auto merge of #16606 - Veykril:hover-extern, r=Veykril
bors Feb 20, 2024
9dee352
fix: server hanging up on build script task
Veykril Feb 20, 2024
9f04957
Auto merge of #16616 - Veykril:build-script-fix, r=Veykril
bors Feb 20, 2024
16b15a2
internal: Attempt to add a timeout to rustc-tests
Veykril Feb 20, 2024
4760d85
Auto merge of #16617 - Veykril:rustc-tests-timeout, r=Veykril
bors Feb 20, 2024
07421c1
fix: Don't add `\` before `{`
DropDemBits Feb 20, 2024
543d7e9
Auto merge of #16618 - DropDemBits:structured-snippet-fix-escape-left…
bors Feb 20, 2024
344a79c
Drop RUSTC_BOOTSTRAP env var when building build scripts
txase Feb 21, 2024
2826eb5
Don't build dependencies when retrieving target data layout
txase Feb 21, 2024
f89d17b
Remove ops_salsa_runtime_mut, replace it with direct synthetic_write API
Veykril Feb 22, 2024
cdfb73a
fix: Fix proc-macro server not accounting for string delimiters corre…
Veykril Feb 22, 2024
efa6948
Fix rust-analyzer not enabling rust-analyzer spans on the proc-macro …
Veykril Feb 22, 2024
1f54f71
Auto merge of #16637 - Veykril:fix-proc-macro-srv-literals, r=Veykril
bors Feb 22, 2024
9b7284d
fix: Fix deadlock in recreate_crate_graph <-> file_line_index
Veykril Feb 23, 2024
6648f19
Auto merge of #16645 - Veykril:deadlock, r=Veykril
bors Feb 23, 2024
6dca794
remove repetitive words
cuishuang Feb 23, 2024
deddea0
Auto merge of #16646 - cuishuang:master, r=lnicola
bors Feb 23, 2024
cc4d0e1
Optimize salsa some more
Veykril Feb 22, 2024
cbc579e
Auto merge of #16643 - Veykril:salsa-opt, r=Veykril
bors Feb 23, 2024
c6a6e63
internal: Pin commit of rust-lang/rust for rustc-test metrics
Veykril Feb 23, 2024
84c5481
Auto merge of #16648 - Veykril:metrics-rustc, r=Veykril
bors Feb 23, 2024
d9a0862
internal: Disable rustc test metrics
Veykril Feb 23, 2024
c45b355
Auto merge of #16649 - Veykril:metrics-rustc, r=Veykril
bors Feb 23, 2024
838523d
Auto merge of #16621 - txase:no-build-with-bootstrap, r=Veykril
bors Feb 23, 2024
0c3a524
Fix: Fix metrics CI failing
Veykril Feb 23, 2024
1214404
Auto merge of #16650 - Veykril:metrics-rustc, r=Veykril
bors Feb 23, 2024
6477973
internal: fix deadlock introduced by #16643
davidbarsky Feb 23, 2024
03b3cb6
Auto merge of #16652 - davidbarsky:david/deadlock-fix-for-16643, r=Ve…
bors Feb 23, 2024
30429f8
feat: Add short flag -V for consistency with other rust tooling
graemer957 Feb 24, 2024
4a8d0f7
Auto merge of #16654 - graemer957:feature/short_version_flag, r=lnicola
bors Feb 24, 2024
4a2588a
Merge commit '4a8d0f7f565b6df45da5522dd7366a4df3460cd7' into sync-fro…
lnicola Feb 25, 2024
9caeabe
Add missing imports
lnicola Feb 25, 2024
5ee6a5d
Avoid using cfg(FALSE)
lnicola Feb 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ jobs:
- name: download typos
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

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: check for typos
run: typos

Expand Down
9 changes: 2 additions & 7 deletions src/tools/rust-analyzer/.github/workflows/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
other_metrics:
strategy:
matrix:
names: [self, rustc_tests, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
runs-on: ubuntu-latest
needs: [setup_cargo, build_metrics]

Expand Down Expand Up @@ -118,11 +118,6 @@ jobs:
with:
name: self-${{ github.sha }}

- name: Download rustc_tests metrics
uses: actions/download-artifact@v3
with:
name: rustc_tests-${{ github.sha }}

- name: Download ripgrep-13.0.0 metrics
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -151,7 +146,7 @@ jobs:
chmod 700 ~/.ssh

git clone --depth 1 [email protected]:rust-analyzer/metrics.git
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
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
cd metrics
git add .
git -c user.name=Bot -c [email protected] commit --message 📈
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

Expand All @@ -78,9 +78,9 @@ jobs:
rustup component add rust-src

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 16

- name: Update apt repositories
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,7 @@ dependencies = [
"dissimilar",
"expect-test",
"indexmap",
"itertools",
"linked-hash-map",
"lock_api",
"oorandom",
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use itertools::Itertools;

use crate::{
hir::{
Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst,
Movability, Statement,
Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst, Movability,
Statement,
},
pretty::{print_generic_args, print_path, print_type_ref},
type_ref::TypeRef,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/data/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct StructData {
}

bitflags! {
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct StructFlags: u8 {
const NO_FLAGS = 0;
/// Indicates whether the struct is `PhantomData`.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ mod tests {
use expect_test::{expect, Expect};
use test_fixture::WithFixture;

use crate::{db::DefDatabase, test_db::TestDB, ItemContainerId, Lookup};
use crate::{test_db::TestDB, ItemContainerId, Lookup};

use super::*;

Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/item_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ use std::{
ops::{Index, Range},
};

use ast::{AstNode, HasName, StructKind};
use ast::{AstNode, StructKind};
use base_db::CrateId;
use either::Either;
use hir_expand::{
ast_id_map::{AstIdNode, FileAstId},
attrs::RawAttrs,
name::{name, AsName, Name},
name::Name,
ExpandTo, HirFileId, InFile,
};
use intern::Interned;
Expand All @@ -67,7 +67,7 @@ use crate::{
attr::Attrs,
db::DefDatabase,
generics::{GenericParams, LifetimeParamData, TypeOrConstParamData},
path::{path, AssociatedTypeBinding, GenericArgs, ImportAlias, ModPath, Path, PathKind},
path::{GenericArgs, ImportAlias, ModPath, Path, PathKind},
type_ref::{Mutability, TraitRef, TypeBound, TypeRef},
visibility::{RawVisibility, VisibilityExplicitness},
BlockId, Lookup,
Expand Down
28 changes: 22 additions & 6 deletions src/tools/rust-analyzer/crates/hir-def/src/item_tree/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@

use std::collections::hash_map::Entry;

use hir_expand::{ast_id_map::AstIdMap, span_map::SpanMapRef};
use syntax::ast::{HasModuleItem, HasTypeBounds, IsString};
use hir_expand::{
ast_id_map::AstIdMap, mod_path::path, name, name::AsName, span_map::SpanMapRef, HirFileId,
};
use la_arena::Arena;
use syntax::{
ast::{self, HasModuleItem, HasName, HasTypeBounds, IsString},
AstNode,
};
use triomphe::Arc;

use crate::{
generics::{GenericParamsCollector, TypeParamData, TypeParamProvenance},
type_ref::{LifetimeRef, TraitBoundModifier},
db::DefDatabase,
generics::{GenericParams, GenericParamsCollector, TypeParamData, TypeParamProvenance},
item_tree::{
AssocItem, AttrOwner, Const, Either, Enum, ExternBlock, ExternCrate, Field, FieldAstId,
Fields, FileItemTreeId, FnFlags, Function, GenericArgs, Idx, IdxRange, Impl, ImportAlias,
Interned, ItemTree, ItemTreeData, ItemTreeNode, Macro2, MacroCall, MacroRules, Mod,
ModItem, ModKind, ModPath, Mutability, Name, Param, ParamAstId, Path, Range, RawAttrs,
RawIdx, RawVisibilityId, Static, Struct, StructKind, Trait, TraitAlias, TypeAlias, Union,
Use, UseTree, UseTreeKind, Variant,
},
path::AssociatedTypeBinding,
type_ref::{LifetimeRef, TraitBoundModifier, TraitRef, TypeBound, TypeRef},
visibility::RawVisibility,
LocalLifetimeParamId, LocalTypeOrConstParamId,
};

use super::*;

fn id<N: ItemTreeNode>(index: Idx<N>) -> FileItemTreeId<N> {
FileItemTreeId(index)
}
Expand Down
14 changes: 10 additions & 4 deletions src/tools/rust-analyzer/crates/hir-def/src/item_tree/pretty.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
//! `ItemTree` debug printer.

use std::fmt::Write;
use std::fmt::{self, Write};

use span::ErasedFileAstId;

use crate::{
generics::{WherePredicate, WherePredicateTypeTarget},
generics::{TypeOrConstParamData, WherePredicate, WherePredicateTypeTarget},
item_tree::{
AttrOwner, Const, DefDatabase, Enum, ExternBlock, ExternCrate, Field, FieldAstId, Fields,
FileItemTreeId, FnFlags, Function, GenericParams, Impl, Interned, ItemTree, Macro2,
MacroCall, MacroRules, Mod, ModItem, ModKind, Param, ParamAstId, Path, RawAttrs,
RawVisibilityId, Static, Struct, Trait, TraitAlias, TypeAlias, TypeBound, TypeRef, Union,
Use, UseTree, UseTreeKind, Variant,
},
pretty::{print_path, print_type_bounds, print_type_ref},
visibility::RawVisibility,
};

use super::*;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ mod tests {
use base_db::SourceDatabase;
use test_fixture::WithFixture;

use crate::{db::DefDatabase, test_db::TestDB};
use crate::test_db::TestDB;

use super::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use expect_test::expect;
use test_fixture::WithFixture;

use itertools::Itertools;

use crate::nameres::tests::check;

use super::*;

#[test]
Expand Down
Loading
Loading