pub fn to_footer<'a>(&self, arena: &'a Arena<String>,
      mut to_range: impl FnMut(&FileSpan) -> Option<Range>) -> Vec<Annotation<'a>> {
    match self {
      ElabErrorKind::Boxed(_, Some(info)) =>
        info.iter().map(|(fs, e)| Annotation {
          id: None,
          label: Some(arena.alloc({
            if let Some(Range {start, ..}) = to_range(fs) {
              format!("{}:{}:{}: {}", fs.file.rel(), start.line + 1, start.character + 1, e)
            } else {
              format!("{}:{:#x}: {}", fs.file.rel(), fs.span.start, e)
            }
          })),
          annotation_type: AnnotationType::Note,
        }).collect(),
      _ => vec![]
    }
  }
/// Convert the payload of an elaboration error to the footer data
/// of a [`Snippet`].
///
/// # Parameters
///
/// - `arena`: A temporary [`typed_arena::Arena`] for storing [`String`]s that are
///   allocated for the snippet
/// - `to_range`: a function for converting (index-based) spans to (line/col) ranges
Convert the payload of an elaboration error to the footer data
of a [`Snippet`].
Convert the payload of an elaboration error to the footer data of a [ ` Snippet ` ] .
pub fn to_footer<'a>(&self, arena: &'a Arena<String>,
      mut to_range: impl FnMut(&FileSpan) -> Option<Range>) -> Vec<Annotation<'a>> {
    match self {
      ElabErrorKind::Boxed(_, Some(info)) =>
        info.iter().map(|(fs, e)| Annotation {
          id: None,
          label: Some(arena.alloc({
            if let Some(Range {start, ..}) = to_range(fs) {
              format!("{}:{}:{}: {}", fs.file.rel(), start.line + 1, start.character + 1, e)
            } else {
              format!("{}:{:#x}: {}", fs.file.rel(), fs.span.start, e)
            }
          })),
          annotation_type: AnnotationType::Note,
        }).collect(),
      _ => vec![]
    }
  }
pub fn to_footer < ' a > ( & self , arena : & ' a Arena < String > , mut to_range : impl FnMut ( & FileSpan ) -> Option < Range > ) -> Vec < Annotation < ' a > > { match self { ElabErrorKind :: Boxed ( _ , Some ( info ) ) => info . iter ( ) . map ( | ( fs , e ) | Annotation { id : None , label : Some ( arena . alloc ( { if let Some ( Range { start , .. } ) = to_range ( fs ) { format ! ( " " fs file rel ( ) start line 1 start character 1 e ) } else { format ! ( " " fs file rel ( ) fs span start e ) } } ) ) , annotation_type : AnnotationType :: Note , } ) . collect ( ) , _ => vec ! [ ] } }
Convert the payload of an elaboration error to the footer data
of a [`Snippet`].
Convert the payload of an elaboration error to the footer data of a [ ` Snippet ` ] .
&self
arena
&'a Arena<String>
to_range
impl FnMut(&FileSpan) -> Option<Range>
&self
arena
&'a Arena<String>
A temporary [`typed_arena::Arena`] for storing [`String`]s that are
allocated for the snippet
A temporary [ ` typed_arena :: Arena ` ] for storing [ ` String ` ] s that are allocated for the snippet
to_range
impl FnMut(&FileSpan) -> Option<Range>
a function for converting (index-based) spans to (line/col) ranges
a function for converting ( index - based ) spans to ( line / col ) ranges