pub(crate) fn add(&mut self, predicate: WherePredicate) -> Result<(), Error> {
        match predicate {
            WherePredicate::Type(predicate_type) => self
                .for_types
                .entry(TypePredicateLhs {
                    lifetimes: predicate_type.lifetimes,
                    bounded_ty: predicate_type.bounded_ty,
                })
                .or_default()
                .extend(predicate_type.bounds),

            WherePredicate::Lifetime(predicate_lifetime) => self
                .for_lifetimes
                .entry(predicate_lifetime.lifetime)
                .or_default()
                .extend(predicate_lifetime.bounds),

            WherePredicate::Eq(PredicateEq { eq_token, .. }) => {
                // currently unsupported in Rust
                // see https://github.com/rust-lang/rust/issues/20041
                return Err(syn::Error::new_spanned(
                    eq_token,
                    "equality constraints in `where` clauses are not supported",
                )
                .into());
            }
        }

        Ok(())
    }
/// Adds the given predicate to this set
Adds the given predicate to this set
Adds the given predicate to this set
pub(crate) fn add(&mut self, predicate: WherePredicate) -> Result<(), Error> {
        match predicate {
            WherePredicate::Type(predicate_type) => self
                .for_types
                .entry(TypePredicateLhs {
                    lifetimes: predicate_type.lifetimes,
                    bounded_ty: predicate_type.bounded_ty,
                })
                .or_default()
                .extend(predicate_type.bounds),
            WherePredicate::Lifetime(predicate_lifetime) => self
                .for_lifetimes
                .entry(predicate_lifetime.lifetime)
                .or_default()
                .extend(predicate_lifetime.bounds),
            WherePredicate::Eq(PredicateEq { eq_token, .. }) => {
                // currently unsupported in Rust
                // see https://github.com/rust-lang/rust/issues/20041
                return Err(syn::Error::new_spanned(
                    eq_token,
                    "equality constraints in `where` clauses are not supported",
                )
                .into());
            }
        }
        Ok(())
    }
pub ( crate ) fn add ( & mut self , predicate : WherePredicate ) -> Result < ( ) , Error > { match predicate { WherePredicate :: Type ( predicate_type ) => self . for_types . entry ( TypePredicateLhs { lifetimes : predicate_type . lifetimes , bounded_ty : predicate_type . bounded_ty , } ) . or_default ( ) . extend ( predicate_type . bounds ) , WherePredicate :: Lifetime ( predicate_lifetime ) => self . for_lifetimes . entry ( predicate_lifetime . lifetime ) . or_default ( ) . extend ( predicate_lifetime . bounds ) , WherePredicate :: Eq ( PredicateEq { eq_token , .. } ) => { // currently unsupported in Rust // see https://github.com/rust-lang/rust/issues/20041 return Err ( syn :: Error :: new_spanned ( eq_token , " " , ) . into ( ) ) ; } } Ok ( ( ) ) }
Adds the given predicate to this set
Adds the given predicate to this set
&mut self
predicate
WherePredicate
&mut self
predicate
WherePredicate