pub fn uninhabited_from(
                &self,
                visited: &mut FxHashSet<(DefId, &'tcx Substs<'tcx>)>,
                tcx: TyCtxt<'a, 'gcx, 'tcx>,
                substs: &'tcx Substs<'tcx>,
                is_enum: bool) -> DefIdForest
    {
        let mut data_uninhabitedness = move || self.ty(tcx, substs).uninhabited_from(visited, tcx);
        // FIXME(canndrew): Currently enum fields are (incorrectly) stored with
        // Visibility::Invisible so we need to override self.vis if we're
        // dealing with an enum.
        if is_enum {
            data_uninhabitedness()
        } else {
            match self.vis {
                Visibility::Invisible => DefIdForest::empty(),
                Visibility::Restricted(from) => {
                    let forest = DefIdForest::from_id(from);
                    let iter = Some(forest).into_iter().chain(Some(data_uninhabitedness()));
                    DefIdForest::intersection(tcx, iter)
                },
                Visibility::Public => data_uninhabitedness(),
            }
        }
    }
/// Calculate the forest of DefIds from which this field is visibly uninhabited.
Calculate the forest of DefIds from which this field is visibly uninhabited.
Calculate the forest of DefIds from which this field is visibly uninhabited .
pub fn uninhabited_from(
                &self,
                visited: &mut FxHashSet<(DefId, &'tcx Substs<'tcx>)>,
                tcx: TyCtxt<'a, 'gcx, 'tcx>,
                substs: &'tcx Substs<'tcx>,
                is_enum: bool) -> DefIdForest
    {
        let mut data_uninhabitedness = move || self.ty(tcx, substs).uninhabited_from(visited, tcx);
        // FIXME(canndrew): Currently enum fields are (incorrectly) stored with
        // Visibility::Invisible so we need to override self.vis if we're
        // dealing with an enum.
        if is_enum {
            data_uninhabitedness()
        } else {
            match self.vis {
                Visibility::Invisible => DefIdForest::empty(),
                Visibility::Restricted(from) => {
                    let forest = DefIdForest::from_id(from);
                    let iter = Some(forest).into_iter().chain(Some(data_uninhabitedness()));
                    DefIdForest::intersection(tcx, iter)
                },
                Visibility::Public => data_uninhabitedness(),
            }
        }
    }
pub fn uninhabited_from ( & self , visited : & mut FxHashSet < ( DefId , & ' tcx Substs < ' tcx > ) > , tcx : TyCtxt < ' a , ' gcx , ' tcx > , substs : & ' tcx Substs < ' tcx > , is_enum : bool ) -> DefIdForest { let mut data_uninhabitedness = move | | self . ty ( tcx , substs ) . uninhabited_from ( visited , tcx ) ; // FIXME(canndrew): Currently enum fields are (incorrectly) stored with // Visibility::Invisible so we need to override self.vis if we're // dealing with an enum. if is_enum { data_uninhabitedness ( ) } else { match self . vis { Visibility :: Invisible => DefIdForest :: empty ( ) , Visibility :: Restricted ( from ) => { let forest = DefIdForest :: from_id ( from ) ; let iter = Some ( forest ) . into_iter ( ) . chain ( Some ( data_uninhabitedness ( ) ) ) ; DefIdForest :: intersection ( tcx , iter ) } , Visibility :: Public => data_uninhabitedness ( ) , } } }
Calculate the forest of DefIds from which this field is visibly uninhabited.
Calculate the forest of DefIds from which this field is visibly uninhabited .
&self
visited
&mut FxHashSet<(DefId, &'tcx Substs<'tcx>)>
tcx
TyCtxt<'a, 'gcx, 'tcx>
substs
&'tcx Substs<'tcx>
is_enum
bool
&self
visited
&mut FxHashSet<(DefId, &'tcx Substs<'tcx>)>
tcx
TyCtxt<'a, 'gcx, 'tcx>
substs
&'tcx Substs<'tcx>
is_enum
bool