Skip to content

Commit aa0875a

Browse files
committed
Improve conservative_is_uninhabited comment
1 parent 1cf94f5 commit aa0875a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustc/ty/sty.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,10 +1504,14 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15041504
}
15051505
}
15061506

1507+
/// Checks whether a type is definitely uninhabited. This is
1508+
/// conservative: for some types that are uninhabited we return `false`,
1509+
/// but we only return `true` for types that are definitely uninhabited.
1510+
/// `ty.conservative_is_uninhabited` implies that any value of type `ty`
1511+
/// will be `Abi::Uninhabited`.
15071512
pub fn conservative_is_uninhabited(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> bool {
1508-
// Checks whether a type is definitely uninhabited. This is
1509-
// conservative: for some types that are uninhabited we return `false`,
1510-
// but we only return `true` for types that are definitely uninhabited.
1513+
// FIXME(varkor): we can make this less conversative by substituting concrete
1514+
// type arguments.
15111515
match self.sty {
15121516
ty::Never => true,
15131517
ty::Adt(def, _) if def.is_union() => {

0 commit comments

Comments
 (0)