Skip to content

Subtree update of rust-analyzer #143246

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

Merged
merged 76 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
de5c506
update to literal-escaper 0.0.4 for better API without `unreachable` …
hkBst Mar 7, 2025
74e92a8
Format goto_type_definition
lnicola Jun 16, 2025
47b29ea
In "Wrap return type" assist, don't wrap exit points if they already …
ChayimFriedman2 Jun 22, 2025
a78bc7c
Don't run doctests
ChayimFriedman2 Jun 22, 2025
3db7cff
Preparing for merge from rust-lang/rust
lnicola Jun 23, 2025
3c4a690
Merge from rust-lang/rust
lnicola Jun 23, 2025
18855c9
Document sysroot_project field in rust-project.json
Wilfred Jun 23, 2025
4b37534
Merge pull request #20063 from lnicola/sync-from-rust
lnicola Jun 23, 2025
d0ebff0
fix: Fix cargo project manifest not pointing to the workspace root
Veykril Jun 23, 2025
6c3a870
Merge pull request #20069 from Veykril/push-mnqkqxomtlxn
Veykril Jun 23, 2025
b3c7913
fix: Use `ROOT` hygiene for `args` inside new `format_args!` expansion
ShoyuVanilla Jun 23, 2025
dd142e4
Merge pull request #20073 from ShoyuVanilla/fix-fmt-args-hygiene
ChayimFriedman2 Jun 23, 2025
c37994c
fix: Respect `.cargo/config.toml` `build.target-dir`
Veykril Jun 23, 2025
e40aa42
Add troubleshooting FAQ to the book
ChayimFriedman2 Jun 23, 2025
c751049
Merge pull request #20076 from ChayimFriedman2/faq
lnicola Jun 23, 2025
98e7b94
feat: Extend vscode 'run' command with optional mode argument for run…
markpots5 Jun 23, 2025
7ce7c2e
Merge pull request #20072 from Veykril/push-sorvvvzskywv
Veykril Jun 24, 2025
c30af1b
Merge pull request #20062 from ChayimFriedman2/doctests
Veykril Jun 24, 2025
1d3b517
Do not default to 'static for trait object lifetimes
Veykril Jun 18, 2025
bb164bf
Merge pull request #20036 from Veykril/push-yquvoyrxkksx
Veykril Jun 24, 2025
04c9089
Merge pull request #20064 from Wilfred/document_sysroot_project
Veykril Jun 24, 2025
e8388b0
Merge pull request #20061 from ChayimFriedman2/wrap-ret-ty
Veykril Jun 24, 2025
40aeda9
Cleanup `folding_ranges` and support more things
Veykril Jun 24, 2025
1fffcff
Merge pull request #20080 from Veykril/push-vnrwqppplykm
Veykril Jun 24, 2025
0b648f8
Merge pull request #20012 from lnicola/bump-literal-escaper
Veykril Jun 24, 2025
7eb776e
Remove special casing in command factory (revert changes in ctx.ts), …
markpots5 Jun 24, 2025
18e008b
ci: Fix cancel parallel jobs on windows
ShoyuVanilla Jun 24, 2025
8b52bab
Short circuit a couple hir-ty/lower queries
Veykril Jun 24, 2025
6968130
Merge pull request #20087 from Veykril/push-rrtkwpzmmwwz
Veykril Jun 24, 2025
abb956b
Fix link in the book
ChayimFriedman2 Jun 25, 2025
4e61517
Merge pull request #20089 from ChayimFriedman2/faq
ChayimFriedman2 Jun 25, 2025
19b1938
De-arc trait items query
Veykril Jun 24, 2025
d083ae8
Merge pull request #20084 from ShoyuVanilla/fix-windows-cancel-par
Veykril Jun 25, 2025
0876a56
Merge pull request #20077 from markpots5/master
Veykril Jun 25, 2025
ca062eb
Merge pull request #20088 from Veykril/push-qrslvzzlqqoz
Veykril Jun 25, 2025
7d6f77f
Drop rustc workspace loading error, if we don't needs its sources
Veykril Jun 25, 2025
cd4100d
Merge pull request #20092 from Veykril/push-kollxvpyknqs
Veykril Jun 25, 2025
a12b96f
Don't show notifications on failed rustfmt calls
lnicola Jun 25, 2025
a010990
Adjust minicore for Sized Hierarchy changes
Veykril Jun 25, 2025
889770a
Merge pull request #20096 from lnicola/silence-rustfmt-failed
Veykril Jun 25, 2025
587ded9
Unify formatting of progress messages
regexident Jun 25, 2025
ed5618f
minor: Decrease minimal toolchain version for `comp-time-deps` by `0.1`
ShoyuVanilla Jun 25, 2025
fb8ff25
Merge pull request #20098 from regexident/cleanup-progress-messages
davidbarsky Jun 25, 2025
3e5c46f
Merge pull request #20101 from ShoyuVanilla/comp-time-deps-sooner
lnicola Jun 26, 2025
62e112a
feat: highlighting of related return values while the cursor is on an…
roife Apr 9, 2025
4373a5d
refactor: improve macro handling in navigation for control-flow kws
roife Apr 9, 2025
7ab46b4
refactor: rename `branches` to `branch_exit_points` in highlight_related
roife Apr 15, 2025
bff9f4c
refactor: simplify functions related to branch_exit_points in highlig…
roife Apr 15, 2025
dc9e9fd
refactor: enhance highlighting for control flow kws in macros
roife Jun 26, 2025
54c14fc
Prettify AST in `PathTransform` if it's coming from a macro
ChayimFriedman2 Jun 26, 2025
a45726d
Merge pull request #19546 from roife/branch-value-highlights
Veykril Jun 26, 2025
0af0367
Cleanup `provideCodeActions` vscode hook
Veykril Jun 26, 2025
50a540c
Merge pull request #20104 from Veykril/push-nqnmmlvksyty
Veykril Jun 26, 2025
c190510
Parse new const trait syntax
Veykril Jun 26, 2025
4a50562
Merge pull request #20105 from Veykril/push-qtmwnuqvsruw
Veykril Jun 26, 2025
919e8ef
Salsa idiomize `VariantFields` query
Veykril Jun 26, 2025
d3b9969
Merge pull request #20103 from ChayimFriedman2/path-transform-prettify
Veykril Jun 26, 2025
e019a37
Bring back the firewall query
Veykril Jun 26, 2025
7f03278
Merge pull request #20106 from Veykril/push-pytuxksnntux
Veykril Jun 26, 2025
1bd7565
Backport new sized-hierarchy trait bounds in old ways
ShoyuVanilla Jun 25, 2025
1a2e7aa
Merge pull request #20100 from ShoyuVanilla/ignore-sized-hierarchy
ChayimFriedman2 Jun 26, 2025
5996241
Fix completion in when typing `integer.|`
ChayimFriedman2 Jun 26, 2025
502bac3
Merge pull request #20110 from ChayimFriedman2/ambiguous-float
Veykril Jun 27, 2025
ea2e042
ci: Cancel workflow only after the main matrix has finished
Veykril Jun 28, 2025
9cd5826
Merge pull request #20116 from Veykril/push-uypnmlyvotlm
Veykril Jun 28, 2025
0f93d8a
ci: Fix up release workflow
Veykril Jun 28, 2025
7d5579d
Merge pull request #20118 from Veykril/push-nolsxzxmykls
Veykril Jun 28, 2025
0609735
Do not append `--compile-time-deps` to overwritten build script commands
Veykril Jun 29, 2025
638329b
Merge pull request #20121 from Veykril/push-vkkuutpsuypq
Veykril Jun 29, 2025
a203e41
Remove unnecessary parens in closure
chenyukang Jun 29, 2025
2a66a5b
Merge pull request #20122 from chenyukang/yukang-fix-remove-parens
ChayimFriedman2 Jun 29, 2025
bc06bb1
Remove last use of `rustc_pat_analysis::Captures`
zachs18 Jun 30, 2025
863d0b5
Merge pull request #20124 from zachs18/patch-1
Veykril Jun 30, 2025
3b5b350
Preparing for merge from rust-lang/rust
lnicola Jun 30, 2025
0edf572
Merge from rust-lang/rust
lnicola Jun 30, 2025
c5f4b80
Merge pull request #20128 from lnicola/sync-from-rust
lnicola Jun 30, 2025
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
39 changes: 24 additions & 15 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ env:
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10

