/// Map a term to an element constraint.
Map a term to an element constraint.
Map a term to an element constraint .
pub fn term_to_element_constraint(
        &self,
        term: Spanned<Term>,
    ) -> Result<Spanned<hir::ElementConstraint>> {
        let con = self.term_to_constraint(term)?;
        Ok(Spanned::new(
            match con.value {
                hir::Constraint::Array(c) => c.into(),
                hir::Constraint::Record(c) => c.into(),
                _ => {
                    self.emit(
                        DiagBuilder2::error(format!(
                            "`{}` is not a valid element constraint",
                            con.span.extract()
                        ))
                        .span(con.span)
                        .add_note(
                            "Did you mean an array or record constraint (`(...)`)? See IEEE \
                             1076-2008 section 6.3.",
                        ),
                    );
                    debugln!("It is a {:#?}", con);
                    return Err(());
                }
            },
            con.span,
        ))
    }
pub fn term_to_element_constraint ( & self , term : Spanned < Term > , ) -> Result < Spanned < hir :: ElementConstraint > > { let con = self . term_to_constraint ( term ) ? ; Ok ( Spanned :: new ( match con . value { hir :: Constraint :: Array ( c ) => c . into ( ) , hir :: Constraint :: Record ( c ) => c . into ( ) , _ => { self . emit ( DiagBuilder2 :: error ( format ! ( " " con span extract ( ) ) ) . span ( con . span ) . add_note ( " \
 " , ) , ) ; debugln ! ( " " con ) ; return Err ( ( ) ) ; } } , con . span , ) ) }
Map a term to an element constraint.
Map a term to an element constraint .
&self
term
Spanned<Term>