pub fn incompats(&mut self, pkg: &Summary) -> Result<Vec<Incompatibility>, Error> {
        if pkg == &self.root {
            let mut res = vec![];
            for dep in &self.root_deps {
                res.push(Incompatibility::from_dep(
                    pkg.clone(),
                    (dep.0.clone(), dep.1.complement()),
                ));
            }
            return Ok(res);
        }

        let def_index = self.def_index.clone();

        // If this is a DirectRes dep, we ask the cache for info.
        if let Resolution::Direct(loc) = pkg.resolution() {
            let deps = self
                .direct_checkout(pkg.id(), loc)?
                .meta()
                .deps(&def_index, false);
            let mut res = vec![];
            for dep in deps {
                res.push(Incompatibility::from_dep(
                    pkg.clone(),
                    (dep.0.clone(), dep.1.complement()),
                ));
            }
            return Ok(res);
        }

        let entries = self.indices.entries(pkg.id())?;

        let l = entries.len();

        let (ix, ver, start_deps) = entries
            .get_full(pkg.version())
            .map(|x| (x.0, x.1, &x.2.dependencies))
            .ok_or_else(|| ErrorKind::PackageNotFound)?;
        let mut res = vec![];

        for dep in start_deps {
            let mut lix = ix;
            let mut lower = ver;
            let mut rix = ix;
            let mut upper = ver;

            while lix > 0 {
                lix -= 1;
                let new = entries.get_index(lix).unwrap();
                let new_deps = &new.1.dependencies;
                let mut seen = false;
                for new_dep in new_deps {
                    if dep.name == new_dep.name && dep.index == new_dep.index {
                        let rel = dep.req.relation(&new_dep.req);
                        if rel == Relation::Equal || rel == Relation::Superset {
                            seen = true;
                            lower = &new.0;
                        } else {
                            seen = false;
                        }
                    }
                }
                if !seen {
                    lix += 1;
                    break;
                }
            }

            while rix < l - 1 {
                rix += 1;
                let new = entries.get_index(rix).unwrap();
                let new_deps = &new.1.dependencies;
                let mut seen = false;
                for new_dep in new_deps {
                    if dep.name == new_dep.name && dep.index == new_dep.index {
                        let rel = dep.req.relation(&new_dep.req);
                        if rel == Relation::Equal || rel == Relation::Superset {
                            seen = true;
                            upper = &new.0;
                        } else {
                            seen = false;
                        }
                    }
                }
                if !seen {
                    rix -= 1;
                    break;
                }
            }

            let nl = if lix == 0 && rix == l - 1 {
                Interval::Unbounded
            } else {
                Interval::Closed(lower.clone(), false)
            };

            let nu = if lix == 0 && rix == l - 1 {
                Interval::Unbounded
            } else {
                Interval::Closed(upper.clone(), false)
            };

            let dep_pkg = PackageId::new(dep.name.clone(), dep.index.clone().into());

            let cs = indexmap!(
                pkg.id().clone() => Range::new(nl, nu).unwrap().into(),
                dep_pkg => dep.req.complement(),
            );

            res.push(Incompatibility::new(cs, IncompatibilityCause::Dependency))
        }

        Ok(res)
    }
/// Returns a `Vec<Incompatibility>` corresponding to the package's dependencies.
Returns a `Vec` corresponding to the package's dependencies.
Returns a ` Vec ` corresponding to the package ' s dependencies .
pub fn incompats(&mut self, pkg: &Summary) -> Result<Vec<Incompatibility>, Error> {
        if pkg == &self.root {
            let mut res = vec![];
            for dep in &self.root_deps {
                res.push(Incompatibility::from_dep(
                    pkg.clone(),
                    (dep.0.clone(), dep.1.complement()),
                ));
            }
            return Ok(res);
        }
        let def_index = self.def_index.clone();
        // If this is a DirectRes dep, we ask the cache for info.
        if let Resolution::Direct(loc) = pkg.resolution() {
            let deps = self
                .direct_checkout(pkg.id(), loc)?
                .meta()
                .deps(&def_index, false);
            let mut res = vec![];
            for dep in deps {
                res.push(Incompatibility::from_dep(
                    pkg.clone(),
                    (dep.0.clone(), dep.1.complement()),
                ));
            }
            return Ok(res);
        }
        let entries = self.indices.entries(pkg.id())?;
        let l = entries.len();
        let (ix, ver, start_deps) = entries
            .get_full(pkg.version())
            .map(|x| (x.0, x.1, &x.2.dependencies))
            .ok_or_else(|| ErrorKind::PackageNotFound)?;
        let mut res = vec![];
        for dep in start_deps {
            let mut lix = ix;
            let mut lower = ver;
            let mut rix = ix;
            let mut upper = ver;
            while lix > 0 {
                lix -= 1;
                let new = entries.get_index(lix).unwrap();
                let new_deps = &new.1.dependencies;
                let mut seen = false;
                for new_dep in new_deps {
                    if dep.name == new_dep.name && dep.index == new_dep.index {
                        let rel = dep.req.relation(&new_dep.req);
                        if rel == Relation::Equal || rel == Relation::Superset {
                            seen = true;
                            lower = &new.0;
                        } else {
                            seen = false;
                        }
                    }
                }
                if !seen {
                    lix += 1;
                    break;
                }
            }
            while rix < l - 1 {
                rix += 1;
                let new = entries.get_index(rix).unwrap();
                let new_deps = &new.1.dependencies;
                let mut seen = false;
                for new_dep in new_deps {
                    if dep.name == new_dep.name && dep.index == new_dep.index {
                        let rel = dep.req.relation(&new_dep.req);
                        if rel == Relation::Equal || rel == Relation::Superset {
                            seen = true;
                            upper = &new.0;
                        } else {
                            seen = false;
                        }
                    }
                }
                if !seen {
                    rix -= 1;
                    break;
                }
            }
            let nl = if lix == 0 && rix == l - 1 {
                Interval::Unbounded
            } else {
                Interval::Closed(lower.clone(), false)
            };
            let nu = if lix == 0 && rix == l - 1 {
                Interval::Unbounded
            } else {
                Interval::Closed(upper.clone(), false)
            };
            let dep_pkg = PackageId::new(dep.name.clone(), dep.index.clone().into());
            let cs = indexmap!(
                pkg.id().clone() => Range::new(nl, nu).unwrap().into(),
                dep_pkg => dep.req.complement(),
            );
            res.push(Incompatibility::new(cs, IncompatibilityCause::Dependency))
        }
        Ok(res)
    }
