@@ -5,7 +5,6 @@ fn main() {
5
5
let source = r#"// Make sure "highlighted" code is colored purple
6
6
7
7
//@ compile-flags: --error-format=human --color=always
8
- //@ error-pattern:[35mfor<'a> [0m
9
8
//@ edition:2018
10
9
11
10
use core::pin::Pin;
@@ -24,8 +23,7 @@ fn wrapped_fn<'a>(_: Box<(dyn Any + Send)>) -> Pin<Box<(
24
23
25
24
fn main() {
26
25
query(wrapped_fn);
27
- }
28
- "# ;
26
+ }"# ;
29
27
30
28
let magenta = annotate_snippets:: renderer:: AnsiColor :: Magenta
31
29
. on_default ( )
@@ -43,25 +41,39 @@ fn main() {
43
41
magenta. render_reset( )
44
42
) ;
45
43
46
- let message = Level :: ERROR . header ( "mismatched types" ) . id ( "E0308" ) . group (
47
- Group :: new ( )
48
- . element (
49
- Snippet :: source ( source)
50
- . fold ( true )
51
- . origin ( "$DIR/highlighting.rs" )
52
- . annotation (
53
- AnnotationKind :: Primary
54
- . span ( 589 ..599 )
55
- . label ( "one type is more general than the other" ) ,
56
- )
57
- . annotation (
58
- AnnotationKind :: Context
59
- . span ( 583 ..588 )
60
- . label ( "arguments to this function are incorrect" ) ,
61
- ) ,
62
- )
63
- . element ( Level :: NOTE . title ( & title) ) ,
64
- ) ;
44
+ let message = Level :: ERROR
45
+ . header ( "mismatched types" )
46
+ . id ( "E0308" )
47
+ . group (
48
+ Group :: new ( )
49
+ . element (
50
+ Snippet :: source ( source)
51
+ . fold ( true )
52
+ . origin ( "$DIR/highlighting.rs" )
53
+ . annotation (
54
+ AnnotationKind :: Primary
55
+ . span ( 553 ..563 )
56
+ . label ( "one type is more general than the other" ) ,
57
+ )
58
+ . annotation (
59
+ AnnotationKind :: Context
60
+ . span ( 547 ..552 )
61
+ . label ( "arguments to this function are incorrect" ) ,
62
+ ) ,
63
+ )
64
+ . element ( Level :: NOTE . title ( & title) ) ,
65
+ )
66
+ . group (
67
+ Group :: new ( )
68
+ . element ( Level :: NOTE . title ( "function defined here" ) )
69
+ . element (
70
+ Snippet :: source ( source)
71
+ . fold ( true )
72
+ . origin ( "$DIR/highlighting.rs" )
73
+ . annotation ( AnnotationKind :: Context . span ( 200 ..333 ) . label ( "" ) )
74
+ . annotation ( AnnotationKind :: Primary . span ( 194 ..199 ) ) ,
75
+ ) ,
76
+ ) ;
65
77
66
78
let renderer = Renderer :: styled ( ) . anonymized_line_numbers ( true ) ;
67
79
anstream:: println!( "{}" , renderer. render( message) ) ;
0 commit comments