1 use annotate_snippets
::{
2 display_list
::{DisplayList, FormatOptions}
,
3 snippet
::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation}
,
7 let snippet
= Snippet
{
8 title
: Some(Annotation
{
9 label
: Some("expected type, found `22`"),
11 annotation_type
: AnnotationType
::Error
,
15 source
: r
#" annotations: vec![SourceAnnotation {
16 label: "expected struct `annotate_snippets::snippet::Slice`, found reference"
20 origin
: Some("examples/footer.rs"),
25 annotation_type
: AnnotationType
::Error
,
29 label
: "while parsing this struct",
30 annotation_type
: AnnotationType
::Info
,
41 let dl
= DisplayList
::from(snippet
);