feat: deriving BEq, Hashable for Lean.Import (#10018)

This PR derives `BEq` and `Hashable` for `Lean.Import`. Lake already did
this later, but it now done when defining `Import`.

Doing this in Lake became problematic when porting it to the module
system (#9749).
This commit is contained in:
Mac Malone 2025-08-21 03:53:30 -04:00 committed by GitHub
parent 0b0d183c1d
commit 26fdc1e19a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -29,7 +29,8 @@ structure Import where
isExported : Bool := true
/-- Whether all definitions (transitively) reachable through the -/
isMeta : Bool := false
deriving Repr, Inhabited, ToJson, FromJson
deriving Repr, Inhabited, ToJson, FromJson,
BEq, Hashable -- needed by Lake (in `Lake.Load.Elab.Lean`)
instance : Coe Name Import := ⟨({module := ·})⟩

View file

@ -21,8 +21,6 @@ open System Lean
namespace Lake
deriving instance BEq, Hashable for Import
/- Cache for the imported header environment of Lake configuration files. -/
builtin_initialize importEnvCache : IO.Ref (Std.HashMap (Array Import) Environment) ← IO.mkRef {}