Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbarsky committed Mar 10, 2025
1 parent e14f9d2 commit f956b77
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion crates/hir-def/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ fn hygiene_info(
) -> Option<(SyntaxContextId, MacroDefId)> {
if !hygiene_id.is_root() {
let ctx = hygiene_id.lookup();
ctx.outer_expn(db).map(|expansion|{
ctx.outer_expn(db).map(|expansion| {
let expansion = db.lookup_intern_macro_call(expansion);
(ctx.parent(db), expansion.def)
})
Expand Down
4 changes: 1 addition & 3 deletions crates/hir-expand/src/change.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Defines a unit of change that can applied to the database to get the next
//! state. Changes are transactional.
use base_db::{
CrateGraph, CrateId, CrateWorkspaceData, FileChange, SourceRoot,
};
use base_db::{CrateGraph, CrateId, CrateWorkspaceData, FileChange, SourceRoot};
use rustc_hash::FxHashMap;
use salsa::Durability;
use span::FileId;
Expand Down
12 changes: 8 additions & 4 deletions crates/hir-ty/src/consteval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ use stdx::never;
use triomphe::Arc;

use crate::{
db::{HirDatabase, HirDatabaseData}, display::DisplayTarget, generics::Generics, infer::InferenceContext,
lower::ParamLoweringMode, mir::monomorphize_mir_body_bad, to_placeholder_idx, Const, ConstData,
ConstScalar, ConstValue, GenericArg, Interner, MemoryMap, Substitution, TraitEnvironment, Ty,
TyBuilder,
db::{HirDatabase, HirDatabaseData},
display::DisplayTarget,
generics::Generics,
infer::InferenceContext,
lower::ParamLoweringMode,
mir::monomorphize_mir_body_bad,
to_placeholder_idx, Const, ConstData, ConstScalar, ConstValue, GenericArg, Interner, MemoryMap,
Substitution, TraitEnvironment, Ty, TyBuilder,
};

use super::mir::{interpret_mir, lower_to_mir, pad16, MirEvalError, MirLowerError};
Expand Down
4 changes: 1 addition & 3 deletions crates/hir-ty/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> + std::fmt::Debug {
#[salsa::invoke_actual(crate::lower::generic_predicates_query)]
fn generic_predicates(&self, def: GenericDefId) -> GenericPredicates;

#[salsa::invoke_actual(
crate::lower::generic_predicates_without_parent_with_diagnostics_query
)]
#[salsa::invoke_actual(crate::lower::generic_predicates_without_parent_with_diagnostics_query)]
fn generic_predicates_without_parent_with_diagnostics(
&self,
def: GenericDefId,
Expand Down
3 changes: 1 addition & 2 deletions crates/hir/src/semantics/source_to_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ impl SourceToDefCtx<'_, '_> {
self.cache.file_to_def_cache.entry(file).or_insert_with(|| {
let mut mods = SmallVec::new();

for &crate_id in
Upcast::<dyn RootQueryDb>::upcast(self.db).relevant_crates(file).iter()
for &crate_id in Upcast::<dyn RootQueryDb>::upcast(self.db).relevant_crates(file).iter()
{
// Note: `mod` declarations in block modules cannot be supported here
let crate_def_map = self.db.crate_def_map(crate_id);
Expand Down
9 changes: 1 addition & 8 deletions crates/ide-diagnostics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,7 @@ pub fn semantic_diagnostics(
(*db.crate_graph().crates_in_topological_order().last().unwrap()).into()
});
let display_target = krate.to_display_target(db);
let ctx = DiagnosticsContext {
config,
sema,
resolve,
edition,
is_nightly,
display_target,
};
let ctx = DiagnosticsContext { config, sema, resolve, edition, is_nightly, display_target };

let mut diags = Vec::new();
match module {
Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/static_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use hir::{db::HirDatabase, Crate, HirFileIdExt, Module, Semantics};
use ide_db::{
base_db::{SourceDatabase, RootQueryDb, VfsPath},
base_db::{RootQueryDb, SourceDatabase, VfsPath},
defs::Definition,
documentation::Documentation,
famous_defs::FamousDefs,
Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(crate) fn on_char_typed(
let edition = Edition::CURRENT_FIXME;
let editioned_file_id_wrapper = ide_db::base_db::EditionedFileId::new(
db.as_dyn_database(),
EditionedFileId::new(position.file_id, edition)
EditionedFileId::new(position.file_id, edition),
);
let file = &db.parse(editioned_file_id_wrapper);
let char_matches_position =
Expand Down

0 comments on commit f956b77

Please sign in to comment.