defaults:
run:
shell: bash

jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -80,6 +84,7 @@ jobs:
CC: deny_c

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

Expand All @@ -99,7 +104,7 @@ jobs:
rustup toolchain install nightly --profile minimal --component rustfmt
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
- name: Install Rust Problem Matcher
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'macos-latest'
run: echo "::add-matcher::.github/rust.json"

# - name: Cache Dependencies
Expand All @@ -116,23 +121,9 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: cargo codegen --check

- name: Compile tests
run: cargo test --no-run

- name: Run tests
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail

- name: Cancel parallel jobs
if: failure()
run: |
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
curl -L \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel

- name: Run Clippy
if: matrix.os == 'macos-latest'
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
Expand Down Expand Up @@ -333,3 +324,21 @@ jobs:
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

cancel-if-matrix-failed:
needs: rust
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Cancel parallel jobs
run: |
if jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'; then
exit 0
fi
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
curl -L \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ jobs:

- name: Run analysis-stats on rust-analyzer
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats .
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats . -q

- name: Run analysis-stats on rust std library
if: matrix.target == 'x86_64-unknown-linux-gnu'
env:
RUSTC_BOOTSTRAP: 1
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std -q

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ dependencies = [
"edition",
"expect-test",
"ra-ap-rustc_lexer",
"rustc-literal-escaper 0.0.3",
"rustc-literal-escaper 0.0.4",
"stdx",
"tracing",
]
Expand Down Expand Up @@ -1927,9 +1927,9 @@ checksum = "0041b6238913c41fe704213a4a9329e2f685a156d1781998128b4149c230ad04"

