/// Map a term to a label.
///
/// Returns the statement the label refers to.
Map a term to a label.
Returns the statement the label refers to.
Map a term to a label . Returns the statement the label refers to .
pub fn term_to_label(&self, term: Spanned<Term>) -> Result<Spanned<StmtRef>> {
        let span = term.span;
        let def = self.term_to_ident(term)?;
        Ok(Spanned::new(
            match def.value {
                Def::Stmt(id) => id,
                _ => {
                    self.emit(
                        DiagBuilder2::error(format!(
                            "`{}` is not a statement label",
                            span.extract()
                        ))
                        .span(span)
                        .add_note(format!("`{}` was defined here:", span.extract()))
                        .span(def.span),
                    );
                    debugln!("The definition is a {:?}", def.value);
                    return Err(());
                }
            },
            span,
        ))
    }
pub fn term_to_label ( & self , term : Spanned < Term > ) -> Result < Spanned < StmtRef > > { let span = term . span ; let def = self . term_to_ident ( term ) ? ; Ok ( Spanned :: new ( match def . value { Def :: Stmt ( id ) => id , _ => { self . emit ( DiagBuilder2 :: error ( format ! ( " " span extract ( ) ) ) . span ( span ) . add_note ( format ! ( " " span extract ( ) ) ) . span ( def . span ) , ) ; debugln ! ( " " def value ) ; return Err ( ( ) ) ; } } , span , ) ) }
Map a term to a label.
Map a term to a label .
&self
term
Spanned<Term>