pub fn incompats ( & mut self , pkg : & Summary ) -> Result < Vec < Incompatibility > , Error > { if pkg == & self . root { let mut res = vec ! [ ] ; for dep in & self . root_deps { res . push ( Incompatibility :: from_dep ( pkg . clone ( ) , ( dep . 0 . clone ( ) , dep . 1 . complement ( ) ) , ) ) ; } return Ok ( res ) ; } let def_index = self . def_index . clone ( ) ; // If this is a DirectRes dep, we ask the cache for info. if let Resolution :: Direct ( loc ) = pkg . resolution ( ) { let deps = self . direct_checkout ( pkg . id ( ) , loc ) ? . meta ( ) . deps ( & def_index , false ) ; let mut res = vec ! [ ] ; for dep in deps { res . push ( Incompatibility :: from_dep ( pkg . clone ( ) , ( dep . 0 . clone ( ) , dep . 1 . complement ( ) ) , ) ) ; } return Ok ( res ) ; } let entries = self . indices . entries ( pkg . id ( ) ) ? ; let l = entries . len ( ) ; let ( ix , ver , start_deps ) = entries . get_full ( pkg . version ( ) ) . map ( | x | ( x . 0 , x . 1 , & x . 2 . dependencies ) ) . ok_or_else ( | | ErrorKind :: PackageNotFound ) ? ; let mut res = vec ! [ ] ; for dep in start_deps { let mut lix = ix ; let mut lower = ver ; let mut rix = ix ; let mut upper = ver ; while lix > 0 { lix -= 1 ; let new = entries . get_index ( lix ) . unwrap ( ) ; let new_deps = & new . 1 . dependencies ; let mut seen = false ; for new_dep in new_deps { if dep . name == new_dep . name && dep . index == new_dep . index { let rel = dep . req . relation ( & new_dep . req ) ; if rel == Relation :: Equal || rel == Relation :: Superset { seen = true ; lower = & new . 0 ; } else { seen = false ; } } } if ! seen { lix += 1 ; break ; } } while rix < l - 1 { rix += 1 ; let new = entries . get_index ( rix ) . unwrap ( ) ; let new_deps = & new . 1 . dependencies ; let mut seen = false ; for new_dep in new_deps { if dep . name == new_dep . name && dep . index == new_dep . index { let rel = dep . req . relation ( & new_dep . req ) ; if rel == Relation :: Equal || rel == Relation :: Superset { seen = true ; upper = & new . 0 ; } else { seen = false ; } } } if ! seen { rix -= 1 ; break ; } } let nl = if lix == 0 && rix == l - 1 { Interval :: Unbounded } else { Interval :: Closed ( lower . clone ( ) , false ) } ; let nu = if lix == 0 && rix == l - 1 { Interval :: Unbounded } else { Interval :: Closed ( upper . clone ( ) , false ) } ; let dep_pkg = PackageId :: new ( dep . name . clone ( ) , dep . index . clone ( ) . into ( ) ) ; let cs = indexmap ! ( pkg id ( ) clone ( ) Range new ( nl nu ) unwrap ( ) into ( ) dep_pkg dep req complement ( ) ) ; res . push ( Incompatibility :: new ( cs , IncompatibilityCause :: Dependency ) ) } Ok ( res ) }
Returns a `Vec<Incompatibility>` corresponding to the package's dependencies.
Returns a ` Vec<Incompatibility > ` corresponding to the package ' s dependencies .
&mut self
pkg
&Summary