[[package]]
name = "rustc-literal-escaper"
version = "0.0.3"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78744cd17f5d01c75b709e49807d1363e02a940ccee2e9e72435843fdb0d076e"
checksum = "ab03008eb631b703dd16978282ae36c73282e7922fe101a4bd072a40ecea7b8b"

[[package]]
name = "rustc-stable-hash"
Expand Down Expand Up @@ -2207,7 +2207,7 @@ dependencies = [
"rayon",
"rowan",
"rustc-hash 2.1.1",
"rustc-literal-escaper 0.0.3",
"rustc-literal-escaper 0.0.4",
"rustc_apfloat",
"smol_str",
"stdx",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ serde = { version = "1.0.219" }
serde_derive = { version = "1.0.219" }
serde_json = "1.0.140"
rustc-hash = "2.1.1"
rustc-literal-escaper = "0.0.3"
rustc-literal-escaper = "0.0.4"
smallvec = { version = "1.15.1", features = [
"const_new",
"union",
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/base-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
la-arena.workspace = true
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/cfg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
rustc-hash.workspace = true
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/hir-def/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
arrayvec.workspace = true
Expand Down
21 changes: 1 addition & 20 deletions src/tools/rust-analyzer/crates/hir-def/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ use crate::{
import_map::ImportMap,
item_tree::{ItemTree, file_item_tree_query},
lang_item::{self, LangItem},
nameres::{assoc::TraitItems, crate_def_map, diagnostics::DefDiagnostics},
nameres::crate_def_map,
signatures::{
ConstSignature, EnumSignature, FunctionSignature, ImplSignature, StaticSignature,
StructSignature, TraitAliasSignature, TraitSignature, TypeAliasSignature, UnionSignature,
VariantFields,
},
tt,
visibility::{self, Visibility},
Expand Down Expand Up @@ -113,24 +112,6 @@ pub trait DefDatabase: InternDatabase + ExpandDatabase + SourceDatabase {

// region:data

#[salsa::invoke(VariantFields::query)]
fn variant_fields_with_source_map(
&self,
id: VariantId,
) -> (Arc<VariantFields>, Arc<ExpressionStoreSourceMap>);

#[salsa::transparent]
#[salsa::invoke(TraitItems::trait_items_query)]
fn trait_items(&self, e: TraitId) -> Arc<TraitItems>;

#[salsa::invoke(TraitItems::trait_items_with_diagnostics_query)]
fn trait_items_with_diagnostics(&self, tr: TraitId) -> (Arc<TraitItems>, DefDiagnostics);

#[salsa::tracked]
fn variant_fields(&self, id: VariantId) -> Arc<VariantFields> {
self.variant_fields_with_source_map(id).0
}

#[salsa::tracked]
fn trait_signature(&self, trait_: TraitId) -> Arc<TraitSignature> {
self.trait_signature_with_source_map(trait_).0
Expand Down
18 changes: 17 additions & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/expr_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ pub mod scope;
#[cfg(test)]
mod tests;

use std::ops::{Deref, Index};
use std::{
ops::{Deref, Index},
sync::LazyLock,
};

use cfg::{CfgExpr, CfgOptions};
use either::Either;
Expand All @@ -19,6 +22,7 @@ use rustc_hash::FxHashMap;
use smallvec::SmallVec;
use span::{Edition, SyntaxContext};
use syntax::{AstPtr, SyntaxNodePtr, ast};
use triomphe::Arc;
use tt::TextRange;

use crate::{
Expand Down Expand Up @@ -220,6 +224,12 @@ impl ExpressionStoreBuilder {
}

impl ExpressionStore {
pub fn empty_singleton() -> Arc<Self> {
static EMPTY: LazyLock<Arc<ExpressionStore>> =
LazyLock::new(|| Arc::new(ExpressionStoreBuilder::default().finish()));
EMPTY.clone()
}

/// Returns an iterator over all block expressions in this store that define inner items.
pub fn blocks<'a>(
&'a self,
Expand Down Expand Up @@ -636,6 +646,12 @@ impl Index<PathId> for ExpressionStore {
// FIXME: Change `node_` prefix to something more reasonable.
// Perhaps `expr_syntax` and `expr_id`?
impl ExpressionStoreSourceMap {
pub fn empty_singleton() -> Arc<Self> {
static EMPTY: LazyLock<Arc<ExpressionStoreSourceMap>> =
LazyLock::new(|| Arc::new(ExpressionStoreSourceMap::default()));
EMPTY.clone()
}

pub fn expr_or_pat_syntax(&self, id: ExprOrPatId) -> Result<ExprOrPatSource, SyntheticSyntax> {
match id {
ExprOrPatId::ExprId(id) => self.expr_syntax(id),
Expand Down
35 changes: 18 additions & 17 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ impl ExprCollector<'_> {
Some(ModuleDefId::ConstId(_)) => (None, Pat::Path(name.into())),
Some(ModuleDefId::EnumVariantId(variant))
// FIXME: This can cause a cycle if the user is writing invalid code
if self.db.variant_fields(variant.into()).shape != FieldsShape::Record =>
if variant.fields(self.db).shape != FieldsShape::Record =>
{
(None, Pat::Path(name.into()))
}
Expand Down Expand Up @@ -2825,14 +2825,7 @@ impl ExprCollector<'_> {
let use_format_args_since_1_89_0 = fmt_args().is_some() && fmt_unsafe_arg().is_none();

let idx = if use_format_args_since_1_89_0 {
self.collect_format_args_impl(
syntax_ptr,
fmt,
hygiene,
argmap,
lit_pieces,
format_options,
)
self.collect_format_args_impl(syntax_ptr, fmt, argmap, lit_pieces, format_options)
} else {
self.collect_format_args_before_1_89_0_impl(
syntax_ptr,
Expand Down Expand Up @@ -2962,7 +2955,6 @@ impl ExprCollector<'_> {
&mut self,
syntax_ptr: AstPtr<ast::Expr>,
fmt: FormatArgs,
hygiene: HygieneId,
argmap: FxIndexSet<(usize, ArgumentType)>,
lit_pieces: ExprId,
format_options: ExprId,
Expand Down Expand Up @@ -2997,8 +2989,11 @@ impl ExprCollector<'_> {
let args =
self.alloc_expr_desugared(Expr::Array(Array::ElementList { elements: args }));
let args_name = Name::new_symbol_root(sym::args);
let args_binding =
self.alloc_binding(args_name.clone(), BindingAnnotation::Unannotated, hygiene);
let args_binding = self.alloc_binding(
args_name.clone(),
BindingAnnotation::Unannotated,
HygieneId::ROOT,
);
let args_pat = self.alloc_pat_desugared(Pat::Bind { id: args_binding, subpat: None });
self.add_definition_to_binding(args_binding, args_pat);
// TODO: We don't have `super let` yet.
Expand All @@ -3008,13 +3003,16 @@ impl ExprCollector<'_> {
initializer: Some(args),
else_branch: None,
};
(vec![let_stmt], self.alloc_expr_desugared(Expr::Path(Path::from(args_name))))
(vec![let_stmt], self.alloc_expr_desugared(Expr::Path(args_name.into())))
} else {
// Generate:
// super let args = (&arg0, &arg1, &...);
let args_name = Name::new_symbol_root(sym::args);
let args_binding =
self.alloc_binding(args_name.clone(), BindingAnnotation::Unannotated, hygiene);
let args_binding = self.alloc_binding(
args_name.clone(),
BindingAnnotation::Unannotated,
HygieneId::ROOT,
);
let args_pat = self.alloc_pat_desugared(Pat::Bind { id: args_binding, subpat: None });
self.add_definition_to_binding(args_binding, args_pat);
let elements = arguments
Expand Down Expand Up @@ -3057,8 +3055,11 @@ impl ExprCollector<'_> {
.collect();
let array =
self.alloc_expr_desugared(Expr::Array(Array::ElementList { elements: args }));
let args_binding =
self.alloc_binding(args_name.clone(), BindingAnnotation::Unannotated, hygiene);
let args_binding = self.alloc_binding(
args_name.clone(),
BindingAnnotation::Unannotated,
HygieneId::ROOT,
);
let args_pat = self.alloc_pat_desugared(Pat::Bind { id: args_binding, subpat: None });
self.add_definition_to_binding(args_binding, args_pat);
let let_stmt2 = Statement::Let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub fn print_variant_body_hir(db: &dyn DefDatabase, owner: VariantId, edition: E
VariantId::UnionId(it) => format!("union {}", item_name(db, it, "<missing>")),
};

let fields = db.variant_fields(owner);
let fields = owner.fields(db);

let mut p = Printer {
db,
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/hir/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ impl GenericParams {
}

#[inline]
pub fn no_predicates(&self) -> bool {
pub fn has_no_predicates(&self) -> bool {
self.where_predicates.is_empty()
}

#[inline]
pub fn where_predicates(&self) -> std::slice::Iter<'_, WherePredicate> {
self.where_predicates.iter()
pub fn where_predicates(&self) -> &[WherePredicate] {
&self.where_predicates
}

/// Iterator of type_or_consts field
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/crates/hir-def/src/import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
AssocItemId, AttrDefId, Complete, FxIndexMap, ModuleDefId, ModuleId, TraitId,
db::DefDatabase,
item_scope::{ImportOrExternCrate, ItemInNs},
nameres::{DefMap, crate_def_map},
nameres::{DefMap, assoc::TraitItems, crate_def_map},
visibility::Visibility,
};

Expand Down Expand Up @@ -221,7 +221,7 @@ impl ImportMap {
trait_import_info: &ImportInfo,
) {
let _p = tracing::info_span!("collect_trait_assoc_items").entered();
for &(ref assoc_item_name, item) in &db.trait_items(tr).items {
for &(ref assoc_item_name, item) in &TraitItems::query(db, tr).items {
let module_def_id = match item {
AssocItemId::FunctionId(f) => ModuleDefId::from(f),
AssocItemId::ConstId(c) => ModuleDefId::from(c),
Expand Down Expand Up @@ -482,7 +482,7 @@ mod tests {
use expect_test::{Expect, expect};
use test_fixture::WithFixture;

use crate::{ItemContainerId, Lookup, test_db::TestDB};
use crate::{ItemContainerId, Lookup, nameres::assoc::TraitItems, test_db::TestDB};

use super::*;

Expand Down Expand Up @@ -580,7 +580,7 @@ mod tests {

let trait_info = dependency_imports.import_info_for(ItemInNs::Types(trait_id.into()))?;

let trait_items = db.trait_items(trait_id);
let trait_items = TraitItems::query(db, trait_id);
let (assoc_item_name, _) = trait_items
.items
.iter()
Expand Down
Loading
Loading