fn introduce<I>(&self, binders: I) -> LowerResult<Self>
    where
        I: IntoIterator<Item = chalk_ir::ParameterKind<Ident>>,
        I::IntoIter: ExactSizeIterator,
    {
        let binders = binders.into_iter().enumerate().map(|(i, k)| (k, i));
        let len = binders.len();
        let parameter_map: ParameterMap = self
            .parameter_map
            .iter()
            .map(|(&k, &v)| (k, v + len))
            .chain(binders)
            .collect();
        if parameter_map.len() != self.parameter_map.len() + len {
            Err(RustIrError::DuplicateOrShadowedParameters)?;
        }
        Ok(Env {
            parameter_map,
            ..*self
        })
    }
/// Introduces new parameters, shifting the indices of existing
/// parameters to accommodate them. The indices of the new binders
/// will be assigned in order as they are iterated.
Introduces new parameters, shifting the indices of existing
parameters to accommodate them. The indices of the new binders
will be assigned in order as they are iterated.
Introduces new parameters shifting the indices of existing parameters to accommodate them . The indices of the new binders will be assigned in order as they are iterated .
fn introduce<I>(&self, binders: I) -> LowerResult<Self>
    where
        I: IntoIterator<Item = chalk_ir::ParameterKind<Ident>>,
        I::IntoIter: ExactSizeIterator,
    {
        let binders = binders.into_iter().enumerate().map(|(i, k)| (k, i));
        let len = binders.len();
        let parameter_map: ParameterMap = self
            .parameter_map
            .iter()
            .map(|(&k, &v)| (k, v + len))
            .chain(binders)
            .collect();
        if parameter_map.len() != self.parameter_map.len() + len {
            Err(RustIrError::DuplicateOrShadowedParameters)?;
        }
        Ok(Env {
            parameter_map,
            ..*self
        })
    }
fn introduce < I > ( & self , binders : I ) -> LowerResult < Self > where I : IntoIterator < Item = chalk_ir :: ParameterKind < Ident > > , I :: IntoIter : ExactSizeIterator , { let binders = binders . into_iter ( ) . enumerate ( ) . map ( | ( i , k ) | ( k , i ) ) ; let len = binders . len ( ) ; let parameter_map : ParameterMap = self . parameter_map . iter ( ) . map ( | ( & k , & v ) | ( k , v + len ) ) . chain ( binders ) . collect ( ) ; if parameter_map . len ( ) != self . parameter_map . len ( ) + len { Err ( RustIrError :: DuplicateOrShadowedParameters ) ? ; } Ok ( Env { parameter_map , .. * self } ) }
Introduces new parameters, shifting the indices of existing
parameters to accommodate them.
Introduces new parameters shifting the indices of existing parameters to accommodate them .
&self
binders
I
&self
binders
I