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("mismatched types"),
11 annotation_type
: AnnotationType
::Error
,
13 footer
: vec
![Annotation
{
15 "expected type: `snippet::Annotation`\n found type: `__&__snippet::Annotation`",
18 annotation_type
: AnnotationType
::Note
,
21 source
: " slices: vec![\"A\",",
23 origin
: Some("src/multislice.rs"),
25 annotations
: vec
![SourceAnnotation
{
26 label
: "expected struct `annotate_snippets::snippet::Slice`, found reference",
28 annotation_type
: AnnotationType
::Error
,
37 let dl
= DisplayList
::from(snippet
);