Skip to content

Commit

Permalink
fix hir-ty's drop glue
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbarsky committed Feb 27, 2025
1 parent 2ae1916 commit 96c645e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub use semver::{BuildMetadata, Prerelease, Version, VersionReq};
use syntax::{ast, Parse, SyntaxError};
use triomphe::Arc;
pub use vfs::{file_set::FileSet, AnchoredPath, AnchoredPathBuf, VfsPath};
use vfs::{AbsPathBuf, FileId};
use vfs::FileId;

#[macro_export]
macro_rules! impl_intern_key {
Expand Down
6 changes: 3 additions & 3 deletions crates/hir-ty/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> + std::fmt::Debug {
env: chalk_ir::Environment<Interner>,
) -> chalk_ir::ProgramClauses<Interner>;

#[ra_salsa::invoke(crate::drop::has_drop_glue)]
#[ra_salsa::cycle(crate::drop::has_drop_glue_recover)]
fn has_drop_glue(&self, ty: Ty, env: Arc<TraitEnvironment>) -> DropGlue {}
#[db_ext_macro::invoke(crate::drop::has_drop_glue)]
#[db_ext_macro::cycle(crate::drop::has_drop_glue_recover)]
fn has_drop_glue(&self, ty: Ty, env: Arc<TraitEnvironment>) -> DropGlue;
}

#[test]
Expand Down
9 changes: 5 additions & 4 deletions crates/hir-ty/src/drop.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Utilities for computing drop info about types.
use base_db::ra_salsa;
use chalk_ir::cast::Cast;
use hir_def::data::adt::StructFlags;
use hir_def::lang_item::LangItem;
use hir_def::AdtId;
use stdx::never;
use triomphe::Arc;

use crate::db::HirDatabaseData;
use crate::{
db::HirDatabase, method_resolution::TyFingerprint, AliasTy, Canonical, CanonicalVarKinds,
InEnvironment, Interner, ProjectionTy, TraitEnvironment, Ty, TyBuilder, TyKind,
Expand Down Expand Up @@ -201,9 +201,10 @@ fn is_copy(db: &dyn HirDatabase, ty: Ty, env: Arc<TraitEnvironment>) -> bool {

pub(crate) fn has_drop_glue_recover(
_db: &dyn HirDatabase,
_cycle: &ra_salsa::Cycle,
_ty: &Ty,
_env: &Arc<TraitEnvironment>,
_cycle: &salsa::Cycle,
_: HirDatabaseData,
_ty: Ty,
_env: Arc<TraitEnvironment>,
) -> DropGlue {
DropGlue::None
}

0 comments on commit 96c645e

Please sign in to comment.