2024-10-25 17:01:20 +00:00
<svg width= "1104px" height= "344px" xmlns= "http://www.w3.org/2000/svg" >
<style >
.fg { fill: #AAAAAA }
.bg { background: #000000 }
.fg-ansi256-009 { fill: #FF5555 }
.fg-ansi256-010 { fill: #55FF55 }
.fg-ansi256-012 { fill: #5555FF }
.fg-magenta { fill: #AA00AA }
.container {
padding: 0 10px;
line-height: 18px;
}
.bold { font-weight: bold; }
tspan {
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
white-space: pre;
line-height: 18px;
}
</style>
<rect width= "100%" height= "100%" y= "0" rx= "4.5" class= "bg" />
<text xml:space= "preserve" class= "container fg" >
<tspan x= "10px" y= "28px" > <tspan class= "fg-ansi256-009 bold" > error[E0277]</tspan> <tspan class= "bold" > : the trait bound `Struct: Foo< i32> ` is not satisfied</tspan>
</tspan>
<tspan x= "10px" y= "46px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > --> </tspan> <tspan > $DIR/highlight-difference-between-expected-trait-and-found-trait.rs:16:13</tspan>
</tspan>
<tspan x= "10px" y= "64px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan>
</tspan>
<tspan x= "10px" y= "82px" > <tspan class= "fg-ansi256-012 bold" > LL</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan> <tspan > fn foo() -> impl Foo< i32> {</tspan>
</tspan>
2024-10-24 21:14:17 +00:00
<tspan x= "10px" y= "100px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-009 bold" > ^^^^^^^^^^^^^</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-009 bold" > the trait `Bar< i32> ` is not implemented for `Struct`</tspan>
2024-10-25 17:01:20 +00:00
</tspan>
<tspan x= "10px" y= "118px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan>
</tspan>
Tweak highlighting when trait is available for different type
When printing
```
= help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>`
= help: for that trait implementation, expected `((), ())`, found `()`
```
Highlight only the `expected` and `found` types, instead of the full type in the first `help`.
2024-10-24 00:20:04 +00:00
<tspan x= "10px" y= "136px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > = </tspan> <tspan class= "bold" > help</tspan> <tspan > : the trait `Bar< ()> ` </tspan> <tspan class= "fg-magenta bold" > is</tspan> <tspan > implemented for `Struct`</tspan>
2024-10-25 17:01:20 +00:00
</tspan>
Tweak highlighting when trait is available for different type
When printing
```
= help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>`
= help: for that trait implementation, expected `((), ())`, found `()`
```
Highlight only the `expected` and `found` types, instead of the full type in the first `help`.
2024-10-24 00:20:04 +00:00
<tspan x= "10px" y= "154px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > = </tspan> <tspan class= "bold" > help</tspan> <tspan > : for that trait implementation, expected `</tspan> <tspan class= "fg-magenta bold" > ()</tspan> <tspan > `, found `</tspan> <tspan class= "fg-magenta bold" > i32</tspan> <tspan > `</tspan>
2024-10-25 17:01:20 +00:00
</tspan>
<tspan x= "10px" y= "172px" > <tspan class= "fg-ansi256-010 bold" > note</tspan> <tspan > : required for `Struct` to implement `Foo< i32> `</tspan>
</tspan>
<tspan x= "10px" y= "190px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > --> </tspan> <tspan > $DIR/highlight-difference-between-expected-trait-and-found-trait.rs:11:12</tspan>
</tspan>
<tspan x= "10px" y= "208px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan>
</tspan>
<tspan x= "10px" y= "226px" > <tspan class= "fg-ansi256-012 bold" > LL</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan> <tspan > impl< T, K> Foo< K> for T where T: Bar< K> </tspan>
</tspan>
<tspan x= "10px" y= "244px" > <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > |</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-010 bold" > ^^^^^^</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-010 bold" > ^</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > ------</tspan> <tspan > </tspan> <tspan class= "fg-ansi256-012 bold" > unsatisfied trait bound introduced here</tspan>
</tspan>
<tspan x= "10px" y= "262px" >
</tspan>
<tspan x= "10px" y= "280px" > <tspan class= "fg-ansi256-009 bold" > error</tspan> <tspan class= "bold" > : aborting due to 1 previous error</tspan>
</tspan>
<tspan x= "10px" y= "298px" >
</tspan>
<tspan x= "10px" y= "316px" > <tspan class= "bold" > For more information about this error, try `rustc --explain E0277`.</tspan>
</tspan>
<tspan x= "10px" y= "334px" >
</tspan>
</text>
</svg>