Skip to content
Merged
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion crates/hir_def/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ use stdx::impl_from;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ModuleId {
krate: CrateId,
/// If this `ModuleId` was derived from a `DefMap` for a block expression, this stores the
/// `BlockId` of that block expression. If `None`, this module is part of the crate-level
/// `DefMap` of `krate`.
block: Option<BlockId>,
/// The module's ID in its originating `DefMap`.
pub local_id: LocalModuleId,
}

Expand All @@ -87,7 +91,7 @@ impl ModuleId {
db.block_def_map(block).unwrap_or_else(|| {
// NOTE: This should be unreachable - all `ModuleId`s come from their `DefMap`s,
// so the `DefMap` here must exist.
panic!("no `block_def_map` for `ModuleId` {:?}", self);
unreachable!("no `block_def_map` for `ModuleId` {:?}", self);
})
}
None => db.crate_def_map(self.krate),
Expand Down