Skip to content

Commit ffd79c2

Browse files
committed
Add docs
1 parent 8ae58b9 commit ffd79c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/hir-ty/src/inhabitedness.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Type inhabitedness logic.
12
use std::ops::ControlFlow::{self, Break, Continue};
23

34
use chalk_ir::{
@@ -13,12 +14,14 @@ use crate::{
1314
db::HirDatabase, Binders, ConcreteConst, Const, ConstValue, Interner, Substitution, Ty, TyKind,
1415
};
1516

17+
/// Checks whether a type is visibly uninhabited from a particular module.
1618
pub(crate) fn is_ty_uninhabited_from(ty: &Ty, target_mod: ModuleId, db: &dyn HirDatabase) -> bool {
1719
let mut uninhabited_from = UninhabitedFrom { target_mod, db };
1820
let inhabitedness = ty.visit_with(&mut uninhabited_from, DebruijnIndex::INNERMOST);
1921
inhabitedness == BREAK_VISIBLY_UNINHABITED
2022
}
2123

24+
/// Checks whether a variant is visibly uninhabited from a particular module.
2225
pub(crate) fn is_enum_variant_uninhabited_from(
2326
variant: EnumVariantId,
2427
subst: &Substitution,

0 commit comments

Comments
 (0)